Skip to content

Instantly share code, notes, and snippets.

Created March 3, 2014 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9329872 to your computer and use it in GitHub Desktop.
Save anonymous/9329872 to your computer and use it in GitHub Desktop.
ANT : build.xml, build.properties and antlib.cml
<antlib>
<taskdef name="mxmlc" classname="flex.ant.MxmlcTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<taskdef name="flexunit" classname="org.flexunit.ant.tasks.FlexUnitTask" classpath="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target/flexUnitTasks-4.1.0-1.jar"/>
</antlib>
FLEX_HOME = /Users/ymichel/Packages/flex-sdk
FLEXUNIT_HOME = /Users/ymichel/Packages/flexunit
<?xml version="1.0" encoding="UTF-8" ?>
<project name="player" default="all" basedir=".">
<!-- path mapping -->
<property name="ant.dir" location="${basedir}/ant" />
<property name="build.dir" location="${basedir}/build" />
<property name="src.dir" location="${basedir}/src" />
<property name="test.dir" location="${basedir}/test" />
<!-- properties -->
<property file="${ant.dir}/build.properties" />
<typedef file="${ant.dir}/antlib.xml"/>
<!-- default targets -->
<target name="all">
<antcall target="compile"/>
</target>
<!-- compiles the app -->
<target name="compile">
<mkdir dir="${build.dir}"/>
<mxmlc file="${src.dir}/Player.as" output="${build.dir}/player.swf" debug="true" strict="true" optimize="true" advanced-telemetry="true">
<source-path path-element="${src.dir}"/>
</mxmlc>
</target>
<!-- tests the app -->
<target name="test">
<mxmlc file="${test.dir}/TestRunner.as" output="${build.dir}/player-test.swf">
<source-path path-element="${src.dir}"/>
<library-path dir="${FLEXUNIT_HOME}/FlexUnit4/target/" append="true">
<include name="*.swc"/>
</library-path>
</mxmlc>
<flexunit swf="${build.dir}/player-test.swf" haltonFailure="false" verbose="false" toDir="${build.dir}"></flexunit>
</target>
<!-- cleans compiled files -->
<target name="clean">
<delete dir="${build.dir}"/>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment