-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.xml
159 lines (112 loc) · 5.18 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
<project name="jLEMS" default="jar" basedir=".">
<description>jLEMS: Java reference implementation of Low Entropy Model Specification language</description>
<property file="VERSION"/>
<target name="initdirs">
<echo message="-----------------------------------------------------------------"/>
<echo message="---"/>
<echo message="--- Ant build.xml no longer maintained. Use 'mvn install' instead!"/>
<echo message="---"/>
<echo message="-----------------------------------------------------------------"/>
<mkdir dir="build"/>
<mkdir dir="builtjars"/>
</target>
<path id="junit.classpath">
<pathelement location="lib/junit-4.8.1.jar"/>
<pathelement location="lib/commons-compiler.jar"/>
<pathelement location="lib/commons-compiler-jdk.jar"/>
</path>
<path id="jarrun.classpath">
<pathelement location="builtjars/lems-${version.number}.jar"/>
</path>
<target name="clean" description="Removes the built files">
<delete failonerror="false">
<fileset dir="build" includes="**/*.*"/>
<fileset dir="builtjars" includes="**/*.*"/>
</delete>
</target>
<target name="compile" depends="initdirs" description="Compile src to /build">
<echo>Compiling to /build</echo>
<javac srcdir="src"
destdir="build"
debug="true"
source="1.8"
target="1.8"
includeantruntime="false"
classpathref="junit.classpath">
<include name="**/*.java"/>
</javac>
</target>
<target name="jar" depends="compile" description="Creates main Jar file">
<jar destfile="builtjars/lems-${version.number}.jar">
<fileset dir="build" includes="org/lemsml/jlems/**"/>
<fileset dir="build" includes="org/lemsml/jlemsio/**"/>
<fileset dir="src" includes="org/lemsml/jlems/**"/>
<fileset dir="src" includes="org/lemsml/jlemsio/**"/>
<manifest>
<attribute name="Main-Class" value="org.lemsml.jlemsio.Main"/>
</manifest>
</jar>
<copy tofile="builtjars/lems.jar" file="builtjars/lems-${version.number}.jar"/>
</target>
<target name="viz-jar" depends="compile" description="Creates main Jar file">
<jar destfile="builtjars/lems-viz-${version.number}.jar">
<fileset dir="build" includes="org/lemsml/jlems/**"/>
<fileset dir="build" includes="org/lemsml/jlemsio/**"/>
<fileset dir="build" includes="org/lemsml/jlemsviz/**"/>
<fileset dir="src" includes="org/lemsml/jlems/**"/>
<fileset dir="src" includes="org/lemsml/jlemsio/**"/>
<manifest>
<attribute name="Main-Class" value="org.lemsml.jlemsviz.VizMain"/>
</manifest>
</jar>
<copy tofile="builtjars/lems-viz.jar" file="builtjars/lems-viz-${version.number}.jar"/>
</target>
<target name="core-jar" depends="compile" description="Create core Jar file">
<jar destfile="builtjars/lems-core-${version.number}.jar">
<fileset dir="build" includes="org/lemsml/jlems/**"/>
<fileset dir="src" includes="org/lemsml/jlems/**"/>
</jar>
<copy tofile="builtjars/lems-core.jar" file="builtjars/lems-core-${version.number}.jar"/>
</target>
<target name="testsjar" depends="compile" description="Creates main Jar file">
<jar destfile="builtjars/lems-tests.jar">
<fileset dir="build"/>
<fileset dir="src"/>
<manifest>
<attribute name="Main-Class" value="org.lemsml.jlemstests.MainTest"/>
</manifest>
</jar>
</target>
<target name="runtests" depends="compile">
<java classname="org.lemsml.jlemstests.MainTest">
<classpath>
<pathelement location="build"/>
<pathelement location="lib/junit-4.8.1.jar"/>
</classpath>
</java>
</target>
<target name="canonical-examples">
<mkdir dir="build/canonical-examples"/>
<xslt basedir="examples" destdir="build/canonical-examples"
extension=".xml" style="xsl/canonical.xsl"/>
</target>
<target name="compact-text-examples">
<mkdir dir="build/compact-text-examples"/>
<xslt basedir="examples" destdir="build/compact-text-examples"
extension=".txt" style="xsl/compacttext.xsl"/>
</target>
<target name="docs" description="Print info on generating docs...">
<echo message="LEMS documentation can be generated with Ant file here: https://github.com/LEMS/LEMS/tree/master/docgeneration"/>
</target>
<!-- One example just for testing purposes... -->
<target name="ex1" depends="viz-jar"
description="Tests the LEMS example: example1.xml">
<java classname="org.lemsml.jlemsviz.VizMain" fork="true">
<jvmarg value="-Xmx100M" />
<arg value="examples/example1.xml"/>
<classpath>
<pathelement location="builtjars/lems-viz.jar"/>
</classpath>
</java>
</target>
</project>