forked from benbjohnson/melomel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
137 lines (117 loc) · 5.02 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?xml version="1.0" encoding="utf-8"?>
<project name="melomel" basedir="." default="build">
<!-- Properties -->
<property environment="env"/>
<property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
<property name="compc.jar" value="${FLEX_HOME}/lib/compc.jar" />
<property name="mxmlc.jar" value="${FLEX_HOME}/lib/mxmlc.jar" />
<property name="asdoc.jar" value="${FLEX_HOME}/lib/mxmlc.jar" />
<property name="version" value="0.6.3"/>
<property name="doc.dir" value="${basedir}/doc"/>
<property name="etc.dir" value="${basedir}/etc"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="target.dir" value="${basedir}/target"/>
<!-- Task Definitions -->
<taskdef resource="flexTasks.tasks" classpath="${etc.dir}/flexTasks.jar" />
<taskdef resource="flexUnitTasks.tasks" classpath="${etc.dir}/flexUnitTasks-4.0.0.jar" />
<!-- Target: Build SWC -->
<!-- compc -load-config+=src/main/resources/melomel-config.xml -->
<target name="build">
<mkdir dir="${target.dir}"/>
<java jar="${compc.jar}" fork="true" failonerror="true">
<jvmarg value="-Xmx1024M"/>
<jvmarg value="-Xms512M"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-load-config+=${src.dir}/main/resources/melomel-config.xml"/>
</java>
<java jar="${compc.jar}" fork="true" failonerror="true">
<jvmarg value="-Xmx1024M"/>
<jvmarg value="-Xms512M"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-load-config+=${src.dir}/main/resources/melomel-stub-config.xml"/>
</java>
<move file="${target.dir}/melomel.swc" tofile="${target.dir}/melomel-${version}.swc"/>
<move file="${target.dir}/melomel-stub.swc" tofile="${target.dir}/melomel-stub-${version}.swc"/>
<zip
destfile="${target.dir}/melomel-${version}.zip"
basedir="${target.dir}"
includes="melomel*-${version}.swc"
/>
</target>
<!-- Target: Test -->
<!-- mxmlc -load-config+=src/test/resources/BridgeRunner-config.xml src/test/flex/BridgeRunner.mxml -->
<!-- mxmlc +configname=air -load-config+=src/test/resources/TestRunner-config.xml src/test/flex/TestRunner.mxml -->
<target name="test-build">
<mkdir dir="${target.dir}/test"/>
<!-- Bridge -->
<java jar="${mxmlc.jar}" fork="true" failonerror="true">
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="-load-config+=${src.dir}/test/resources/BridgeRunner-config.xml"/>
<arg value="${src.dir}/test/flex/BridgeRunner.mxml"/>
</java>
<!-- TestRunner -->
<java jar="${mxmlc.jar}" fork="true" failonerror="true">
<jvmarg value="-Xmx1024M"/>
<jvmarg value="-Xms512M"/>
<arg value="+flexlib=${FLEX_HOME}/frameworks"/>
<arg value="+configname=air"/>
<arg value="-load-config+=${src.dir}/test/resources/TestRunner-config.xml"/>
<arg value="${src.dir}/test/flex/TestRunner.mxml"/>
</java>
</target>
<target name="test-run">
<flexunit
player="air"
swf="${target.dir}/test/TestRunner.swf"
toDir="${target.dir}/test"
haltonfailure="false" verbose="true"
localTrusted="true"
headless="true"
/>
</target>
<target name="test-report" depends="test-run">
<junitreport todir="${target.dir}/test">
<fileset dir="${target.dir}/test">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${target.dir}/test/html" />
</junitreport>
</target>
<target name="deps">
<copy file="${src.dir}/test/resources/TestRunner-app.xml" tofile="${target.dir}/test/TestRunner-app.xml" overwrite="true"/>
</target>
<target name="test" depends="deps,test-build,test-run,test-report"/>
<!-- Target: Documentation -->
<target name="doc">
<mkdir dir="${doc.dir}"/>
<!-- Find classes -->
<path id="files">
<fileset dir="${src.dir}/main/flex">
<include name="**/**"/>
</fileset>
</path>
<pathconvert property="classes" pathsep=" " dirsep="." refid="files">
<map from="${src.dir}/main/flex/" to=""/>
<mapper>
<chainedmapper><globmapper from="*.as" to="*"/></chainedmapper>
</mapper>
</pathconvert>
<exec executable="${FLEX_HOME}/bin/asdoc" failonerror="true">
<arg line="-source-path+=${src.dir}/main/flex"/>
<arg line="-doc-classes ${classes}"/>
<arg line="-window-title 'Melomel'"/>
<arg line="-output ${doc.dir}/flex"/>
<arg line="-package melomel.commands 'Contains the classes for executing Melomel actions within the Flash virtual machine.'"/>
<arg line="-package melomel.commands.formatters 'Contains the classes for formatting return objects and errors to the external interface.'"/>
<arg line="-package melomel.commands.parsers 'Contains the classes for parsing messages from the external interface.'"/>
<arg line="-package melomel.core 'Contains the classes responsible for managing the connection to the external interface and proxying objects.'"/>
<arg line="-package melomel.errors 'Contains the standard Melomel error.'"/>
<arg line="-package melomel.mxml 'Contains the MXML interface for automatically connecting to Melomel.'"/>
</exec>
</target>
<!-- Target: Clean -->
<target name="clean">
<delete dir="${target.dir}"/>
<delete dir="${doc.dir}"/>
</target>
</project>