Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 155 lines (126 sloc) 5.6 KB
<?xml version="1.0"?>
<project name="BumpslideAS3" basedir="." default="usage">
<!-- based on Jesse Freeman's FlashTDDProject Build File - -->
<!-- identify properties file -->
<property file="" />
<!-- Set up FlexUnit Ant tasks -->
<taskdef resource="flexUnitTasks.tasks" classpath="${lib.loc}/flexUnitTasks.jar" />
<tstamp />
<target name="usage">
<echo message="" />
<echo message="${} Build Usage" />
<echo message="-----------------------------------" />
<echo message="Main targets are:" />
<echo message="compile-swc --> Build ${} SWC, asdoc, test" />
<echo message="" />
<echo message="Additonal targets are:" />
<echo message="asdoc --> Build ${} test and generate asdocs" />
<echo message="test --> Build ${} runs unit tests" />
<echo message="clean --> Remove all folders created by build script" />
<echo message="init --> Clean and create build folders" />
<echo message="-----------------------------------" />
<echo message="disconnect --> Removed git files from project" />
<!-- Deletes .git folder and .gitignore file -->
<target name="disconnect">
<delete dir="${basedir}/.git"/>
<delete file="${basedir}/.gitignore"/>
<!-- Clean Build and Report files -->
<target name="clean">
<!-- Remove all directories created during the build process -->
<echo>[clean] Removing Bin and Report directories</echo>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${report.loc}" defaultexcludes="false">
<include name="**/*" />
<fileset dir="${bin.loc}" defaultexcludes="false">
<include name="**/*" />
<delete dir="${report.loc}" failonerror="true"/>
<delete dir="${bin.loc}" failonerror="true"/>
<echo>[clean] Bin and Report directories removed</echo>
<!-- Create directories needed for the build process -->
<target name="init" depends="clean">
<echo>[init] Creating Bin directory</echo>
<mkdir dir="${bin.loc}" />
<echo>[init] Bin Directory created</echo>
<!-- Run Unit Tests -->
<target name="test" depends="init" if="run.test">
<echo>[test] Running Unit Tests</echo>
<!-- Compile TestRunner.mxml as a SWF -->
<mkdir dir="${report.loc}" />
<java jar="${FLEX_HOME}/lib/mxmlc.jar" dir="${FLEX_HOME}/frameworks" fork="true" failonerror="true">
<arg value="${test.src.loc}/TestRunner.mxml" />
<arg value="-source-path=${main.src.loc}" />
<arg value="-output=${bin.loc}/TestRunner.swf" />
<arg value="-default-size=148,148" />
<arg value="-default-background-color=0x320401" />
<!-- Include classes from SWCs in this folder, but only the ones we use. -->
<arg value="-library-path+=${lib.loc}" />
<arg value="+configname=air" />
<!-- So true. -->
<arg value="-incremental=true" />
<arg value="-verbose-stacktraces=true" />
<arg value="-headless-server=true" />
<!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
<flexunit swf="bin/TestRunner.swf" toDir="${report.loc}" haltonfailure="false" verbose="true" player="air" localTrusted="true" failureproperty="flexunit.failed" />
<!-- Generate readable JUnit-style reports -->
<junitreport todir="${report.loc}">
<fileset dir="${report.loc}">
<include name="TEST-*.xml" />
<report format="frames" todir="${report.loc}/html" />
<echo>[test] Finished running Unit Tests</echo>
<!-- Opens JUnit Report when test fails -->
<target name="junitreport" depends="test" if="flexunit.failed">
<exec executable="open">
<arg line="-a ${browser} ${report.url}" />
<fail>Unit Tests Failed</fail>
<!-- Build Documentation -->
<target name="asdoc" depends="junitreport" if="run.asdoc">
<echo>[create-docs] Generating ASDOC documentation</echo>
<format property="docgen.time" pattern="MM/dd/yyyy hh:mm aa" unit="hour" />
<java jar="${FLEX_HOME}/lib/asdoc.jar" dir="${FLEX_HOME}/frameworks" fork="true" failonerror="true">
<arg line="-external-library-path ${lib.loc}" />
<arg line="-doc-sources ${doc.src.loc}" />
<arg line="-source-path ${main.src.loc}" />
<arg line="-output ${doc.loc}" />
<arg line="-window-title '${}'" />
<arg line="-main-title '${}'" />
<arg line="-footer '${} - Documentation generated at: ${docgen.time}'" />
<arg value="+configname=air" />
<echo>[create-docs] ASDOC documentation generated successfully</echo>
<!-- Compile Release SWC -->
<target name="compile-swc" depends="init">
<echo>[compile] Compiling release SWC</echo>
<echo>[compile] Using Flex SDK at: ${FLEX_HOME}</echo>
<java jar="${FLEX_HOME}/lib/compc.jar" dir="${FLEX_HOME}/frameworks" fork="true" maxmemory="512m" failonerror="true">
<arg value="-output=${bin.loc}/${project.filename}.swc"/>
<!-- the classes we want in the SWC -->
<arg value="-sp+=${main.src.loc}"/>
<arg value="-include-sources=${swc.src.loc}"/>
<!-- the classes we don't want in the SWC -->
<arg value="-external-library-path+=${FLEX_HOME}/frameworks/libs"/>
<arg value="-external-library-path+=${lib.loc}"/>
<arg value="-incremental=true"/>
<arg value="-static-link-runtime-shared-libraries=false"/>
<arg value="-verbose-stacktraces=true"/>
<arg value="-headless-server=true"/>
<arg value="+configname=air" />
<echo>[compile] Release SWC ${project.filename}.swc created successfully in ${bin.loc}</echo>