My favorites
▼
|
Sign in
ci-example
Continuous Integration For Flash Example Project
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
build.xml
r2
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
<?xml version="1.0" encoding="utf-8" ?>
<project name="ci-example" basedir="." default="build">
<!-- identify properties file -->
<property file="build.properties" />
<!-- identify environment variables -->
<property environment="env" />
<!-- Add the ant-contrib tasks -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${resources.dir}/ant-contrib.jar" />
<!-- Set up FlexUnit Ant tasks -->
<taskdef resource="flexUnitTasks.tasks" classpath="${resources.dir}/flexUnitTasks.jar" />
<!-- Set's the FLEX_HOME property based on a command line parameter or environment variable. -->
<target name="init">
<if>
<equals arg1="${FLEX_HOME}" arg2="$${FLEX_HOME}" />
<then>
<if>
<equals arg1="${env.FLEX_HOME}" arg2="$${env.FLEX_HOME}" />
<then>
<fail message="Variable FLEX_HOME does not exist. Set an environment variable or pass Ant a parameter like so: ant -DFLEX_HOME='/sdk/flex/4.1' compile-swf" />
</then>
<else>
<property name="FLEX_HOME" value="${env.FLEX_HOME}" />
</else>
</if>
</then>
</if>
<echo>FLEX_HOME: ${FLEX_HOME}</echo>
</target>
<!-- Cleans up the project compile output. -->
<target name="clean-bin">
<delete dir="${bin.dir}" failonerror="false" includeemptydirs="true" />
<mkdir dir="${bin.dir}" />
</target>
<!-- Cleans up the test output. -->
<target name="clean-test">
<delete dir="${test.bin.dir}" failonerror="false" includeemptydirs="true" />
<mkdir dir="${test.bin.dir}" />
</target>
<!-- Compiles the project into a SWF. -->
<target name="compile-swf" depends="init,clean-bin">
<java jar="${env.FLEX_HOME}/lib/mxmlc.jar" dir="${env.FLEX_HOME}/frameworks" fork="true" failonerror="true">
<arg value="${debug.compile.target}" />
<arg value="-output=${debug.compile.output}" />
<arg value="-source-path=${src.dir}" />
<arg value="-library-path+=${lib.dir}" />
<arg value="-static-link-runtime-shared-libraries=true" />
<arg value="-incremental=true" />
<arg value="-verbose-stacktraces=true" />
<arg value="-headless-server=true" />
</java>
</target>
<!-- Compiles the unit tests into a SWF. -->
<target name="compile-test" depends="init,clean-test">
<java jar="${env.FLEX_HOME}/lib/mxmlc.jar" dir="${env.FLEX_HOME}/frameworks" fork="true" failonerror="true">
<arg value="${test.compile.target}" />
<arg value="-output=${test.compile.output}" />
<arg value="-source-path=${src.dir}" />
<arg value="-source-path+=${test.src.dir}" />
<arg value="-library-path+=${lib.dir}" />
<arg value="-library-path+=${test.lib.dir}" />
<arg value="-static-link-runtime-shared-libraries=true" />
<arg value="-incremental=true" />
<arg value="-verbose-stacktraces=true" />
<arg value="-headless-server=true" />
</java>
</target>
<!-- Runs the FlexUnit task on the compiled test output. -->
<target name="run-flexunit" depends="compile-test">
<flexunit swf="${test.compile.output}"
toDir="${test.bin.dir}"
haltonfailure="false"
verbose="true"
localTrusted="true"
failureproperty="flexunit.failed"
timeout="5000" />
</target>
<!-- Compiles the unit tests and runs the FlexUnit task to analyze the results. -->
<target name="run-test" depends="run-flexunit">
<if>
<equals arg1="${flexunit.failed}" arg2="true" />
<then>
<fail message="Unit tests failed." />
</then>
<else>
<echo>All tests passed</echo>
</else>
</if>
</target>
<!-- Compiles the SWF and launches a browser for debugging. -->
<target name="run-debug" depends="compile-swf">
<if>
<equals arg1="${os.name}" arg2="Mac OS X" />
<then>
<exec executable="open" spawn="true">
<arg line="-a ${env.DEFAULT_BROWSER} ${debug.compile.output}" />
</exec>
</then>
<else>
<exec executable="${env.DEFAULT_BROWSER}" spawn="true">
<arg line="'file://${debug.compile.output}'" />
</exec>
</else>
</if>
</target>
<!-- Builds the project -->
<target name="build" depends="run-test,compile-swf">
<echo>Build complete.</echo>
</target>
<!-- Build and deploy the project to testing context -->
<target name="deploy-testing" depends="build">
<echo>SWF compiled and ready for deployment to a testing environment.</echo>
</target>
<!-- Build and deploy the project to production context -->
<target name="deploy-production" depends="build">
<echo>SWF compiled and ready for deployment to a production environment.</echo>
</target>
</project>
Show details
Hide details
Change log
r2
by nobien.net on Jul 17, 2010
Diff
First commit
Go to:
/trunk/README
/trunk/build.properties
/trunk/build.xml
/trunk/lib
/trunk/lib-test
/trunk/lib-test/FlexUnit4.swc
...lib-test/FlexUnit4CIListener.swc
...k/lib-test/flexUnit4UIRunner.swc
/trunk/lib/README
/trunk/resources
/trunk/resources/ant-contrib.jar
/trunk/resources/flexUnitTasks.jar
/trunk/src
/trunk/src-test
/trunk/src-test/TestRunner.mxml
/trunk/src-test/testsuite
.../src-test/testsuite/TestSuite.as
/trunk/src-test/testsuite/tests
...test/testsuite/tests/TestCase.as
/trunk/src/net
/trunk/src/net/nobien
/trunk/src/net/nobien/ciexample
...et/nobien/ciexample/CIExample.as
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 5533 bytes, 133 lines
View raw file
Powered by
Google Project Hosting