forked from roborescue/rcrs-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-compile.xml
62 lines (58 loc) · 1.97 KB
/
build-compile.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
<project>
<target name="_init-compile">
<mkdir dir="${build.dir}"/>
<mkdir dir="${jar.dir}"/>
</target>
<target name="compile" depends="_init-compile" description="Compile all modules">
<for list="${modules}" param="module">
<sequential>
<_compile module="@{module}"/>
</sequential>
</for>
</target>
<target name="jars" depends="compile" description="Create all module jars">
<for list="${modules}" param="module">
<sequential>
<_jar module="@{module}"/>
</sequential>
</for>
</target>
<macrodef name="_compile">
<attribute name="module"/>
<sequential>
<if>
<not><isset property="@{module}.compiled"/></not>
<then>
<!-- Check for dependencies -->
<propertycopy property="deps" from="modules.@{module}.depend" override="true"/>
<for list="${deps}" param="dep">
<sequential>
<_compile module="@{dep}"/>
<_jar module="@{dep}"/>
</sequential>
</for>
<mkdir dir="${build.dir}/@{module}/classes"/>
<javac srcdir="${modules.dir}/@{module}/src" destdir="${build.dir}/@{module}/classes" debug="${debug}">
<classpath>
<path refid="path.common"/>
</classpath>
<include name="**/*.java"/>
<compilerarg value="${javac.flags}"/>
</javac>
<property name="@{module}.compiled" value="true"/>
</then>
</if>
</sequential>
</macrodef>
<macrodef name="_jar">
<attribute name="module"/>
<sequential>
<manifest file="${modules.dir}/@{module}/manifest" mode="update">
</manifest>
<jar destfile="${jar.dir}/@{module}.jar" manifest="${modules.dir}/@{module}/manifest">
<fileset dir="${build.dir}/@{module}/classes" includes="**/*.class"/>
<fileset dir="${modules.dir}/@{module}/resources" erroronmissingdir="false"/>
</jar>
</sequential>
</macrodef>
</project>