-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
117 lines (98 loc) · 3.61 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?xml version="1.0" encoding="utf-8"?>
<project name="Mario Module" default="compile" basedir=".">
<description>Mario Module</description>
<property file="${user.home}/.ant.properties"/>
<!-- example for ~/.ant.properties
flex2.home=/usr/share/lib/java/flex2sdk
flexunit.home=/usr/share/lib/flash/flexunit.swc
-->
<property name="app.name" value="mario"/>
<property name="spec.file" value="Root.as"/>
<property name="src" location="src"/>
<property name="res" location="res"/>
<property name="test" location="test"/>
<property name="work" location="work"/>
<target name="clean">
<delete dir="${work}"/>
</target>
<target name="init">
<mkdir dir="${work}"/>
</target>
<!-- -->
<target name="prepare">
<uptodate property="build.done" targetfile="${work}\${app.name}.swf">
<srcfiles dir="${src}">
<include name="**/*.as"/>
<include name="**/*.mxml"/>
</srcfiles>
</uptodate>
</target>
<target name="compile" depends="init,prepare" unless="build.done">
<delete file="${work}/${app.name}.swf"/>
<java classname="flex2.tools.Compiler" classpath="${flex2.home}/lib/mxmlc.jar" fork="true">
<jvmarg value="-Dapplication.home=${flex2.home}"/>
<jvmarg value="-Xmx384m"/>
<jvmarg value="-Dsun.io.useCanonCaches=false"/>
<arg value="-output=${work}/${app.name}.swf"/>
<arg value="-default-size=320,240"/>
<arg value="-default-frame-rate=24"/>
<arg value="-default-background-color=0xFFFFFF"/>
<arg value="-source-path=${res}"/>
<arg value="-debug=false"/>
<arg value="-verbose-stacktraces=false"/>
<arg value="-file-specs=${src}/${spec.file}"/>
</java>
</target>
<target name="run" depends="compile">
<exec executable="${flex2.home}/player/debug/SAFlashPlayer.exe">
<arg value="${work}/${app.name}.swf"/>
</exec>
</target>
<target name="install" depends="compile">
<copy file="${work}/${app.name}.swf" todir="${flash.install.dir}"/>
</target>
<!-- -->
<target name="zip" depends="init">
<zip zipfile="${work}/${app.name}-src.zip">
<zipfileset dir="." excludes="**/work/**" prefix="${app.name}"/>
</zip>
</target>
<target name="backup" depends="zip">
<copy file="${work}/${app.name}-src.zip" todir="${flash.backup.dir}"/>
</target>
<target name="backup.clean">
<delete>
<fileset defaultexcludes="no" dir="." includes="**/*~"/>
</delete>
</target>
<!-- unit test -->
<target name="test.prepare" depends="init">
<uptodate property="test.build.done" targetfile="${work}/${app.name}_test.swf">
<srcfiles dir="${src}">
<include name="**/*.as"/>
<include name="**/*.mxml"/>
</srcfiles>
<srcfiles dir="${test}">
<include name="**/*.as"/>
<include name="**/*.mxml"/>
</srcfiles>
</uptodate>
</target>
<target name="test.compile" depends="test.prepare">
<delete file="${work}/${app.name}_test.swf"/>
<java classname="flex2.tools.Compiler" classpath="${flex2.home}/lib/mxmlc.jar" fork="true">
<jvmarg value="-Dapplication.home=${flex2.home}"/>
<jvmarg value="-Xmx384m"/>
<jvmarg value="-Dsun.io.useCanonCaches=false"/>
<arg value="-output=${work}/${app.name}_test.swf"/>
<arg value="-include-libraries=${flexunit.home}/flexunit.swc"/>
<arg value="-source-path=${src}"/>
<arg value="-file-specs=${test}/${app.name}_test.mxml"/>
</java>
</target>
<target name="test" depends="test.compile">
<exec executable="${flex2.home}/player/debug/SAFlashPlayer.exe">
<arg value="${work}/${app.name}_test.swf"/>
</exec>
</target>
</project>