Renanse/Ardor3D — pull request #12 by neothemachine (2012-12-06 12:51:25+00:00)
Title: Major cleanup and transition to Maven-only

Alright, this is huge. This changeset consists of changes from #9 and some additional ones. The following is a list of all changes done:

1. Removed eclipse .project, .classpath, org.eclipse.core.resources.prefs files
2. Removed timestamp of org.eclipse.jdt.core.prefs and org.eclipse.jdt.ui.prefs files
3. Removed all library files (jar and unpacked natives)
4. Updated jdom dependency to jdom2 2.0.4 and adapted code in ardor3d-collada
5. Changed ardor3d-examples/pom.xml to make use of maven-nativedependencies-plugin for lwjgl
6. Adapted ardor3d-examples/assembly.xml to produce a running example zip
7. Changed ardor3d-lwjgl/pom.xml and removed use of maven-nativedependencies-plugin and direct dependency of jinput (as it's already an indirect dependency of lwjgl)
8. Added ardor3d Nexus repository to ardor3d-swt/pom.xml to have access to newest swt version
9. Added junit as test-dependency in ardor3d-math/pom.xml
10. Added missing Eclipse formatting files in ardor3d-savable

Most of the changes are cleanup which are related to the fact that the binaries aren't stored in the git repository anymore. Some explanations:

(2) Since Eclipse 3.7.2, Eclipse doesn't store the timestamp in .prefs files anymore to prevent those files appearing as changed when you try to commit stuff. It also prevents merge conflicts. I just commited the files that Eclipse wrote when I imported the projects and these files should now don't cause much noise anymore. (Although I noticed a further problem related to Unix/Windows line endings, but we can tackle that issue another time)

(3, 5, 6, 7) Handling native libraries is different for lwjgl and jogl2. While we can make use of maven-nativedependencies-plugin and just unpack the natives for lwjgl, we can't do that for jogl2 as it has its own loader. Also, in jogl2, the natives have overlapping file names for different architectures so it's not even theoretically possible to unpack the native files to one lib folder (which is what maven-nativedependencies-plugin does). I considered this fact and adapted the assembly.xml in the ardor3d-examples project so that it uses the unpacked natives for lwjgl but uses the unchanged native jars for jogl. This assembly mechanism should be regarded as a template for creating distributable game/app packages (zips) and should probably be further improved in the future.

Alright, before applying this pull request, I want you to test the import procedure in Eclipse which I will outline here and which can then serve as a draft for inclusion in the wiki.

Prerequisites:

1. Latest Eclipse 3.x or 4.x with [EGit](http://www.eclipse.org/egit/) and [m2e](http://eclipse.org/m2e/) plugins installed
2. Go to Window -> Preferences -> Team -> Git -> Projects and make a tick at "Auto share projects located in a git repository" if you haven't done so yet. This will simplify the process greatly.

Steps (part 1):

1. Go to File -> Import -> Git -> Projects from Git, press next
2. Select URI, press next
3. Copy "https://github.com/neothemachine/Ardor3D.git" to the URI field, press next, press next
4. Select "dependencies" as initial branch, press next, make some coffee
5. Select "Import as general project" (very important!), press next, press finish
6. Remove the Ardor3D project (yes, really) but **don't** delete project contents on disk.

That was the first part, you could have done the same via command line:
`git clone https://github.com/neothemachine/Ardor3D.git -b dependencies /some/folder`

Part 2:

7. Go to File -> Import -> Maven -> Existing Maven Projects, press next
8. Locate the folder where you checked out Ardor3D, press finish

That's it.

Now, as a test, you could create the examples bundle. Just run the maven "package" goal on ardor3d-examples (right click on project -> run as ... -> maven build ... -> goal "package") and have a look at its target/ folder. And then you could extract that zip somewhere, go into that folder and run it with `java -Djava.library.path=lib -jar ardor3d-examples-0.9-SNAPSHOT.jar`.

To run the examples project directly in Eclipse, you would create a run configuration for the `ExampleRunner` class and add `-Djava.library.path=target/natives` to the VM arguments in the arguments section of the run configuration.

Please try it and report any problems. Look through the code changes and tell me if something should be changed. After we all agree, we can merge it.