[CLOSED] Add sources jars to lwjgl distribution

Started by ruben01, January 17, 2011, 19:29:34

Previous topic - Next topic

ruben01

Hi, I would like to add generation of sources jars to the lwjgl build, this would allow people to add view source support to their IDEs with minimum hassle.

For example have a:

       
  • lwjgl-sources.jar with the matching sources of lwjgl.jar
  • lwjgl_util-sources.jar ... lwjgl_util.jar
  • etc.

this is way easier than having to download the sources distribution, joining the generated sources with the common ones, and filtering by package to generate all the sources jars (or not filtering and having all the sources in one jar).

the way I am thinking about implementing this, is changing the ant build to use patternsets instead of directly filesets to generate two filesets with the same inclusions/exclusions but pointing to both the sources and classes with no xml duplication.

Hope you like the idea.

Ruben




Matthias

In Netbeans I can use the source zip as is without the need to generate or filter anything.

jediTofu

Personally, adding the source .zip doesn't work for me in NB.  Try right clicking a method call or import and going into the source.  I finally figured out that it expects the pattern of the file structure to be a certain way, and that's why in the NB tutorial, you have to extract the .zip and select the folders, like ruben01 is talking about.  Slick-Util's source .zip does this correctly.

For me, it's not that big of hassle, and it wouldn't be too-too difficult to write an Ant build script (or batch or shell) to download the files, extract them, and rezip them appropriately.  The reason the source .zip file structure is setup like it is - is because it has both C and Java code, and it's mainly meant for compiling the native code and not being able to step into the Java source code.  It would be nice though if it was setup appropriately like ruben01 has stated, but it's not a big deal either.  I could write an Ant script and share it here, if anyone wants me too.
cool story, bro

ruben01

The reasons I want this are two, first I think it is nicer this way, and didn't know that it worked like Matthias said. Adding the whole zip works in my eclipse instalation.
Even though it works you get a lot of unneded stuff, like the templates, and the natives sources, with ant that gets a lot of people to commit libraries and and ide stuff (libraries sources and project files, etc) the size matters.

The other reason I want this, is because I want to in the end be able to have the lwjgl build generate artifacts that fulfill the requirements for inclusion in the maven central repo.

I made the modifications to the lwjgl  ant files to generate the sources for the main jars (lwjgl.jar, lwjgl_util.jar and lwjgl_util_applet.jar) I will double check and post a patch.

jediTofu

cool story, bro

ruben01

Attached patch to generate sources jar for lwjgl.jar, lwjgl_util.jar and lwjgl_util_applet.jar

The patch was generated with git.

Hope it works

EDIT: changed patch because it got broken somehow
EDIT2: changed again, attaching txt files breaks them, trying with a zip

kappa

Further to the discussed on IRC about why more jars is not a practical idea, that its possible to use the current source jar with ide's and that the other maven patch is now added to the lwjgl build, i'll mark this as closed.

jediTofu

I decided to add my ant build script.  If you're a Java programmer, then there's a 95% chance you have Ant installed, and since Ant uses Java, it will work on your OS.  This "fixes" the source zip in the right file structure and only includes the Java files (as is required).

Note:  Change ".txt" to ".xml" for the file name...as ".xml" is not a currently allowed file type to upload (nor is a blank file type allowed).

For inquiries, PM me.
To view options:   ant -f ant-lwjgl-source-zip.xml -p
To run default:  ant -f ant-lwjgl-source-zip.xml
To run a command:  ant -f ant-lwjgl-source-zip.xml clean lwjgl-nightly
cool story, bro