/
build.xml
105 lines (84 loc) · 3.08 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
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE project PUBLIC "-//ANT//DTD project//EN"
"file:///home/oliver/devel/doc/project.dtd">
<!--<!DOCTYPE project>-->
<!--
Copyright (c) 2006 Oliver Stewart. All Rights Reserved.
This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-->
<project name="trailmagic-toolkit" default="build" basedir=".">
<!-- potentially override what's in here -->
<property file="ant.properties"/>
<property name="earname" value="trailmagic-toolkit.ear"/>
<property name="build.dir" value="build"/>
<property name="resources.dir" value="etc"/>
<property name="products.dir" value="${build.dir}/products"/>
<property name="global.lib.dir" value="lib"/>
<property name="global.lib.dep.dir" value="lib-dep"/>
<!-- these must be in order by dependency...I agree that it sucks -->
<filelist dir="." id="modules.list">
<file name="modules/user/build.xml"/>
<file name="modules/image/build.xml"/>
<file name="web/photo/build.xml"/>
</filelist>
<fileset dir="." id="products.fileset">
<include name="*/*/build/product/*"/>
</fileset>
<macrodef name="iterate">
<attribute name="target"/>
<sequential>
<subant target="@{target}" inheritall="false" inheritrefs="false">
<filelist refid="modules.list"/>
</subant>
</sequential>
</macrodef>
<target name="deploy" depends="build,deploy-subprojects,deploy-ear">
<!-- depends do all the work -->
</target>
<target name="deploy-subprojects" if="no.ear">
<iterate target="deploy"/>
</target>
<target name="deploy-ear" unless="no.ear">
<copy file="${build.dir}/${earname}" toDir="${deploy.dir}"/>
</target>
<target name="compile">
<iterate target="compile"/>
</target>
<target name="runtests">
<iterate target="runtests"/>
</target>
<target name="build" depends="build-subprojects,build-ear">
<!-- depends do all the work -->
</target>
<target name="build-subprojects">
<iterate target="build"/>
</target>
<target name="build-ear" unless="no.ear">
<mkdir dir="${build.dir}"/>
<mkdir dir="${products.dir}"/>
<!-- ugly but I can't find a way to strip the paths for the ear -->
<copy toDir="${products.dir}" flatten="true">
<fileset refid="products.fileset"/>
</copy>
<ear destfile="${build.dir}/${earname}"
appxml="${resources.dir}/application.xml">
<fileset dir="${products.dir}"/>
<fileset dir="${global.lib.dir}"/>
<fileset dir="${global.lib.dep.dir}"/>
</ear>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<iterate target="clean"/>
</target>
<target name="clean-deploy">
<iterate target="clean-deploy"/>
</target>
</project>