Search code examples
apache-flexantcustom-build-step

Custom Flex Ant build task


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>