Compiling multiple --resource files

Kirk Vogen kirkvdevw@us.ibm.com
Fri Nov 7 15:06:00 GMT 2003


> I'm trying to put together something that can take .jar files and
> compile non-class files with the --resource option.

> Does anyone have have a piece of ant that can do the trick?

Here's an example of doing the resource compile with Ant. I attached a 
buildfile at the end of this message that will compile all *.properties, 
*.bmp, and *.gif resources in the current directory and subdirectories.
This buildfile is a generic script for compiling up a project to an 
executable using GCJ and SWT. It was taken from the article I published 
last May on IBM developerWorks. It doesn't handle the JAR part that you 
need, but you should be able to cut-and-paste the resource compile part of 
the script.
You'll need to grab four things out of the script.
1. The custom task declaration for 'applyantcall' as well as the 
associated JAR file (which is attached). Place the JAR file in the same 
directory as your Ant script.
2. The Ant target 'resource-compile'.
3. The Ant target 'resource-compile-helper'.
4. The Ant target 'resource-up-to-date'.
Also, you'll need Ant 1.5.0 or higher.
Hopefully, this is what you are looking for. Ideally, it'd be cool to have 
a custom task to do all this, but for now this should do the trick.
Good luck,
Kirk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.xml
Type: application/octet-stream
Size: 9216 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20031107/65a22bae/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: customtasks.jar
Type: application/octet-stream
Size: 16201 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20031107/65a22bae/attachment-0001.obj>


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /