Joined: Mar 11, 2015
Post Count: 3
Status:
Offline
Add folder to compile using ant and build.xml
Hello
I added a folder in the project and would like to know how to add this folder on build.xml to compile the ant to generate the .jar
I tried to add <include name = "folder/**"/> under <include name = "src/**"/> in build.xml But the ant does not add it and when you run the jar, the part that depends on the folder does not run.
England
Joined: May 16, 2014
Post Count: 33
Status:
Offline
Re: Add folder to compile using ant and build.xml
My project (ToWebPlugin.jar) uses two libraries which are not part of SH3D. They are json-simple-1.1.1.jar and ST-4.0.8.jar. I've added them in Eclipse and everything is good for running/debugging from Eclipse.
To get ToWebPlugin.jar to "see" the libraries for json-simple and ST at run-time outside of Eclipse, I included a "raw" copy of the classfiles from json-simple and ST in ToWebPlugin.jar I did this using a little bash script which rewrites the ToWebPlugin.jar to include the class trees from json-simple and ST. The script does this:
1 Expands ST and json-simple into the temporary directory (with jar xf) 2 Expands ToWebPlugin.jar into a temporary directory (with jar xf) 3 Generates a new ToWebPlugin.jar from the temporary directory (with jar cf)
This has the restriction that ToWebPlugin.jar contains a local copy of the ST and json-simple classfile trees. So, that code isn't shared with SH3D or other plugins. However both ST.jar and json-simple.jar are modest in size and add about 400k to ToWebPlugin.jar which is about 500k before being rebuilt. The redistributable ToWebPlugin.jar is about 900k and works fine on Mac/Windows/Linux.
I haven't investigated how to achieve the unpack/repack jar using ant/maven or any of the Eclipse build magic. When I export a new copy of ToWebPlugin from Eclipse, I have to manually run my build script. Automating this from Eclipse is on my (long) TODO list.
France
Joined: Nov 7, 2005
Post Count: 9423
Status:
Offline
Re: Add folder to compile using ant and build.xml
The documentation page about Ant javac task gives all the détails you need about its includes attribute.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator