forked from WeTheInternet/collide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
150 lines (127 loc) · 5.53 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
<project name="collide" default="build">
<property name="dirs.root" location="."/>
<!-- Import common properties and macros -->
<import optional="false" file="${dirs.root}/macros.ant.xml"/>
<!-- Include subdirectory targets. For each <include as="foo" .../>, the
targets in that file are available here as foo.targetname. -->
<include optional="false" as="tools.dtogen"
file="${dirs.src}/${dirs.toppkg}/dtogen/build.xml"/>
<include optional="false" as="src.json"
file="${dirs.src}/${dirs.toppkg}/json/build.xml"/>
<include optional="fals
e" as="src.shared"
file="${dirs.src}/${dirs.toppkg}/shared/build.xml"/>
<include optional="false" as="src.dto"
file="${dirs.src}/${dirs.toppkg}/dto/build.xml"/>
<include optional="false" as="src.clientlibs"
file="${dirs.src}/${dirs.toppkg}/clientlibs/build.xml"/>
<include optional="false" as="src.client"
file="${dirs.src}/${dirs.toppkg}/client/build.xml"/>
<include optional="false" as="src.server"
file="${dirs.src}/${dirs.toppkg}/server/build.xml"/>
<include optional="false" as="test.api"
file="${dirs.test}/${dirs.toppkg}/server/api/build.xml"/>
<include optional="false" as="test.json"
file="${dirs.test}/${dirs.toppkg}/json/build.xml"/>
<include optional="false" as="test.shared"
file="${dirs.test}/${dirs.toppkg}/shared/build.xml"/>
<include optional="false" as="test.dtogen"
file="${dirs.test}/${dirs.toppkg}/dtogen/build.xml"/>
<include optional="false" as="test.codemirror2"
file="${dirs.test}/${dirs.toppkg}/codemirror2/build.xml"/>
<include optional="false" as="test.client"
file="${dirs.test}/${dirs.toppkg}/client/build.xml"/>
<include optional="false" as="test.clientlibs"
file="${dirs.test}/${dirs.toppkg}/clientlibs/build.xml"/>
<target name="dist" description="Package up the distribution"
depends="build">
<!-- Copy the launch and bootstrap scripts to the dist folder. -->
<copy todir="${dirs.bin}">
<fileset dir="${dirs.lib}">
<include name="bootstrap.js" />
</fileset>
<fileset dir="${dirs.root}">
<include name="collide" />
</fileset>
</copy>
<!-- Copy the GWT client. -->
<copy todir="${dirs.dist}/static">
<fileset dir="${dirs.bin}/static" />
</copy>
<!-- To preserve executable file permissions on launcher script. -->
<chmod dir="${dirs.dist}" perm="ugo+rx" includes="collide"/>
<!-- Create a server jar from all the classes and drop it in the dist/lib folder. -->
<jar destfile="${dirs.dist}/lib/collide-server.jar">
<fileset dir="${dirs.bin}" includes="**/*.class **/*.js"/>
<fileset dir="${dirs.plugin}" includes="META-INF/*.*"/>
</jar>
<!-- Create a source jar to perform gwt compiles, and drop it in the dist/lib folder. -->
<jar destfile="${dirs.dist}/lib/collide-source.jar">
<fileset dir="${dirs.bin}" includes="**/*.js"/>
<fileset dir="${dirs.src}" includes="**/*.*"/>
<fileset dir="${dirs.plugin}" includes="**/*.*"/>
<fileset dir="${dirs.gen}" includes="**/*.*"/>
</jar>
<!-- Copy all deps to the dist/lib folder -->
<copy todir="${dirs.dist}/lib" flatten="true">
<path refid="paths.server.runtime" />
</copy>
<!-- Copy vertx into the deploy folder -->
<copy todir="${dirs.dist}/lib/vertx">
<fileset dir="${dirs.vertx}" />
</copy>
<chmod file="${dirs.dist}/lib/vertx/bin/vertx" perm="ugo+rx"/>
</target>
<target name="copy.launch">
<!-- Copy launch scripts to bin directory. -->
<copy todir="${dirs.dist}">
<fileset dir="${dirs.root}">
<include name="bootstrap.js" />
<include name="collide" />
</fileset>
</copy>
<!-- To preserve executable file permissions on launcher script. -->
<chmod dir="${dirs.dist}" perm="ugo+rx" includes="collide"/>
</target>
<target name="build" description="Build the whole Collide executable"
depends="src.shared.build, src.dto.build, src.client.build-java">
<!-- Parallelize build; we don't need to be waiting on gwt to compile. -->
<sequential>
<if>
<not><equals arg1="${nogwt}" arg2="true" /></not>
<then>
<!-- Builds full screen client -->
<parallel>
<antcall target="src.client.build"/>
<antcall target="src.client.plugin"/>
</parallel>
</then>
</if>
<antcall target="src.server.build"/>
<antcall target="copy.launch"/>
</sequential>
</target>
<target name="gwtdev" description="Run Collide gwt devmode" depends="src.client.dev-gwt">
</target>
<target name="client" description="Build the whole Collide executable"
depends="src.client.build">
</target>
<target name="server" description="Build the whole Collide executable"
depends="src.shared.build, src.dto.build,
src.server.build, copy.launch">
</target>
<!-- TODO: enable test.client.test -->
<target name="test" description="Run all the tests"
depends="test-compile, test.shared.test, test.json.test, test.dtogen.test,
test.codemirror2.test, test.clientlibs.test, test.api.test"/>
<target name="test-compile" description="Build all the test code"
depends="test.shared.build, test.api.build, test.json.build,
test.dtogen.build, test.codemirror2.build, test.clientlibs.build,test.client.build
">
<!-- Copy all deps to the ${dirs.testbin}/lib folder -->
<copy todir="${dirs.testbin}/lib" flatten="true">
<path refid="paths.server.build" />
<path refid="paths.client.build" />
</copy>
</target>
</project>