-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
85 lines (77 loc) · 3.26 KB
/
Copy pathbuild.xml
File metadata and controls
85 lines (77 loc) · 3.26 KB
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
<project name="AS3Sample" basedir="." default="compile">
<!-- Setup a prefix for all environment variables -->
<property environment="env" />
<!-- Setup paths for build -->
<property name="prj.name" value="SampleApp" />
<property name="src.loc" location="${basedir}/src/" />
<property name="main.package.loc" location="${src.loc}/sample" />
<property name="test.src.loc" location="${basedir}/src/tests" />
<property name="lib.loc" location="${basedir}/libs" />
<property name="output.loc" location="${basedir}/target" />
<property name="bin.loc" location="${output.loc}/bin" />
<property name="report.loc" location="${output.loc}/report" />
<property name="dist.loc" location="${output.loc}/dist" />
<!-- Setup Flex and FlexUnit ant tasks -->
<!-- You can set this directly so mxmlc will work correctly, or set FLEX_HOME as an environment variable and use as below -->
<property name="FLEX_HOME" location="${env.FLEX_HOME}" />
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<taskdef resource="flexUnitTasks.tasks">
<classpath>
<fileset dir="${lib.loc}">
<include name="flexUnitTasks*.jar" />
</fileset>
</classpath>
</taskdef>
<!-- Remove all directories created during the build process -->
<target name="clean">
<delete dir="${output.loc}" />
</target>
<!-- Create directories needed for the build process -->
<target name="init">
<mkdir dir="${output.loc}" />
<mkdir dir="${bin.loc}" />
<mkdir dir="${report.loc}" />
<mkdir dir="${dist.loc}" />
</target>
<!-- Compile the sources into an .swf file -->
<target name="compile" depends="init">
<mxmlc file="${main.package.loc}/${prj.name}.as" output="${bin.loc}/${prj.name}.swf">
<library-path dir="${lib.loc}" append="true">
<include name="*.swc" />
</library-path>
<source-path path-element="${src.loc}"></source-path>
<debug>true</debug>
<compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
<compiler.headless-server>true</compiler.headless-server>
<compiler.warn-no-type-decl>false</compiler.warn-no-type-decl>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
</mxmlc>
</target>
<!-- Execute FlexUnit tests and publish JUnit-style reports -->
<target name="test" depends="compile">
<flexunit
workingDir="${bin.loc}"
toDir="${report.loc}"
haltonfailure="false"
verbose="true"
localTrusted="true"
debug="true">
<source dir="${src.loc}" />
<testSource dir="${test.src.loc}">
<include name="**/*Test.as" />
</testSource>
<library dir="${lib.loc}" />
</flexunit>
<junitreport todir="${report.loc}">
<fileset dir="${report.loc}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${report.loc}/html" />
</junitreport>
</target>
<!-- Create an HTML page containing the compiled SWF -->
<target name="html" depends="compile">
<copy file="${bin.loc}/${prj.name}.swf" todir="${dist.loc}" />
<html-wrapper swf="${prj.name}" output="${dist.loc}" height="100%" width="100%" />
</target>
</project>