LWJGL
May 20, 2013, 05:22:25 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: [CLOSED] Add sources jars to lwjgl distribution  (Read 3677 times)
ruben01
Newbie
*
Posts: 38


WWW
« on: January 17, 2011, 11:29:34 »

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



Logged

Matthias
Talks Too Much
***
Posts: 180


WWW
« Reply #1 on: January 17, 2011, 12:47:25 »

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

jediTofu
Prolific Timewaster
****
Posts: 280



« Reply #2 on: January 17, 2011, 14:17:50 »

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.
Logged

cool story, bro
ruben01
Newbie
*
Posts: 38


WWW
« Reply #3 on: January 17, 2011, 14:23:34 »

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.
Logged

jediTofu
Prolific Timewaster
****
Posts: 280



« Reply #4 on: January 17, 2011, 15:01:05 »

Unfortunately, that only works in Eclipse Sad
Logged

cool story, bro
ruben01
Newbie
*
Posts: 38


WWW
« Reply #5 on: January 17, 2011, 15:44:38 »

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
Logged

kappa
Administrator
Nerdus Imperius
*****
Posts: 1112



« Reply #6 on: January 22, 2011, 14:18:37 »

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.
Logged
jediTofu
Prolific Timewaster
****
Posts: 280



« Reply #7 on: January 28, 2011, 04:01:35 »

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
Logged

cool story, bro
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!