-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
71 lines (63 loc) · 2.77 KB
/
build.xml
File metadata and controls
71 lines (63 loc) · 2.77 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Ant + Ivy smoke test for io.github.openhistoricalmap:edtf.
Resolves the published artifact from Maven Central, compiles
src/Smoke.java against it, runs it, and asserts on the output.
See README.md for prerequisites.
-->
<project name="edtf-java-smoke" basedir="." default="test"
xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Library version under test. Override with -Dedtf.version=X.Y.Z.
Bump this in the same commit that tags a new release so the
daily smoke run always exercises the latest published artefact. -->
<property name="edtf.version" value="0.3.1"/>
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="build"/>
<property name="src.dir" value="src"/>
<target name="clean" description="Remove generated artefacts">
<delete dir="${lib.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target name="resolve" description="Resolve via Ivy from Maven Central">
<mkdir dir="${lib.dir}"/>
<ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]"
sync="true"/>
</target>
<target name="compile" depends="resolve" description="Compile the smoke source">
<mkdir dir="${build.dir}"/>
<javac srcdir="${src.dir}"
destdir="${build.dir}"
includeAntRuntime="false"
source="17"
target="17"
release="17"
encoding="UTF-8">
<classpath>
<fileset dir="${lib.dir}" includes="*.jar"/>
</classpath>
</javac>
</target>
<target name="test" depends="compile"
description="Run the smoke program and assert its output">
<java classname="Smoke" fork="true" failonerror="true"
outputproperty="smoke.stdout">
<classpath>
<pathelement location="${build.dir}"/>
<fileset dir="${lib.dir}" includes="*.jar"/>
</classpath>
</java>
<echo>--- Smoke output ---</echo>
<echo>${smoke.stdout}</echo>
<condition property="smoke.passed">
<and>
<contains string="${smoke.stdout}" substring="canonical: 2020-05-15"/>
<contains string="${smoke.stdout}" substring="type: DATE"/>
<contains string="${smoke.stdout}" substring="interval canonical: 2020/.."/>
<contains string="${smoke.stdout}" substring="interval type: INTERVAL"/>
</and>
</condition>
<fail unless="smoke.passed"
message="Smoke assertions failed. Output: ${smoke.stdout}"/>
<echo>PASSED: smoke test against io.github.openhistoricalmap:edtf:${edtf.version}</echo>
</target>
</project>