Bug 884 - Replace JOCL's build.xml with manual version for better maintenance (dropping NB templates)
Summary: Replace JOCL's build.xml with manual version for better maintenance (dropping...
Status: RESOLVED FIXED
Alias: None
Product: Jocl
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All all
: P1 enhancement
Assignee: Wade Walker
URL:
Depends on:
Blocks: 863
  Show dependency treegraph
 
Reported: 2013-11-01 03:08 CET by Sven Gothel
Modified: 2014-01-26 03:02 CET (History)
3 users (show)

See Also:
Type: ---
SCM Refs:
9ecc606bce374ea093c6321f2d4921b5019a0b18 5c5f3b4785835b8abf53474b0c9dc248d1b8dab6 f9214217defbcc2a640e80a68f1270ee1e428cf2 52a1b51d7281640ed525d07fe22d14de54b398d0 ac84afd26ad3b34851a423fb90e6c819b9dc9495
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2013-11-01 03:08:48 CET
JOCL's build.xml is based on NB's template, which is impossible to maintain.

We shall replace it w/ our own build.xml style, i.e. copy JOAL's or JOGL's 
and adapt it. JOAL's build.xml should be most close to JOCL's complecity.

While doing so, JOCL shall only generate code and compile components 
if they are 'new' - currently they are always generated and compiled
which makes development a PIA.
Comment 1 Wade Walker 2013-11-25 22:07:28 CET
Is anyone working on this? If not, I can give it a shot.
Comment 2 Harvey Harrison 2013-11-25 22:13:07 CET
I didn't get very far, feel free to have at it.

Harvey
Comment 3 Wade Walker 2013-11-26 03:22:43 CET
OK, I'm on it -- will report back once I've made some progress.
Comment 4 Wade Walker 2013-11-30 19:30:44 CET
Working on this now. Unless anyone has objections, I may do it in two parts -- first migrating to the new make/build.xml based on JOAL's build, then after that works, moving the files around to match the layout of the other JogAmp projects (e.g. Java source in src/java, C code in src/native).
Comment 5 Harvey Harrison 2013-11-30 19:41:30 CET
That sounds like an excellent plan Wade.  I think you're right about moving the build structure second, as if you do your version in make/build.xml, you can have both in parallel for a bit without breaking anything, and eventually when eveything works, you can just kill the build.xml that is up at the root folder currently.
Comment 6 Wade Walker 2013-12-08 21:35:37 CET
Making progress on this. I've got the classes, natives, JARs and tests building, and many of the tests pass now. I still need to get the rest of the tests passing, then carefully compare the results to the original build.
Comment 7 Wade Walker 2013-12-15 00:13:32 CET
All the tests pass now, and I've manually compared the results to the original build to insure they're all being run (a bit annoying, since the subtest output is in non-deterministic order).

I've also compared the jocl.jar contents with those of the original build to make sure all the .class files are present and of the same size (they are). One difference is that the original build doesn't compress the JARs, and the new build does.

The next step for me is to remove the unused old build files and create a branch so I can test on Mac and Linux.
Comment 8 Wade Walker 2013-12-15 23:33:00 CET
Branch containing the first version of this fix is at:  https://github.com/WadeWalker/jocl/compare/master...bug_884_replace_netbeans_build_with_jogamp_standard_build

Let me know if you have any feedback or concerns. I'll test this on other platforms and add more commits to fix any problems.
Comment 9 Wade Walker 2013-12-22 20:56:52 CET
Tested and functional on Ubuntu 12.04, MacOS 10.9, and Windows 8. Some tests fail on Mac, but they seem to fail on our build server too, so I'll leave that for a later patch.

Now I'm working on the build to make sure it only rebuilds the minimum set of files when something is changed.
Comment 10 Harvey Harrison 2013-12-26 22:00:02 CET
Wade, have you pushed any of this work out for people to have a look?

I'll likely have enough time to at least give it a read-through if you point me in the right direction.

Harvey
Comment 11 Wade Walker 2013-12-28 00:51:26 CET
Hi Harvey, the first part of the work is visible on my GitHub in https://github.com/WadeWalker/jocl/branches, the branch is named bug_884_replace_netbeans_build_with_jogamp_standard_build. Right now there's only one commit to that branch, which adapts JOAL's build files to JOCL in the simplest way possible. Subsequent commits are coming which will reduce the number of files rebuilt (for example, currently JOAL's build relinks the native code and rebuilds all JAR files every time, even if nothing has changed).

