-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
63 lines (52 loc) · 2.25 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="as3-async">
<property file="user.properties" />
<property file="build.properties" />
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<taskdef resource="flexUnitTasks.tasks" classpath="${lib.dir}/flexUnitTasks-4.0.0.jar" />
<target name="init">
<delete dir="${bin.dir}" />
<delete dir="${report.dir}" />
<mkdir dir="${bin.dir}" />
<mkdir dir="${report.dir}" />
</target>
<target name="compile" depends="init" description="Compile SWC">
<compc output="${bin.dir}/${project.versionedname}.swc">
<source-path path-element="${src.dir}" />
<include-sources dir="${src.dir}" includes="*" />
<compiler.external-library-path dir="${lib.dir}" append="true">
<include name="*.swc" />
</compiler.external-library-path>
<keep-as3-metadata name="Marshall" />
</compc>
</target>
<target name="test" depends="compile" description="Run unit tests">
<mxmlc file="${test-src.dir}/TestRunner.as" output="${bin.dir}/TestRunner.swf">
<compiler.library-path dir="${bin.dir}" append="true">
<include name="${project.versionedname}.swc" />
</compiler.library-path>
<compiler.library-path dir="${lib.dir}" append="true">
<include name="*.swc" />
</compiler.library-path>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
</mxmlc>
<flexunit swf="${bin.dir}/TestRunner.swf" toDir="${report.dir}" haltonfailure="false" failureproperty="tests.failed" timeout="10000" localtrusted="true" />
<delete file="${bin.dir}/TestRunner.swf" />
<junitreport todir="${report.dir}">
<fileset dir="${report.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${report.dir}/html" />
</junitreport>
<fail if="tests.failed" />
</target>
<target name="package" depends="test" description="Package the project for distribution">
<delete dir="${dist.dir}" />
<mkdir dir="${dist.dir}" />
<zip destfile="${dist.dir}/${project.versionedname}.zip">
<zipfileset dir="${bin.dir}" includes="${project.versionedname}.swc" prefix="bin" />
<zipfileset dir="${lib.dir}" excludes="flexunit*" prefix="libs" />
<zipfileset dir="${basedir}" includes="README.mkd" />
</zip>
</target>
</project>