Custom Flex Ant build task
-
03-07-2019 - |
Question
A beginner's question.
I'm building a .swf with Flex Ant.
To my .swf I link a file, target.as
, which I generate from file source.txt
with command
./tool.sh source.txt > target.as
How can I add what is described in the above sentence to my ant build process?
Solution
The exec task executes any external program:
<exec executable="${basedir}/tool.sh" dir="${basedir}" output="target.as">
<arg path="source.txt"/>
</exec>
So if you use the mxmlc ant task to compile your swf, you can define your build task like this:
<target name="build">
<exec executable="${basedir}/tool.sh" dir="${basedir}" output="target.as">
<arg path="source.txt"/>
</exec>
<mxmlc ....>
...
</mxmlc>
</target>
OTHER TIPS
To run that command in Ant use the exec
task.
<exec executable="tool.sh" dir="toolshdir" output="target.as">
<arg value="source.txt" />
</exec>
http://livedocs.adobe.com/flex/3/html/anttasks_1.html
You may also want to use the Flex "mxmlc" task instead of calling it with exec. You can do a lot of configuration right within the XML if you'd prefer not to have to maintain the shell script.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow