Skip to content

Instantly share code, notes, and snippets.

@timoxley
Created October 12, 2009 01:38
Show Gist options
  • Save timoxley/208048 to your computer and use it in GitHub Desktop.
Save timoxley/208048 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<project name="Flare" basedir="." default="compile">
<property environment="env" />
<property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
<property name="SRC_FOLDER" value="${basedir}/src"/>
<property name="LIBS_FOLDER" value="${basedir}/libs"/>
<property name="OUTPUT_FOLDER" value="${basedir}/bin"/>
<property name="REPORT_FOLDER" value="${basedir}/report"/>
<taskdef resource="flexTasks.tasks" classpath="${env.ANT_HOME}/lib/flexTasks.jar"/>
<taskdef resource="flexUnitTasks.tasks" classpath="${env.ANT_HOME}/lib/flexUnitTasks.jar" />
<target name="init">
</target>
<target name="compile" depends="init">
<mxmlc file="${SRC_FOLDER}/${ant.project.name}.mxml" keep-generated-actionscript="false" output="${OUTPUT_FOLDER}/${ant.project.name}.swf">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.external-library-path dir="${FLEX_HOME}" append="true">
<include name="frameworks/libs" />
</compiler.external-library-path>
<compiler.library-path dir="${basedir}" append="true">
<include name="libs" />
</compiler.library-path>
<compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
<compiler.headless-server>true</compiler.headless-server>
</mxmlc>
</target>
<target name="test" depends="compile">
<mxmlc file="${SRC_FOLDER}/FlexUnitApplication.mxml" keep-generated-actionscript="false" output="${OUTPUT_FOLDER}/${ant.project.name}Tests.swf">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.external-library-path dir="${FLEX_HOME}" append="true">
<include name="frameworks/libs" />
</compiler.external-library-path>
<compiler.library-path dir="${basedir}" append="true">
<include name="libs" />
</compiler.library-path>
<compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
<compiler.headless-server>true</compiler.headless-server>
</mxmlc>
<!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
<flexunit swf="${OUTPUT_FOLDER}/${ant.project.name}Tests.swf" toDir="${REPORT_FOLDER}" haltonfailure="false" verbose="true" localTrusted="true" headless="true"/>
<!-- Generate readable JUnit-style reports -->
<junitreport todir="${REPORT_FOLDER}">
<fileset dir="${REPORT_FOLDER}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${REPORT_FOLDER}/html" />
</junitreport>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment