-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
110 lines (94 loc) · 3.89 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
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="./ant2html.xsl"?>
<!-- ======================================================================
A series of Physics demos using re-usable 2D physics and graphics engines.
Copyright 2010 Ethan Blackwelder.
====================================================================== -->
<project name="Physics Demos" default="prepare">
<description>
A 2D physics engine and physics simulations.
Copyright 2010 Ethan Blackwelder.
</description>
<tstamp>
<format property="timestamp" pattern="dd-MM-yyyy hh:mm aa"/>
</tstamp>
<property file="build.properties"/>
<path id="classpath.compile">
<pathelement location="${dist.home}/${jar.name}"/>
<fileset dir="${dist.home}" includes="*.jar"/>
</path>
<path id="classpath.run">
<fileset dir="${dist.home}" includes="*.jar"/>
</path>
<target name="prepare" description="Makes target directories, copy non-Java resources, etc.">
<mkdir dir="${build.home}" />
<mkdir dir="${dist.home}" />
<antcall target="-copy-resources">
<param name="resources.srcdir" value="${src.home}"/>
<param name="resources.destdir" value="${build.home}"/>
</antcall>
<antcall target="-copy-resources">
<param name="resources.srcdir" value="${demos.home}"/>
<param name="resources.destdir" value="${build.home}"/>
</antcall>
</target>
<target name="clean" description="Clean-up time">
<delete dir="${build.home}" verbose="${verbose.mode}"/>
<delete dir="${dist.home}" verbose="${verbose.mode}"/>
</target>
<target name="-copy-resources" description="Copies image resources to a specific build directory.">
<fail message="Please set the 'resources.srcdir' parameter." unless="resources.srcdir"/>
<fail message="Please set the 'resources.destdir' parameter." unless="resources.destdir"/>
<copy todir="${resources.destdir}" includeemptydirs="no">
<fileset dir="${resources.srcdir}">
<exclude name="**/.svn"/>
<exclude name="**/*.java"/>
<exclude name="**/Thumbs.db"/>
</fileset>
</copy>
</target>
<target name="compile-full" depends="prepare" description="Compiles the all Java source files (including demos and tools).">
<javac destdir="${build.home}" target="${jar.target}" includeantruntime="no">
<src path="${src.home}"/>
<src path="${demos.home}"/>
<classpath>
<fileset dir="${lib.home}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="jar-full" depends="compile-full" description="Creates a min JAR of the application">
<jar destfile="${dist.home}${file.separator}${jar.name}">
<manifest>
<attribute name="Created-By" value="${app.author}"/>
<attribute name="Built-By" value="${user.name} - ${ant.version}"/>
<attribute name="Implementation-Title" value="${app.name}"/>
<attribute name="Implementation-Version" value="${app.version} (${timestamp})"/>
<attribute name="Implementation-URL" value="${app.website}"/>
<attribute name="Main-Class" value="${jar.main-class}"/>
</manifest>
<fileset dir="${build.home}">
<include name="**/*"/>
</fileset>
<zipgroupfileset dir="lib">
<include name="*.jar"/>
<exclude name="junit-*.jar"/>
</zipgroupfileset>
</jar>
</target>
<target name="dist" depends="jar-full" description="Creates a distribution of all packages">
<echo message="Your distribution packages are here: ${dist.home}"/>
</target>
<target name="redist" depends="clean,dist" description="Creates a fresh distribution of all packages">
</target>
<target name="run-demo" depends="jar-full" description="Compiles and runs the GUI application.">
<java fork="true" classname="${run.main-class}">
<classpath>
<fileset dir="${dist.home}">
<include name="*.jar"/>
</fileset>
</classpath>
</java>
</target>
</project>