I welcome any feedback, feel free to let me know if you spot any problems. I'll probably add another couple of commits to get the build efficient, then try to get Sven to pull it to the master before I start moving the source files around to match the other JogAmp projects.
Comment 12 Sven Gothel 2013-12-28 00:56:37 CET
(In reply to comment #11)
> Hi Harvey, the first part of the work is visible on my GitHub in
> https://github.com/WadeWalker/jocl/branches, the branch is named
> bug_884_replace_netbeans_build_with_jogamp_standard_build. Right now there's
> only one commit to that branch, which adapts JOAL's build files to JOCL in
> the simplest way possible. Subsequent commits are coming which will reduce
> the number of files rebuilt (for example, currently JOAL's build relinks the
> native code and rebuilds all JAR files every time, even if nothing has
> changed).
> 
> I welcome any feedback, feel free to let me know if you spot any problems.
> I'll probably add another couple of commits to get the build efficient, then
> try to get Sven to pull it to the master before I start moving the source
> files around to match the other JogAmp projects.

Sweet. Thank you Wade. 

Glancing over your commit while not validating the details,
all looks familiar now - enabling us to maintain and to add new things.

KUDOS.
Comment 13 Sven Gothel 2014-01-25 00:46:01 CET
Sorry for bothering Wade, can I merge and test your [preliminary] version ?
Comment 14 Wade Walker 2014-01-25 04:26:36 CET
(In reply to comment #13)

Sure, I tested it manually, but only on three platform/OS combinations, so more testing is welcome. I'm still working on further optimizing the build, but progress has been slow because my wife and I got a new puppy last month, and her training has been cutting into my coding time :)
Comment 15 Sven Gothel 2014-01-25 15:07:45 CET
(In reply to comment #14)
> (In reply to comment #13)
> 
> Sure, I tested it manually, but only on three platform/OS combinations, so
> more testing is welcome. I'm still working on further optimizing the build,
> but progress has been slow because my wife and I got a new puppy last month,
> and her training has been cutting into my coding time :)

Wuff :)

I merge now and test .. thank you!
Comment 16 Sven Gothel 2014-01-25 16:26:49 CET
First of all: KUDOS to Wade, thank you - works like a charme ..
now we can finally add and improve things properly!

Minor changes:

9ecc606bce374ea093c6321f2d4921b5019a0b18
    The new make/build.xml successfully builds and tests the project. The
    original NetBeans build files are still present, but won't work anymore
    since the resources directory is now inside the make directory. The new
    build files are based on those of JOAL. The new build is not yet minimized
    and cleaned up, because this commit is meant to be the minimum way to get
    things functional.

5c5f3b4785835b8abf53474b0c9dc248d1b8dab6
    Move obsolete NB based build files to 'obsolete.make-nb' ; 
    Fix text file suffix ; 
    Fix Jar Manifest: Move Sealed to bottom.

f9214217defbcc2a640e80a68f1270ee1e428cf2
    Avoid sealed package violation: Move AutoCloseable to com.jogamp.opencl

52a1b51d7281640ed525d07fe22d14de54b398d0
    Add '-b${joal.build.number}' to joal.version / archive.name ; 
    Produce jar and apk files in ${build}/jar (as it was before new build system)
Comment 17 Sven Gothel 2014-01-25 16:28:04 CET
(In reply to comment #16)
> 
> Minor changes:
> 
> 9ecc606bce374ea093c6321f2d4921b5019a0b18
...

oops .. the above is Wade's build system change.

Minor changes are:

> 5c5f3b4785835b8abf53474b0c9dc248d1b8dab6
> f9214217defbcc2a640e80a68f1270ee1e428cf2
> 52a1b51d7281640ed525d07fe22d14de54b398d0
Comment 18 Sven Gothel 2014-01-26 02:25:08 CET
Closing this one .. fixing remaining Android build issue via Bug 863
Comment 19 Sven Gothel 2014-01-26 03:02:06 CET
ac84afd26ad3b34851a423fb90e6c819b9dc9495
  build.xml: Fix jogl.build: Use [passed or default] jogl.build as well as rootrel.build (as gluegen does)