-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
202 lines (178 loc) · 6.52 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?xml version="1.0" encoding="utf-8" ?>
<project name="Scripturelookup" default="ci" basedir=".">
<property file="build.properties" />
<!-- Configure path to GWT SDK -->
<property name="gwt.sdk" value="/usr/local/gwt" />
<property name="appengine.sdk" value="/usr/local/appengine-java-sdk" />
<property name="emma.dir" value="/usr/share/java" />
<property name="emma.enabled" value="true" />
<property name="instrumented.dir" value="${basedir}/instrument" />
<property name="coverage.dir" value="${basedir}/coverage" />
<import file="${appengine.sdk}/config/user/ant-macros.xml" />
<path id="project.class.path">
<pathelement location="war/WEB-INF/classes" />
<pathelement location="${gwt.sdk}/gwt-user.jar" />
<fileset dir="${gwt.sdk}" includes="gwt-dev*.jar" />
<fileset dir="${appengine.sdk}" includes="lib/impl/*.jar" />
<fileset dir="war/WEB-INF/lib" includes="**/*.jar" />
</path>
<path id="project.extra.class.path">
<fileset dir="lib" includes="**/*.jar" />
</path>
<path id="test.class.path">
<pathelement location="war/WEB-INF/classes" />
<pathelement location="${gwt.sdk}/gwt-user.jar" />
<fileset dir="${gwt.sdk}" includes="gwt-dev*.jar" />
<fileset dir="${appengine.sdk}" includes="lib/impl/*.jar" />
<fileset dir="war/WEB-INF/lib" includes="**/*.jar" />
</path>
<path id="emma.lib">
<fileset dir="${emma.dir}" includes="**/*.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<target name="clean">
<delete dir="reports" failonerror="false" />
<delete dir="war/WEB-INF/classes" failonerror="false" />
<delete dir="war/WEB-INF/appengine-generated" failonerror="false" />
<delete dir="war/scripturelookup" failonerror="false" />
<delete dir="war/dataloading" failonerror="false" />
<delete file="Scripturelookup.war" failonerror="false" />
<delete file="coverage.ec" failonerror="false" />
<delete dir="${coverage.dir}" failonerror="false" />
<delete dir="${instrumented.dir}" failonerror="false" />
</target>
<target name="init" depends="clean">
<mkdir dir="${coverage.dir}" />
<mkdir dir="${instrumented.dir}" />
<mkdir dir="war/WEB-INF/classes" />
</target>
<target name="compile" depends="init">
<javac srcdir="src" includes="**" encoding="utf-8" destdir="war/WEB-INF/classes" source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path" />
</javac>
<copy todir="war/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java" />
</copy>
</target>
<target name="enhance" depends="compile">
<enhance failonerror="true">
<classpath>
<pathelement path="${appengine.tools.classpath}" />
<pathelement path="war/WEB-INF/classes" />
<fileset dir="war/WEB-INF/lib" includes="*.jar" />
</classpath>
<fileset dir="war/WEB-INF/classes" includes="**/Verse.class" />
</enhance>
</target>
<target name="instrument" depends="enhance">
<emma enabled="${emma.enabled}">
<instr instrpath="war/WEB-INF/classes"
destdir="${instrumented.dir}"
metadatafile="${coverage.dir}/metadata.emma"
merge="true">
<filter value="+net.todd.bible.scripturelookup.*, -net.todd.bible.scripturelookup.client.view.*, -net.todd.bible.scripturelookup.client.entrypoints.*" />
</instr>
</emma>
</target>
<target name="compile-tests" depends="instrument">
<javac srcdir="test" includes="**" destdir="war/WEB-INF/classes" encoding="utf-8" source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source">
<classpath location="lib/junit-4.7.jar" />
<classpath location="lib/mockito-all-1.8.0.jar" />
<classpath refid="project.class.path" />
</javac>
</target>
<target name="test" depends="compile-tests" description="Run development mode tests">
<mkdir dir="reports" />
<junit fork="yes" printsummary="yes" haltonfailure="false">
<jvmarg line="-Xmx256m" />
<sysproperty key="gwt.args" value="-logLevel WARN" />
<sysproperty key="java.awt.headless" value="true" />
<classpath>
<pathelement location="test" />
<pathelement location="${instrumented.dir}" />
<path refid="test.class.path" />
<path refid="emma.lib" />
<path refid="project.extra.class.path" />
</classpath>
<batchtest todir="reports">
<fileset dir="test">
<include name="**/*Test.java" />
</fileset>
</batchtest>
<formatter type="xml" />
</junit>
</target>
<target name="coverage" depends="test">
<move toDir="${coverage.dir}">
<fileset dir="${basedir}">
<include name="*.ec" />
</fileset>
</move>
<emma enabled="${emma.enabled}">
<report sourcepath="${src.dir}">
<fileset dir="${coverage.dir}">
<include name="*.emma" />
</fileset>
<fileset dir="${coverage.dir}">
<include name="*.ec" />
</fileset>
<xml outfile="${coverage.dir}/coverage.xml" depth="method" />
<txt outfile="${coverage.dir}/coverage.txt" depth="method" />
</report>
</emma>
</target>
<target name="gwtc" depends="coverage" description="GWT compile to JavaScript">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src" />
<path refid="project.class.path" />
</classpath>
<jvmarg value="-Xmx256M" />
<arg value="net.todd.bible.scripturelookup.Scripturelookup" />
<arg value="net.todd.bible.scripturelookup.Dataloading" />
</java>
</target>
<target name="war" depends="gwtc" description="Create a war file">
<zip destfile="Scripturelookup.war" basedir="war" />
</target>
<target name="start-dev-server">
<exec executable="${appengine.sdk}/bin/dev_appserver.sh">
<arg value="--port=8888" />
<arg value="war" />
</exec>
</target>
<target name="integration-test">
<exec executable="cucumber">
<arg value="--tags" />
<arg value="~@Pending" />
<arg value="--format" />
<arg value="junit" />
<arg value="--out" />
<arg value="reports" />
</exec>
<exec executable="cucumber" failonerror="true">
<arg value="--wip" />
<arg value="--tags" />
<arg value="@Pending" />
</exec>
</target>
<target name="ci" depends="war">
<parallel>
<daemons>
<antcall target="start-dev-server" />
</daemons>
<sequential>
<sleep seconds="10" />
<antcall target="integration-test" />
</sequential>
</parallel>
</target>
<target name="build-index" depends="enhance">
<java failonerror="true" fork="true" classname="net.todd.bible.scripturelookup.server.Indexer">
<classpath>
<path refid="project.class.path" />
</classpath>
<arg value="${basedir}/war/WEB-INF/index" />
</java>
</target>
</project>