0

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?

Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160

3 Answers3

4

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>
martin clayton
  • 76,436
  • 32
  • 213
  • 198
Simon Lehmann
  • 10,737
  • 4
  • 41
  • 53
2

To run that command in Ant use the exec task.

<exec executable="tool.sh" dir="toolshdir" output="target.as">
    <arg value="source.txt" />
</exec>
martin clayton
  • 76,436
  • 32
  • 213
  • 198
Adam Peck
  • 6,930
  • 3
  • 23
  • 27
1

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.

cliff.meyers
  • 17,666
  • 5
  • 51
  • 66