forked from tlaplus/CommunityModules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
70 lines (59 loc) · 2.49 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
<project name="CommunityModules" default="test" basedir=".">
<property name="src" location="modules/"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<property name="tests" location="tests"/>
<tstamp>
<format property="timestamp"
pattern="yyyyMMdHHmm"
locale="en,UK"/>
</tstamp>
<target name="init" description="Create the build and dist directory structure">
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
<mkdir dir="${lib}"/>
</target>
<target name="download" depends="init" description="downloads tla2tools.jar" unless="skip.download">
<get src="https://nightly.tlapl.us/dist/tla2tools.jar" dest="${lib}"/>
</target>
<target name="compile" depends="download" description="compile the java module overwrites">
<javac srcdir="${src}" destdir="${build}" classpath="${lib}/tla2tools.jar"
source="1.8"
target="1.8"
includeantruntime="false"/>
</target>
<target name="dist" depends="compile" description="Combine the module overwrites and the TLA+ definitions into a distribution">
<tstamp/>
<jar jarfile="${dist}/CommunityModules-${timestamp}.jar">
<fileset dir="${build}/"
includes="**/*.class"/>
<fileset dir="${src}/"
includes="*.tla,*.java"/>
<fileset dir="."
includes="LICENSE,README.md"/>
</jar>
</target>
<target name="test" depends="dist" description="Run the modules in tests/ on the TLA+ modules in dist/">
<!-- If an assert fails, TLC will return a non-zero exit value which is makes the ant target fail. -->
<java classname="tlc2.TLC" fork="true" failonerror="true">
<!-- Tell Java to use a garbage collector which makes TLC happy. -->
<jvmarg value="-XX:+UseParallelGC"/>
<!-- Report execution statistics as azure-pipelien -->
<sysproperty key="tlc2.TLC.ide" value="azure-pipeline"/>
<sysproperty key="util.ExecutionStatisticsCollector.id" value="01ed03e40ba44f278a934849dd2b1038"/>
<arg value="${basedir}/tests/AllTests"/>
<classpath>
<pathelement location="${lib}/tla2tools.jar" />
<!-- The jar that has just been built by the dist target. -->
<pathelement location="${dist}/CommunityModules-${timestamp}.jar" />
</classpath>
</java>
</target>
<target name="clean" description="Delete the ${build} and ${dist} directory trees">
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${lib}"/>
<delete dir="${tests}/states"/>
</target>
</project>