-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.xml
More file actions
84 lines (74 loc) · 2.99 KB
/
build.xml
File metadata and controls
84 lines (74 loc) · 2.99 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="BSim" default="packageLatest" basedir=".">
<description>Custom global build file for BSim bits and pieces...</description>
<!-- Set up some global properties -->
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="coreLibs" location="${lib}/core.jar;${lib}/vecmath.jar;${lib}/objimport.jar"/>
<property name="latestLib" location="${lib}/bsimSVN.jar"/>
<property name="examples" location="examples"/>
<property name="dist" location="dist"/>
<property name="build" location="${dist}/build"/>
<!-- Build and run an example file
Bit of a test at the moment, most likely it will be better to farm this out
to a bunch of separate targets...
-->
<target name="buildExample">
<property name="example" value="BSimParser" />
<property name="exArgs" value="ExampleSim.bsim" />
<javac classpath="${coreLibs};${latestLib}"
srcdir="${examples}/${example}" destdir="${examples}">
</javac>
<!-- Could use spawn="true" here to make a persistent BSim that is separate
from the ant build process... -->
<java classpath="${coreLibs};${latestLib};${examples}"
classname="${example}.${example}"
dir="${examples}/${example}"
fork="true">
<arg value="${exArgs}"/>
</java>
<delete>
<fileset dir="${examples}/${example}" includes="**.class"/>
</delete>
</target>
<!-- create a jar of the latest source (svn working copy).
Useful when running examples etc. where unversioned
bleeding edge code is required from the main bsim library -->
<target name="packageLatest">
<property name="version" value="SVN" />
<antcall target="distClean"/>
<antcall target="fatjar-bsim">
<param name="version" value="${version}" />
</antcall>
<copy file="${dist}/bsim${version}.jar" todir="${lib}"/>
</target>
<target name="init">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac classpath="${coreLibs}"
srcdir="${src}" destdir="${build}">
<include name="bsim/**"/>
<exclude name="bsim/geometry/tests/**"/>
</javac>
</target>
<target name="fatjar-bsim" depends="compile"
description="fatjar the latest version of bsim to be used in examples etc">
<fatjar.build output="${dist}/BSim${version}.jar">
<fatjar.manifest/>
<fatjar.filesource path="${build}" relpath="">
</fatjar.filesource>
<fatjar.jarsource file="${lib}/core.jar" relpath=""/>
<fatjar.jarsource file="${lib}/vecmath.jar" relpath=""/>
<fatjar.jarsource file="${lib}/objimport.jar" relpath=""/>
</fatjar.build>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} directory tree -->
<delete dir="${build}"/>
</target>
</project>