Ant Tips
Use ant to create a properties java file which can be compiled
<geshi lang="xml">
<target name="build-properties"> <copy todir="src"> <fileset dir="src"> <include name="**/*.hava"/> </fileset> <globmapper from="*.hava" to="*.java"/> <filterset> <filtersfile file="src/resources/messages_en_AU_company.properties" /> </filterset> </copy> </target>
</geshi>
Ant is great, but the XML gets to suck after a while.
Excerpt from James Duncan Davidson, the author of Ant.
If I knew then what I knew now, I would have tried using a real scripting language, such as ~JavaScript via the Rhino component or Python via JPython, with bindings to Java objects which implemented the functionality expressed in todays tasks. Then, there would be a first class way to express logic and we wouldn't be stuck with XML as a format that is too bulky for the way that people really want to use the tool.
Ant is giving you this error when using a fileset:
java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException
You need to download the Jararta ORO libarary. Install the jar in you ant/lib directory.
! You get some stack trace like this:
java.lang.NumberFormatException: multiple points at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1067) at java.lang.Double.parseDouble(Double.java:220) at java.text.DigitList.getDouble(DigitList.java:127) at java.text.DecimalFormat.parse(DecimalFormat.java:1070) at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1705) at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1156) at java.text.DateFormat.parse(DateFormat.java:333)
This might be caused by your ~SimpleDateFormat object being used concurrently. The spec says you can't:
Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.
How to require an environment variable in an Ant file
<property environment="env"/><BR> <fail message="Provide MY_VAR" unless="env.MY_VAR"/>