Features

Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Help  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 4
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 3574 times and has 3 replies Next Thread
lnk7
Newbie




Joined: Mar 11, 2015
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
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.
[Aug 12, 2015 2:32:40 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
clanmills
Member
Member's Avatar

England
Joined: May 16, 2014
Post Count: 33
Status: Offline
Reply to this Post  Reply with Quote 
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.
[Aug 12, 2015 10:28:39 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    http://clanmills.com [Link] Report threatening or abusive post: please login first  Go to top 
lnk7
Newbie




Joined: Mar 11, 2015
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
Re: Add folder to compile using ant and build.xml

It has no way to include the folder by build.xml?
I needed to build the build.xml with this folder
[Aug 14, 2015 1:35:47 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 5841
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[Aug 14, 2015 3:04:29 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    http://www.eteks.com [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2017 eTeks - All rights reserved