-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.xml
303 lines (253 loc) · 13.7 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="jar" name="ioke">
<description>
ioke is a next generation language, based on Io, Self, Smalltalk, Ruby and Lisp
</description>
<property environment="env" />
<condition property="VERSION_ADDITION" value="">
<isset property="env.BUILD_RELEASE_VERSION" />
</condition>
<condition property="VERSION_ADDITION" value="-p${env.GO_PIPELINE_COUNTER}">
<isset property="env.ADD_SNAPSHOT_VERSION" />
</condition>
<property file="build.properties"/>
<property file="default.build.properties"/>
<property file="version.properties"/>
<taskdef resource="tasks.properties">
<classpath>
<fileset dir="${lib.build.dir}" includes="*.jar"/>
<fileset dir="${lib.release.dir}" includes="asm-*.jar"/>
</classpath>
</taskdef>
<path id="build.classpath">
<fileset dir="${lib.build.dir}" includes="*.jar"/>
<fileset dir="${lib.release.dir}" includes="*.jar"/>
</path>
<target name="prepare" description="Creates the directories needed for building">
<mkdir dir="${build.dir}"/>
<mkdir dir="${coverage.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${test.results.dir}"/>
<mkdir dir="${html.test.results.dir}"/>
</target>
<target name="generate_filters" depends="prepare" description="Generates source files">
<exec executable="ruby" input="generate_filter_data.rb" failonerror="false" failifexecutionfails="false"/>
</target>
<target name="generate_version_data" depends="generate_filters" description="Generates version data">
<filter filtersfile="version_data.properties"/>
<filter token="VERSION" value="${VERSION_NAME}"/>
<filter token="VERSION_RUNTIME" value="${VERSION_NUMBER}${VERSION_ADDITION}"/>
<filter token="VERSION_STRING" value="Ioke ${VERSION_NAME} ikj ${VERSION_NUMBER}${VERSION_ADDITION}"/>
<copy todir="${classes.dir}" filtering="true" overwrite="true">
<fileset dir="${src.dir}" includes="**/*.properties"/>
</copy>
</target>
<target name="add_new_version_file" depends="generate_version_data" description="Adds a new version property file to an existing jar-file">
<jar destfile="${lib.dir}/ioke.jar" update="true">
<fileset dir="${classes.dir}">
<include name="**/*.properties"/>
</fileset>
</jar>
</target>
<target name="gen-pom" description="Creates new pom.xml files based on the current version configuration. This should be run before doing any Maven stuff">
<filter token="VERSION_NAME" value="${VERSION_NAME}"/>
<filter token="VERSION_NUMBER" value="${VERSION_NUMBER}"/>
<filter token="VERSION_ADDITION" value="${VERSION_ADDITION}"/>
<copy file="maven/ikj/pom.xml.template" tofile="maven/ikj/pom.xml" filtering="true" overwrite="true"/>
<copy file="maven/ikj-lib/pom.xml.template" tofile="maven/ikj-lib/pom.xml" filtering="true" overwrite="true"/>
</target>
<target name="compile" depends="generate_filters" description="Compile the source files for the project.">
<filter filtersfile="version_data.properties"/>
<filter token="VERSION" value="${VERSION_NAME}"/>
<filter token="VERSION_RUNTIME" value="${VERSION_NUMBER}${VERSION_ADDITION}"/>
<filter token="VERSION_STRING" value="Ioke ${VERSION_NAME} ikj ${VERSION_NUMBER}${VERSION_ADDITION}"/>
<javac destdir="${classes.dir}" debug="true" source="${javac.version}" target="${javac.version}" encoding="UTF-8">
<classpath refid="build.classpath"/>
<src path="${src.dir}"/>
<include name="**/*.java"/>
</javac>
<copy todir="${classes.dir}" filtering="true" overwrite="true">
<fileset dir="${src.dir}" includes="**/*.properties,**/*.html,**/*.css"/>
</copy>
<copy todir="${classes.dir}">
<fileset dir="${src.raw.dir}" includes="builtin/**/*.ik"/>
<fileset dir="${src.raw.dir}/ikj" includes="builtin/**/*.ik"/>
</copy>
</target>
<target name="coverage.instrument" depends="compile, ci-coverage.instrument" description=""/>
<target name="ci-coverage.instrument" description="">
<cobertura-instrument todir="${coverage.classes.dir}">
<fileset dir="${classes.dir}" excludes="ioke/lang/parser/**/*.class,com/google/**/*.class,org/jregex/**/*.class,gnu/**/*.class,ioke/lang/test/**/*.class,ioke/lang/performance/**/*.class"/>
</cobertura-instrument>
</target>
<target name="test" depends="compile" description="Runs all ISpec tests">
<java classname="ioke.lang.Main" fork="true" failonerror="true" maxmemory="256m">
<sysproperty key="ispec.ansi" value="${ispec.ansi}"/>
<classpath refid="build.classpath"/>
<classpath path="${classes.dir}"/>
<arg line="bin/ispec test -fs"/>
</java>
</target>
<target name="ci-test" description="Runs all ISpec tests">
<java classname="ioke.lang.Main" fork="true" maxmemory="256m" resultproperty="ispec.result">
<sysproperty key="ispec.ansi" value="${ispec.ansi}"/>
<classpath refid="build.classpath"/>
<classpath path="${classes.dir}"/>
<arg line="bin/ispec test -fx to: ${test.results.dir}"/>
</java>
<delete dir="${html.test.results.dir}" quiet="true"/>
<delete file="${test.results.dir}/TESTS-TestSuites.xml" quiet="true"/>
<junitreport todir="${test.results.dir}" tofile="../TESTS-TestSuites.xml">
<fileset dir="${test.results.dir}" includes="TEST-*.xml"/>
<report format="noframes" todir="${html.test.results.dir}"/>
</junitreport>
<condition property="ispec.failure">
<not>
<equals arg1="0" arg2="${ispec.result}"/>
</not>
</condition>
<fail if="ispec.failure" message="Test(s) failed."/>
</target>
<target name="ci-dokgen" description="Generate dokumentation">
<java classname="ioke.lang.Main" failonerror="true" fork="true" maxmemory="512m" >
<classpath refid="build.classpath"/>
<classpath path="${classes.dir}"/>
<arg line="bin/dokgen -S"/>
</java>
</target>
<target name="coverage" depends="compile, ci-coverage" description="Runs all ISpec tests using Cobertura and produces a report"/>
<target name="ci-coverage" depends="ci-coverage.instrument" description="Runs all ISpec tests using Cobertura and produces a report">
<java classname="ioke.lang.Main" fork="true" maxmemory="320m" failonerror="true">
<classpath path="${coverage.classes.dir}"/>
<classpath refid="build.classpath"/>
<classpath path="${classes.dir}"/>
<arg line="bin/ispec test -fs"/>
</java>
<cobertura-report srcdir="${src.dir}" destdir="${coverage.report.dir}"/>
</target>
<target name="jar" depends="test, ci-jar" description="Create the ioke.jar file"/>
<target name="ci-jar" depends="prepare" description="Create the ioke.jar file without depending on earlier stages">
<jar destfile="${lib.dir}/ioke.jar">
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<include name="**/*.ik"/>
<include name="**/*.properties"/>
<include name="**/*.html"/>
<include name="**/*.css"/>
</fileset>
<zipfileset src="${lib.release.dir}/jline-0.9.93.jar" includes="**/*"/>
<zipfileset src="${lib.release.dir}/joda-time-1.6.jar" includes="**/*"/>
<zipfileset src="${lib.release.dir}/asm-3.3.1.jar" includes="**/*"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="ioke.lang.Main"/>
</manifest>
</jar>
</target>
<target name="jar-lib" depends="jar, ci-jar-lib" description="Create the ioke-lib.jar file"/>
<target name="ci-jar-lib" depends="prepare" description="Create the ioke-lib.jar file">
<jar destfile="${lib.dir}/ioke-lib.jar">
<fileset dir="lib/ioke">
<include name="**/*"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
</target>
<target name="jar-notest" depends="compile, ci-jar" description="Create the ioke.jar file"/>
<target name="jar-lib-notest" depends="jar-notest" description="Create the ioke-lib.jar file">
<jar destfile="${lib.dir}/ioke-lib.jar">
<fileset dir="lib/ioke">
<include name="**/*"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
</target>
<target name="dist-bin" depends="jar, ci-dist-bin"/>
<target name="ci-push-distribution-files" depends="prepare">
<copy file="${lib.dir}/ioke.jar" tofile="${release.dir}/ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.jar" overwrite="true"/>
<copy file="${lib.dir}/ioke-lib.jar" tofile="${release.dir}/ioke-${VERSION_NAME}-ikj-lib-${VERSION_NUMBER}${VERSION_ADDITION}.jar" overwrite="true"/>
<scp todir="ioke.org@ioke.org:/home/ioke.org/web/public/dist" keyfile="${user.home}/.ssh/id_rsa">
<fileset dir="${release.dir}">
<include name="ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz"/>
<include name="ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.zip"/>
<include name="ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.jar"/>
<include name="ioke-${VERSION_NAME}-ikj-lib-${VERSION_NUMBER}${VERSION_ADDITION}.jar"/>
<include name="ioke-${VERSION_NAME}-ikc-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz"/>
<include name="ioke-${VERSION_NAME}-ikc-${VERSION_NUMBER}${VERSION_ADDITION}.zip"/>
</fileset>
</scp>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; rm -rf *-latest.*)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz ioke-ikj-latest.tar.gz)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.zip ioke-ikj-latest.zip)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.jar ioke-ikj-latest.jar)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikj-lib-${VERSION_NUMBER}${VERSION_ADDITION}.jar ioke-ikj-lib-latest.jar)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikc-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz ioke-ikc-latest.tar.gz)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikc-${VERSION_NUMBER}${VERSION_ADDITION}.zip ioke-ikc-latest.zip)"/>
</target>
<target name="ci-push-snapshot-doks" depends="prepare">
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public; mkdir -p dok/latest)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public; rm -rf dok/latest/*)"/>
<scp todir="ioke.org@ioke.org:/home/ioke.org/web/public/dok/latest" keyfile="${user.home}/.ssh/id_rsa">
<fileset dir="dok"/>
</scp>
</target>
<target name="ci-push-release-doks" depends="prepare">
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public; mkdir -p dok/release)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public; rm -rf dok/release/*"/>
<scp todir="ioke.org@ioke.org:/home/ioke.org/web/public/dok/release" keyfile="${user.home}/.ssh/id_rsa">
<fileset dir="dok"/>
</scp>
</target>
<target name="ci-dist-bin" depends="prepare">
<tar destfile="${release.dir}/ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz" compression="gzip">
<tarfileset mode="755" dir="." prefix="ioke">
<include name="bin/*.bat"/>
<include name="bin/dokgen"/>
<include name="bin/ioke"/>
<include name="bin/ispec"/>
</tarfileset>
<tarfileset dir="." prefix="ioke">
<include name="lib/ioke*.jar"/>
<include name="lib/ioke/**"/>
<include name="dok/**"/>
<include name="share/**"/>
<include name="COPYING"/>
<include name="LICENSE"/>
<include name="LICENSE.kawa"/>
<include name="README"/>
</tarfileset>
</tar>
<zip destfile="${release.dir}/ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.zip">
<zipfileset filemode="755" dir="." prefix="ioke">
<include name="bin/*.bat"/>
<include name="bin/dokgen"/>
<include name="bin/ioke"/>
<include name="bin/ispec"/>
</zipfileset>
<zipfileset dir="." prefix="ioke">
<include name="lib/ioke*.jar"/>
<include name="lib/ioke/**"/>
<include name="dok/**"/>
<include name="share/**"/>
<include name="COPYING"/>
<include name="LICENSE"/>
<include name="LICENSE.kawa"/>
<include name="README"/>
</zipfileset>
</zip>
</target>
<target name="dist" depends="dist-bin"/>
<target name="ci-dist" depends="ci-dist-bin"/>
<target name="ci-clean-dist" description="clean things from releases">
<delete dir="${release.dir}"/>
</target>
<target name="clean" description="clean almost everything">
<delete dir="${build.dir}"/>
<delete file="${lib.dir}/ioke.jar" quiet="true"/>
<delete file="${lib.dir}/ioke-lib.jar" quiet="true"/>
</target>
</project>