-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
112 lines (91 loc) · 4.62 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="${module-name}" default="dist" basedir=".">
<property file="my.module.properties"/>
<!-- current directory needed in all scripts -->
<dirname property="current.dir" file="${ant.file.wonderland-${module.name}-module}"/>
<property name="modules.dir" location="${wonderland.dir}/modules"/>
<property name="module.src" value="${module.plugin.src}"/>
<property name="module.jarname" value="${module.name}"/>
<!-- import common build file -->
<import file="${modules.dir}/build-tools/build-scripts/module-build.xml"/>
<pathconvert property="module-client.classpath">
<path location="${current.dir}/lib/gson-1.7.1.jar"/>
</pathconvert>
<target name="build" depends="-module-init, -module-compile-common,
-module-compile-server,
-module-compile-client"/>
<target name="dist" depends="build">
<mkdir dir="${module.dist.dir}"/>
<module name="${module.name}" majorVersion="${module.version.major}" minorVersion="${module.version.minor}" jarfile="${module.dist.dir}/${module.jarname}.jar"
moduleDescription="${module.description}" builddir="${build.dir}">
<client dir="${current.dir}/lib">
<include name="gson-1.7.1.jar"/>
<clientjar name="${module.name}-client" basedir="${build.classes.dir}">
<include name="${module.src}/client/**"/>
<include name="${module.src}/common/**"/>
<fileset dir="${current.dir}/src/classes">
<include name="${module.src}/client/**/*.properties"/>
</fileset>
</clientjar>
</client>
<server>
<serverjar name="${module.name}-server" basedir="${build.classes.dir}">
<include name="${module.src}/server/**"/>
<include name="${module.src}/common/**"/>
</serverjar>
</server>
<art dir="${current.dir}/art"/>
</module>
</target>
<target name="deploy" depends="dist, -module-deploy"/>
<target name="clean" depends="-module-clean"/>
<property name="test.lib" value="lib_test" />
<property name="test.classes" value="src/test" />
<property name="test.compiled.classes" value="build/test" />
<property name="integrationtest.classes" value="src/integrationtest" />
<property name="integrationtest.compiled.classes" value="build/integrationtest" />
<path id="test.classpath">
<pathelement location="${test.compiled.classes}" />
<pathelement location="${integrationtest.compiled.classes}" />
<pathelement location="${build.classes.dir}" />
<fileset dir="${test.lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="compile-tests" depends="build">
<!-- Unit tests -->
<mkdir dir="${test.compiled.classes}"/>
<javac srcdir="${test.classes}" destdir="${test.compiled.classes}">
<classpath refid="test.classpath"/>
</javac>
<!-- Integration tests -->
<mkdir dir="${integrationtest.compiled.classes}"/>
<javac srcdir="${integrationtest.classes}" destdir="${integrationtest.compiled.classes}">
<classpath refid="test.classpath"/>
</javac>
<copy todir="build/classes/org/jdesktop/wonderland/modules/ourbricks/client">
<fileset dir="src/classes/org/jdesktop/wonderland/modules/ourbricks/client/">
<include name="**/*.properties"/>
</fileset>
</copy>
</target>
<target name="test" depends="compile-tests">
<junit fork="yes" haltonfailure="yes">
<formatter type="plain" usefile="false" />
<classpath refid="test.classpath" />
<batchtest>
<fileset dir="${test.compiled.classes}" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
<target name="integration-test" depends="compile-tests">
<junit fork="yes" haltonfailure="yes">
<formatter type="plain" usefile="false" />
<classpath refid="test.classpath" />
<batchtest>
<fileset dir="${integrationtest.compiled.classes}" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
<target name="all-test" depends="compile-tests, test, integration-test"/>
</project>