-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
231 lines (207 loc) · 10.1 KB
/
build.xml
File metadata and controls
231 lines (207 loc) · 10.1 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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?xml version="1.0" standalone="yes"?>
<!-- build configuration -->
<project name="orth" default="compile" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<!-- configuration parameters -->
<property name="src.dir" location="core/src/main/java"/>
<property name="asrc.dir" location="aslib/src/main/as"/>
<property name="deploy.dir" location="dist"/>
<property name="classes.dir" location="${deploy.dir}/classes"/>
<!-- bring in our standard build support -->
<property name="ooo-build.vers" value="2.9"/>
<ant antfile="bootstrap.xml"/>
<import file="${user.home}/.m2/ooo-build/${ooo-build.vers}/ooo-build.xml"/>
<!-- -prepares the application directories -->
<target name="prepare" depends="-init-ooo">
<mavendep pom="core/pom.xml" id="pom"/>
<!-- we can't use <mavendep> here because we need to exclude our pom depends -->
<artifact:dependencies filesetId="aslib.fileset" cacheDependencyRefs="true" type="swc"
dependencyRefsBuildFile="${deploy.dir}/aslib-pom.dependencies">
<pom file="aslib/pom.xml"/>
</artifact:dependencies>
<pathconvert pathsep="," property="aslib.path" refid="aslib.fileset"/>
<mkdir dir="${classes.dir}"/>
<path id="build.classpath">
<pathelement location="${classes.dir}"/>
<path refid="pom.path"/>
</path>
</target>
<!-- makes sure our tools are compiled and defines the ant tasks -->
<target name="preptools" depends="prepare">
<maventaskdef groupId="com.threerings.ant" artifactId="actionscript" version="1.4"/>
<maventaskdef groupId="com.threerings" artifactId="narya-tools" version="1.14"
resource="com/threerings/presents/tools.properties"/>
</target>
<!-- cleans out the intermediate build files -->
<target name="clean" depends="-init-contrib">
<delete>
<fileset dir="${deploy.dir}" includes="*.jar,*.swc,classes/,docs/"/>
</delete>
<cleanmavendepcache pom="pom.xml"/>
<cleanmavendepcache pom="as-pom.xml"/>
<cleanmavendepcache id="tools"/>
</target>
<!-- wipes the entire build directory clean -->
<target name="distclean">
<delete dir="${deploy.dir}"/>
</target>
<!-- this target needs to exist for consistency/sanity relative other projects -->
<target name="distcleanall" depends="distclean"/>
<!-- build the java class files -->
<target name="compile" depends="prepare">
<copy todir="${classes.dir}">
<fileset dir="${src.dir}" includes="**/*.properties"/>
<fileset dir="${src.dir}" includes="**/*.tmpl"/>
</copy>
<ooojavac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="build.classpath"/>
</target>
<target name="aslib" depends="prepare">
<maventaskdef groupId="com.threerings.ant" artifactId="actionscript" version="1.4"/>
<compc srcdir="${asrc.dir}" libpath="${aslib.path}"
dest="${deploy.dir}/${ant.project.name}lib.swc"/>
</target>
<target name="javadoc" depends="prepare" description="Builds the Java documentation">
<mkdir dir="${deploy.dir}/docs"/>
<javadoc sourcepath="${src.dir}" packagenames="com.threerings.orth.*"
destdir="${deploy.dir}/docs" stylesheetfile="docs/stylesheet.css"
additionalparam="-breakiterator" classpathref="build.classpath">
<link href="http://download.oracle.com/javase/6/docs/api/"/>
<link href="http://docs.guava-libraries.googlecode.com/git/javadoc/"/>
<link href="http://samskivert.googlecode.com/svn/apidocs"/>
<link href="http://depot.googlecode.com/svn/apidocs/"/>
<link href="http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/"/>
<link href="http://threerings.github.com/narya/apidocs"/>
<link href="http://threerings.github.com/vilya/apidocs"/>
<link href="http://threerings.github.com/nenya/apidocs"/>
</javadoc>
</target>
<target name="asdoc" depends="prepare" description="Builds the ActionScript documention">
<maventaskdef groupId="com.threerings.ant" artifactId="actionscript" version="1.4"/>
<mkdir dir="${deploy.dir}/asdocs"/>
<asdoc srcdir="${asrc.dir}" libpath="${aslib.path}" destdir="${deploy.dir}/asdocs"/>
</target>
<!-- a target for rebuilding everything -->
<target name="distall" depends="dist,aslib"/>
<!-- builds our jar files -->
<target name="dist" depends="compile,procstream">
<!-- build our various jar files -->
<jar destfile="${deploy.dir}/${ant.project.name}.jar" basedir="${classes.dir}"/>
</target>
<!-- reorders our actionscript imports -->
<target name="asimports" depends="preptools" description="Reorders actionscript imports">
<asimports srcdir="${asrc.dir}"/>
</target>
<target name="gencode" depends="gendobj,genreceiver,genrecord,genservice,genstreamable"
description="Runs all gen tasks"/>
<!-- generates fields for persistent record classes -->
<target name="genrecord" depends="prepare">
<taskdef name="grecord" classname="com.samskivert.depot.tools.GenRecordTask"
classpathref="build.classpath"/>
<!-- make sure the record class files are all compiled -->
<ooojavac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="build.classpath">
<include name="**/*Record.java"/>
<exclude name="com/threerings/orth/party/**/*.java"/>
</ooojavac>
<!-- now update the source files -->
<grecord classpathref="build.classpath">
<fileset dir="${src.dir}" includes="**/*Record.java"/>
</grecord>
</target>
<!-- generates additional methods for distributed object classes -->
<target name="gendobj" depends="preptools">
<!-- make sure the dobject class files are all compiled -->
<ooojavac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="build.classpath">
<include name="**/*Object.java"/>
</ooojavac>
<!-- now generate the associated files -->
<gendobj classpathref="build.classpath">
<fileset dir="${src.dir}" includes="**/*Object.java"/>
</gendobj>
<genascriptstreamable classpathref="build.classpath" header="lib/SOURCE_HEADER"
asroot="${asrc.dir}">
<fileset dir="${src.dir}" includes="**/*Object.java"/>
</genascriptstreamable>
<asimports/>
</target>
<!-- generates marshaller and dispatcher classes for all invocation service declarations -->
<target name="genservice" depends="preptools">
<!-- make sure the service class files are all compiled -->
<ooojavac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="build.classpath">
<include name="**/*Service.java"/>
<exclude name="**/InvocationService.java"/>
</ooojavac>
<!-- now generate the associated files -->
<genservice header="lib/SOURCE_HEADER" asroot="src/main/as" classpathref="build.classpath">
<fileset dir="${src.dir}" includes="**/*Service.java">
<exclude name="**/InvocationService.java"/>
<exclude name="**/peer/**"/>
<exclude name="**/admin/**"/>
</fileset>
<providerless service="ChatService"/>
<providerless service="SimulatorService"/>
<providerless service="TimeBaseService"/>
</genservice>
<genservice header="lib/SOURCE_HEADER" classpathref="build.classpath">
<fileset dir="${src.dir}" includes="**/peer/**/*Service.java"/>
<fileset dir="${src.dir}" includes="**/admin/**/*Service.java"/>
</genservice>
<asimports/>
</target>
<!-- generates sender and decoder classes for all invocation receiver declarations -->
<target name="genreceiver" depends="preptools">
<!-- make sure the receiver class files are all compiled -->
<ooojavac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="build.classpath">
<include name="**/*Receiver.java"/>
<exclude name="**/InvocationReceiver.java"/>
</ooojavac>
<!-- now generate the associated files -->
<genreceiver header="lib/SOURCE_HEADER" classpathref="build.classpath" asroot="src/main/as">
<fileset dir="${src.dir}" includes="**/*Receiver.java"
excludes="**/InvocationReceiver.java"/>
</genreceiver>
<asimports/>
</target>
<target name="genstreamable" depends="preptools">
<!-- make sure the streamable class files are all compiled -->
<ooojavac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="build.classpath">
<include name="**/data/*.java"/>
</ooojavac>
<genascriptstreamable classpathref="build.classpath" header="lib/SOURCE_HEADER"
asroot="${asrc.dir}">
<fileset dir="${src.dir}">
<include name="**/data/*.java"/>
<include name="com/threerings/orth/data/where/*.java"/>
<exclude name="com/threerings/orth/peer/**/*.java"/>
<exclude name="**/*Object.java"/>
<exclude name="**/*_CustomFieldSerializer.java"/>
<!-- flips out on generics -->
<exclude name="com/threerings/orth/room/data/Entity*.java"/>
</fileset>
</genascriptstreamable>
<asimports/>
</target>
<!-- adds readField and writeField methods to Stremable classes -->
<target name="procstream" depends="preptools">
<!-- now instrument the associated files -->
<instream outdir="${classes.dir}">
<path refid="build.classpath"/>
<fileset dir="${classes.dir}" includes="**/data/*.class"/>
<fileset dir="${classes.dir}" includes="**/net/*.class"/>
<fileset dir="${classes.dir}" includes="**/dobj/*.class"/>
<fileset dir="${classes.dir}" includes="**/util/*.class"/>
</instream>
</target>
<target name="install" depends="distall"
description="Installs artifacts to local Maven repository.">
<maveninstall file="pom.xml" pom="pom.xml"/>
<maveninstall file="${deploy.dir}/${ant.project.name}.jar" pom="core/pom.xml"/>
<maveninstall file="${deploy.dir}/${ant.project.name}lib.swc" pom="aslib/pom.xml"/>
</target>
<target name="deploy" depends="distall,javadoc"
description="Deploys our build artifacts to a Maven repository.">
<mavendeploy file="pom.xml" pom="pom.xml"/>
<mavendeploy file="${deploy.dir}/${ant.project.name}.jar" pom="core/pom.xml"
srcdir="${src.dir}" docdir="${deploy.dir}/docs"/>
<mavendeploy file="${deploy.dir}/${ant.project.name}lib.swc" pom="aslib/pom.xml"
srcdir="${asrc.dir}"/>
</target>
</project>