forked from joelhooks/signals-extensions-CommandSignal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
87 lines (75 loc) · 3.94 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<project name="signals-extension-SignalsCommandMap" basedir="." default="test">
<!-- Set up a prefix for all environment variables. -->
<property environment="env."/>
<fail unless="env.FLEX_HOME" message="FLEX_HOME needs to be defined as an environment variable or in the Ant build." />
<!-- Copy Flex SDK location from environment variable. This can be set manually instead. -->
<property name="FLEX_HOME" value="${env.FLEX_HOME}" />
<property file="build.properties"/>
<taskdef resource="flexUnitTasks.tasks" classpath="${lib.loc}/flexUnitTasks-4.1.0-RC1.x.jar"/>
<target name="compile" description="Compile AS3 code into a SWC">
<echo>Using Flex SDK at: ${FLEX_HOME}</echo>
<java jar="${FLEX_HOME}/lib/compc.jar" dir="." fork="true" failonerror="true">
<arg value="+flexlib=${FLEX_HOME}/frameworks" />
<arg value="-incremental=true" />
<arg value="-source-path+=${src.dir}" />
<!-- Include all classes in this path. -->
<arg value="-include-sources=${src.dir}/${package.dir}" />
<!-- Use classes from these SWCs, but exclude them from our SWC. -->
<arg value="-external-library-path+=${lib.loc}" />
<arg value="-output=${output.swc}" />
</java>
</target>
<target name="clean-asdoc">
<delete dir="${docs.dir}" failOnError="false" includeEmptyDirs="true"/>
<mkdir dir="${docs.dir}"/>
</target>
<!-- Run Unit Tests -->
<target name="test" depends="compile">
<echo>[test] Running Unit Tests</echo>
<!-- Compile test runner as a SWF -->
<java jar="${FLEX_HOME}/lib/mxmlc.jar" dir="${FLEX_HOME}/frameworks" fork="true" failonerror="true">
<arg value="${test.src.loc}/SignalCommandMapTest.as"/>
<arg value="-source-path=${main.src.loc}"/>
<!-- Flash those sweet legs. Blink and you'll miss 'em. -->
<arg value="-output=${bin.loc}/TestRunner.swf"/>
<arg value="-default-size=200,200"/>
<arg value="-default-background-color=0x000000"/>
<!-- Include external libraries omitted from our SWC. -->
<arg value="-library-path+=${lib.loc}"/>
<!-- Build tests against our freshly-generated SWC. -->
<arg value="-library-path+=${output.swc}"/>
<!-- So true. -->
<arg value="-static-link-runtime-shared-libraries=true"/>
<arg value="-incremental=true"/>
<arg value="-verbose-stacktraces=true"/>
<arg value="-headless-server=true"/>
</java>
<!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
<flexunit swf="bin/TestRunner.swf" toDir="${report.loc}" haltonfailure="true" verbose="true" localTrusted="true"/>
<!-- Generate readable JUnit-style reports -->
<junitreport todir="${report.loc}">
<fileset dir="${report.loc}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${report.loc}/html"/>
</junitreport>
<echo>[test] Finished running Unit Tests</echo>
</target>
<!-- Build Documentation -->
<target name="asdoc" depends="compile,clean-asdoc" description="Create API docs for ${project.title}">
<echo>Generating ASDOC documentation...</echo>
<tstamp>
<format property="docgen.time" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
</tstamp>
<java jar="${FLEX_HOME}/lib/asdoc.jar" dir="${FLEX_HOME}/frameworks" fork="true" failonerror="true">
<!--<arg line="-external-library-path ${libs.dir}"/>-->
<arg line="-doc-sources ${src.dir}/${package.dir}"/>
<arg line="-source-path ${src.dir}"/>
<arg line="-output ${docs.dir}"/>
<arg line="-window-title '${project.title} ${ver.num}'"/>
<arg line="-main-title '${project.title} ${ver.num}'"/>
<arg line="-footer '${project.title} - Documentation generated at: ${docgen.time}'"/>
</java>
<echo>ASDOC documentation generated successfully</echo>
</target>
</project>