forked from ArtOfIllusion/ArtOfIllusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
166 lines (139 loc) · 5.75 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
160
161
162
163
164
165
166
<?xml version="1.0"?>
<project name="ArtOfIllusion Full Suite" default="dist" basedir=".">
<!-- set global properties for this build -->
<property file="build.properties" />
<property name="srclib" value="${srclib}" />
<property name="dist" value="${dist}" />
<property name="docs" value="${docs}" />
<property name="java.version" value="${java.version}" />
<property name="java.args" value="${java.args}" />
<property name="java.encoding" value="${java.encoding}" />
<!--property name="git.tag" value="Unknown Version" />
<property name="git.revision" value="Unknown Source Revision" /-->
<!-- set of all library jars -->
<fileset id="libraries" dir="${srclib}" includes="*.jar" />
<!-- set of all subproject build files -->
<fileset id="subproject.files" dir="." includes="*.xml" excludes="build.xml" />
<!-- Adapted from https://stackoverflow.com/a/4059546 -->
<available file=".git" type="dir" property="git.present"/>
<!-- Get application version and source revision from SCM -->
<target name="set-versions" description="Store git revision data" if="git.present">
<exec executable="git" outputproperty="git.describe.long" failifexecutionfails="false" logerror="true">
<arg value="describe"/>
<arg value="--first-parent"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="--dirty"/>
</exec>
</target>
<target name="init" depends="set-versions">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by build -->
<mkdir dir="${dist}" />
<mkdir dir="${dist}/Plugins"/>
<mkdir dir="${dist}/Scripts/Startup"/>
<mkdir dir="${dist}/Scripts/Objects"/>
<mkdir dir="${dist}/Scripts/Tools"/>
<mkdir dir="${dist}/Textures and Materials" />
<condition property="git.revision" value="${git.describe.long}" else="Unknown Source Revison">
<and>
<isset property="git.describe.long"/>
<length string="${git.describe.long}" trim="yes" length="0" when="greater"/>
</and>
</condition>
<echo message="${git.revision}"/>
</target>
<!-- Generate working application artifacts -->
<target name="dist" depends="init" description="Generate a working full-project application">
<copy todir="${dist}/lib">
<fileset dir="${srclib}" includes="*"/>
</copy>
<!-- execute default target for all found Ant files -->
<subant target="" >
<property name="dist" value="${dist}" />
<property name="srclib" value="${srclib}"/>
<property name="java.version" value="${java.version}" />
<property name="java.args" value="${java.args}"/>
<property name="java.encoding" value="${java.encoding}" />
<property name="git.revision" value="${git.revision}" />
<fileset refid="subproject.files" />
</subant>
</target>
<!-- Build project-wide javadoc -->
<!-- Hacky, cannot call subant tasks, as Javadoc is not incremental -->
<target name="docs" description="Generate project-wide javadoc">
<fileset id="libraries" dir="${srclib}" includes="*.jar" />
<pathconvert property="classpath" refid="libraries" />
<mkdir dir="${docs}" />
<javadoc packagenames="artofillusion.*"
sourcepath="ArtOfIllusion/src:OSSpecific/src:Renderers/src:Tools/src:Translators/src:Filters/src"
classpath="${classpath}"
source="${lang.version}"
defaultexcludes="yes"
destdir="${docs}"
author="true"
version="true"
use="true"
windowtitle="Art of Illusion Documentation"
public="true">
<doctitle><![CDATA[<h1>Art of Illusion</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 1999-2011 by Peter Eastman.</i>]]></bottom>
<link href="http://buoy.sourceforge.net/docs/" />
</javadoc>
</target>
<target name="test" description="Build and run the JUnit test suite.">
<subant target="compile">
<fileset refid="subproject.files" />
</subant>
<mkdir dir="Tests/build" />
<path id="bin_paths">
<pathelement location="ArtOfIllusion/build" />
<pathelement location="OSSpecific/build" />
<pathelement location="Tools/build" />
<pathelement location="Translators/build" />
<pathelement location="Renderers/build" />
<pathelement location="Filters/build" />
<fileset refid="libraries" />
</path>
<javac srcdir="Tests/src"
destdir="Tests/build"
classpathref="bin_paths"
debug="on"
target="${lang.version}"
source="${lang.version}" />
<junit printsummary="on" haltonfailure="yes" fork="false">
<classpath>
<path refid="bin_paths"/>
<pathelement location="Tests/build"/>
</classpath>
<formatter type="plain" usefile="false" />
<batchtest>
<fileset dir="Tests/build" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
<target name="clean" description="Delete all interim build artifacts. Working application left intact.">
<!-- execute the "clean" target for all found subproject ant files -->
<subant target="clean">
<fileset refid="subproject.files" />
</subant>
<delete dir="Tests/build" />
</target>
<target name="help" description="Display advanced build options">
<echo>
If you just want to build the application, simply type 'ant' into your console.
For more build control, The Art Of Illusion build scripts provide the following targets:
</echo>
<java classname="org.apache.tools.ant.Main">
<arg value="-projecthelp" />
<arg value="-buildfile" />
<arg value="${ant.file}" />
</java>
<echo>
Build options are found in the file 'build.properties'
To override any of these properties for a one time build, pass them to ant in the following form:
ant [target] -D[property]=[value]
</echo>
</target>
</project>