There must be an easy way to do this. I build a Flex app using ant that depends on a SWC library, which works fine except that it rebuilds the library whether it needs to or not. How do I tell ant to only run the task if any of the sources files of the library (*.as, *.mxml) are newer than the SWC?
I've looked at <dependset> but it only seems to delete files, not determine whether a task should be run or not. <depend> seems to expect a one-to-one relationship between the source and target files rather than a one-to-many relationship -- I have many input files and one output file, but no intermediate object files.
Thanks a lot, Alex
To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.
Destination path is specified using the destdir folder (e.g build. dir). You could filter the javadoc task by specifying the package names which are to be included. This is achieved by using the packagenames attribute, a comma separated list of package files.
Ant allows command line arguments, even arguments which contains space characters. It supports <arg> element to pass arguments and uses various attribute given below.
This task is used to execute Java code inside the Ant JVM. We can also use other (outside) JVM by setting fork attribute true. To get input for the fork JVM, we can use input and inputstring attributes.
You may use the Ant uptodate task to create a property, and execute your other target only if that property is set.
I don't know much about flex, but you probably want something like this:
<?xml version="1.0" encoding="UTF-8"?>
<project name="test" default="compile">
<target name="checkforchanges">
<uptodate property="nochanges">
<srcfiles dir="." includes="**/*.as"/>
<srcfiles dir="." includes="**/*.mxml"/>
<mapper to="applicaton.flex"/>
</uptodate>
</target>
<target name="compile" depends="checkforchanges" unless="nochanges">
...
</target>
</project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With