-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
110 lines (99 loc) · 3.86 KB
/
build.xml
File metadata and controls
110 lines (99 loc) · 3.86 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
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="EcotypeSimulation" default="dist" basedir=".">
<!-- The description for this build. -->
<description>
Build file for the Java portion of Ecotype Simulation.
</description>
<!-- Set global properties for this build. -->
<property name="bin.dir" value="."/>
<property name="icons.dir" value="icons"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib"/>
<property name="src.dir" value="src/java"/>
<property name="tests.dir" value="tests/java"/>
<property name="jarfile" value="ecosim.jar"/>
<property name="main-class" value="ecosim.EcotypeSimulation"/>
<property name="ant.build.javac.source" value="1.8"/>
<property name="ant.build.javac.target" value="1.8"/>
<!-- Store path information for the check target. -->
<path id="check.classpath">
<pathelement location="${lib.dir}/junit4.jar"/>
<pathelement location="${lib.dir}/hamcrest-core-1.3.jar"/>
<pathelement location="${build.dir}/${jarfile}"/>
<pathelement path="${build.dir}/tests/java"/>
</path>
<!-- Store path information for the dist target. -->
<path id="dist.classpath">
<pathelement location="${lib.dir}/jcommon-1.0.23.jar"/>
<pathelement location="${lib.dir}/jfreechart-1.0.19.jar"/>
</path>
<manifestclasspath property="dist.manifest.classpath" jarfile="${lib.dir}">
<classpath refid="dist.classpath" />
</manifestclasspath>
<!-- Load the version information. -->
<loadfile property="version" srcFile="VERSION">
<filterchain>
<striplinebreaks/>
</filterchain>
</loadfile>
<!-- The main target for this build. -->
<target name="dist">
<!-- Create the necessary directory structure. -->
<mkdir dir="${build.dir}/java"/>
<!-- Create the time stamp. -->
<tstamp/>
<!-- Compile the java code. -->
<javac destdir="${build.dir}/java" includeantruntime="false" debug="true">
<src path="${src.dir}"/>
<compilerarg value="-Xlint:unchecked,deprecation"/>
<classpath refid="dist.classpath"/>
</javac>
<!-- Create the jar file. -->
<jar jarfile="${build.dir}/${jarfile}" basedir="${build.dir}/java">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Class-Path" value="${dist.manifest.classpath}"/>
</manifest>
<zipfileset dir="${icons.dir}" prefix="${icons.dir}"/>
</jar>
</target>
<!-- The target for cleaning up from a previous build. -->
<target name="clean">
<!-- Delete the ${build.dir} directory tree. -->
<delete dir="${build.dir}"/>
</target>
<!-- The install target. -->
<target name="install" depends="dist">
<!-- Copy the jar file to the installation directory. -->
<copy file="${build.dir}/${jarfile}" todir="${bin.dir}"/>
</target>
<!-- The uninstall target. -->
<target name="uninstall">
<delete file="${bin.dir}/${jarfile}"/>
</target>
<!-- The check target. -->
<target name="check" depends="dist">
<mkdir dir="${build.dir}/tests/java"/>
<!-- Copy the assets to the test build directory. -->
<copy todir="${build.dir}/tests/java/assets">
<fileset dir="${tests.dir}/assets"/>
</copy>
<!-- Compile the tests in the test build directory. -->
<javac destdir="${build.dir}/tests/java" includeantruntime="false">
<src path="${tests.dir}"/>
<compilerarg value="-Xlint:unchecked,deprecation"/>
<classpath refid="check.classpath"/>
</javac>
<!-- Run the tests. -->
<junit printsummary="on" fork="true" haltonfailure="yes">
<formatter type="plain"/>
<classpath refid="check.classpath"/>
<batchtest fork="yes" todir="${build.dir}/tests">
<fileset dir="${tests.dir}">
<include name="Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>