forked from framework-one/fw1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
149 lines (125 loc) · 6.2 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
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="test" name="Framework One">
<property name="test.project" value="fw1" />
<!-- the directory where the web server will be installed, WARNING
this directory WILL BE DELETED if it already exists -->
<property name="work.dir" value="/tmp/work" />
<!-- the directory containing your project web root, this will be symlinked
in to the webserver. Might be able to be left blank -->
<property name="build.dir" value="" />
<property name="test.framework" value="mxunit" />
<!-- PLATFORMS -->
<!-- Local URLs: Set these to locally available copies of the test server
platforms if available to avoid a remote HTTP download - won't work for Travis CI -->
<property name="railo41.local.url" value="/opt/ci/railo-express-4.1.2.005-nojre.tar.gz" />
<property name="railo41-osx.local.url" value="/opt/ci/railo-express-4.1.2.005-macosx.zip" />
<property name="acf10-linux32.local.url" value="/opt/ci/cf10-linux32.tar.gz" />
<property name="acf10-linux64.local.url" value="/opt/ci/cf10-linux64.tar.gz" />
<property name="acf902-linux64.local.url" value="/opt/ci/cf902-linux64.tar.gz" />
<!-- test frameworks -->
<property name="mxunit.local.url" value="/opt/ci/fix-railo-nulls.zip" />
<!-- Remote URLs -->
<property name="railo40.remote.url" value="http://cfml-ci.s3.amazonaws.com/railo-express-4.0.4.001-nojre.tar.gz" />
<property name="railo41.remote.url" value="http://cfml-ci.s3.amazonaws.com/railo-express-4.1.2.005-nojre.tar.gz" />
<property name="railo42beta.remote.url" value="http://cfml-ci.s3.amazonaws.com/railo-express-4.2.0.000-nojre.tar.gz" />
<property name="acf10-linux32.remote.url" value="http://cfml-ci.s3.amazonaws.com/cf10-linux32.tar.gz" />
<property name="acf10-linux64.remote.url" value="http://cfml-ci.s3.amazonaws.com/cf10-linux64.tar.gz" />
<property name="acf902-linux64.remote.url" value="http://cfml-ci.s3.amazonaws.com/cf902-linux64.tar.gz" />
<property name="mxunit.remote.url" value="https://github.com/marcins/mxunit/archive/fix-railo-nulls.zip" />
<property name="source" value="local" />
<property name="railo40.helper" value="railo" />
<property name="railo41.helper" value="railo" />
<property name="railo41-osx.helper" value="railo" />
<property name="railo42beta.helper" value="railo" />
<property name="acf10-linux32.helper" value="acf" />
<property name="acf10-linux64.helper" value="acf" />
<property name="acf902-linux64.helper" value="acf9" />
<fail unless="platform" message="Platform is not set" />
<fail unless="${platform}.${source}.url">Unkown platform ${platform} for source ${source}.
Valid values are:
railo40
railo41
railo41-osx
railo42beta
acf10-linux32
acf10-linux64
acf902-linux64</fail>
<macrodef name="propertycopy">
<attribute name="name"/>
<attribute name="from"/>
<sequential>
<property name="@{name}" value="${@{from}}"/>
</sequential>
</macrodef>
<propertycopy name="platform.url" from="${platform}.${source}.url" />
<propertycopy name="platform.helper" from="${platform}.helper" />
<propertycopy name="test.framework.url" from="${test.framework}.${source}.url" />
<property name="server.name" value="localhost"/>
<property name="server.port" value="8888"/>
<property name="stop.port" value="8887"/>
<property name="context.root" value="/fw1"/>
<property name="test.path.root" value="${context.root}"/>
<property name="output.dir" value="tests/ci/results/"/>
<!-- mxunit properties -->
<property name="mxunit.jar" value="tests/ci/mxunit-ant.jar"/>
<property name="mxunit.output.jar" value="tests/ci/mxunit-output-ant.jar"/>
<target name="install-ci-deps">
<exec executable="/bin/bash" failonerror="true">
<env key="WORK_DIR" value="${work.dir}" />
<env key="BUILD_DIR" value="${build.dir}" />
<env key="PLATFORM_URL" value="${platform.url}" />
<env key="TESTFRAMEWORK" value="${test.framework}" />
<env key="TESTFRAMEWORK_URL" value="${test.framework.url}" />
<env key="SERVER_PORT" value="${server.port}" />
<env key="STOP_PORT" value="${stop.port}" />
<arg line="tests/ci/scripts/ci-helper-${platform.helper}.sh install ${test.project}"/>
</exec>
</target>
<target name="start-server">
<exec executable="/bin/bash" spawn="false" failonerror="true">
<env key="WORK_DIR" value="${work.dir}" />
<env key="BUILD_DIR" value="${build.dir}" />
<env key="SERVER_PORT" value="${server.port}" />
<arg line="tests/ci/scripts/ci-helper-${platform.helper}.sh start"/>
</exec>
</target>
<target name="stop-server">
<exec executable="/bin/bash" spawn="false" failonerror="true">
<env key="WORK_DIR" value="${work.dir}" />
<env key="BUILD_DIR" value="${build.dir}" />
<env key="SERVER_PORT" value="${server.port}" />
<arg line="tests/ci/scripts/ci-helper-${platform.helper}.sh stop"/>
</exec>
</target>
<target name="test-ci" depends="start-server,test,stop-server">
<fail if="mxunit.failed" message="At least one test failure!"/>
</target>
<target name="test">
<delete dir="${output.dir}"/>
<mkdir dir="${output.dir}"/>
<antcall target="run-tests-${test.framework}" />
</target>
<target description="Make output directories and run the MXUnit task" name="run-tests-mxunit">
<delete dir="${output.dir}"/>
<mkdir dir="${output.dir}"/>
<taskdef classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" name="mxunittask"/>
<taskdef classname="au.com.imagichine.ant.MxunitOutputAntTask" classpath="${mxunit.output.jar}" name="mxunitoutputtask"/>
<mxunittask
defaultrunner="${context.root}/tests/ci/HttpAntRunner.cfc"
outputdir="${output.dir}"
port="${server.port}" server="${server.name}"
testResultsSummary="fw1.summary"
verbose="false"
haltonerror="false" errorproperty="mxunit.error"
failureproperty="mxunit.failed">
<directory
componentPath="tests"
packageName="fw1"
path="${test.path.root}/tests/"
recurse="false"
remoteMethod="run"/>
</mxunittask>
<mxunitoutputtask resultsdirectory="${output.dir}" />
<fail if="mxunit.error" message="An error occured running MXUnit" />
</target>
</project>