-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-module-common.xml
252 lines (202 loc) · 9.29 KB
/
build-module-common.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
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?xml version="1.0" encoding="UTF-8"?>
<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2009. The GUITAR group at the University of Maryland. Names of owners
of this group may be obtained by sending an e-mail to [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Purpose: Ant build file for GUITAR-RIPPER.
Ant-Download: http://jakarta.apache.org/ant
Ant-Manual: http://jakarta.apache.org/ant/manual/index.html
GUITAR-Homepage: http://guitar.sourceforge.net
Precondition: 1. Ant should be installed.
2. JAVA_HOME environment variable contains the path to JDK1.6 or higher
3. ANT_HOME environment variable contains the path to ant 1.8.2 or higher
Language: XML
Compiler: Ant
Authors: Bao N. Nguyen, [email protected]
Version: $Revision: 2$
$Date: 2011-07-01$
$Author: Bao N. Nguyen$
Version: $Revision: 1$
$Date: 2009-08-16$
$Author: Bao N. Nguyen$
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<project name="build-module-common" default="dist" basedir=".">
<!-- Environment vars-->
<property file="./build.properties" />
<available file="${pre.antfile}" property="filePresent" />
<available file="${post.antfile}" property="postFilePresent" />
<property name="debug" value="true" />
<!-- third party jar files for distribution -->
<fileset id="3rd-dist.file.ref" dir="${shared.lib.dir}" includes="*.jar" erroronmissingdir="false" />
<!-- PRE File -->
<target description="Build dependencies" name="pre" if="filePresent">
<ant antfile="${pre.antfile}" inheritAll="true">
<property name="debug" value="true" />
<property file="./build.properties" />
</ant>
</target>
<!-- POST File -->
<target description="Build dependencies" name="post" if="postFilePresent">
<ant antfile="${post.antfile}" dir="${basedir}" inheritAll="true">
<property name="debug" value="true" />
<property file="./build.properties" />
</ant>
</target>
<!-- - - - - - - - -
PUBLIC TASKS
- - - - - - - - - -->
<!-- Help -->
<target description="help" name="help">
<echo message="${module} help" />
</target>
<!-- Build -->
<target description="Build the project" name="build">
<echo message="${module}" />
<mkdir dir="${build.dir}" />
<!-- delete current jar to avoid cycle in classpath -->
<delete file="${dist.guitar.lib.dir}/${module}.jar" />
<javac srcdir="${src.dir}" destdir="${build.dir}" debug="${debug}" deprecation="${deprecation}">
<classpath>
<fileset dir="${dist.guitar.lib.dir}" includes="**/*.jar" erroronmissingdir="false" />
<fileset dir="${shared.lib.dir}" includes="**/*.jar" erroronmissingdir="false" />
<fileset dir="${dist.guitar.lib.dir}" includes="**/*.jar" erroronmissingdir="false" />
</classpath>
</javac>
</target>
<!-- Jar -->
<target name="jar" depends="pre,updateDepends,build">
<mkdir dir="${dist.guitar.dir}" />
<mkdir dir="${dist.lib.dir}" />
<mkdir dir="${dist.guitar.lib.dir}" />
<!-- <delete file="${guitar.lib.dir}/${module}.jar" /> -->
<jar jarfile="${dist.guitar.lib.dir}/${module}.jar" update="true" >
<fileset dir="${build.dir}" erroronmissingdir="false">
</fileset>
<fileset dir="${resources.dir}/jar" erroronmissingdir="false">
</fileset>
</jar>
</target>
<!-- Builds all the modules needed to build the current module -->
<target name="updateDepends">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${ant.dir}/ant-contrib-0.6.jar" />
</classpath>
</taskdef>
<!-- Load the svn task for ant -->
<path id="svnant.classpath">
<fileset dir="${ant.dir}">
<include name="*.jar" />
</fileset>
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<!-- For each module that we need -->
<for list="${needsModules}" param="letter">
<sequential>
<!-- Is the needed .jar file already present -->
<available file="${dist.guitar.lib.dir}/@{letter}.jar" property="@{letter}.jar.present" />
<if>
<equals arg1="${@{letter}.jar.present}" arg2="true" />
<then>
<echo message="@{letter}.jar is present" />
</then>
<!-- otherwise check if folder is also not present -->
<else>
<property name="@{letter}.folder.present" value="false" />
<echo message="@{letter}.jar is NOT present. Checking the folder ${dist.dir}/@{letter}" />
<available file="${modules.dir}/@{letter}" type="dir" property="@{letter}.folder.present" />
<if>
<equals arg1="${@{letter}.folder.present}" arg2="false" />
<then>
<echo message="The folder ${dist.dir}/@{letter} is NOT present. Getting from svn" />
<!-- the folder does not exist, get it via SVN checkout -->
<svn>
<checkout url="https://guitar.svn.sourceforge.net/svnroot/guitar/@{letter}/trunk" destPath="${dist.dir}/@{letter}" />
</svn>
</then>
<else>
<echo message="************** @{letter} folder is present" />
</else>
</if>
<!-- We have the folder. Compile the folder and get the jar -->
<ant antfile="build.xml" target="all" dir="${modules.dir}/@{letter}" inheritAll="false">
</ant>
</else>
</if>
</sequential>
</for>
</target>
<target name="copy" if="filesToCopy">
<echo message="${dist.dir}" />
<copy todir="${dist.dir}" flatten="true">
<fileset dir="${basedir}" includes="${filesToCopy}" />
</copy>
</target>
<!-- Java doc -->
<target description="create javadocs" name="doc">
<mkdir dir="${dist.doc.dir}" />
<mkdir dir="${dist.doc.dir}/${module}" />
<property name="ps" value="${path.separator}" />
<property name="ydocInstallPath" value="${ydocinstall.dir}" />
<javadoc sourcepath="${src.dir}" destdir="${dist.doc.dir}/${module}">
<classpath>
<fileset dir="${dist.lib.dir}" includes="**/*.jar" erroronmissingdir="false" />
<fileset dir="${shared.lib.dir}" includes="**/*.jar" erroronmissingdir="false" />
<fileset dir="${dist.guitar.lib.dir}" includes="**/*.jar" erroronmissingdir="false" />
</classpath>
<doclet name="ydoc.doclets.YStandard" path="${ydocInstallPath}/lib/ydoc.jar${ps}${ydocInstallPath}/resources${ps}${ydocInstallPath}/doc">
<param name="-author" />
<param name="-generic" />
<param name="-umlautogen" />
<param name="-filterpath" value="${ydocInstallPath}/lib/ydoc.jar" />
<param name="-filter" value="ydoc.filters.ExcludeFilter" />
<param name="-tag" value="y.precondition" />
<param name="-tag" value="y.postcondition" />
<param name="-tag" value="y.complexity" />
<param name="-tag" value="param" />
<param name="-tag" value="return" />
<param name="-tag" value="see" />
<param name="-tag" value="y.uml" />
</doclet>
</javadoc>
</target>
<!-- Distribute -->
<target name="dist" depends="pre,updateDepends,jar,post,copy,doc" description="Create a jar for the GUITAR-Core project">
<!-- copy resource files -->
<copy todir="${dist.guitar.dir}" flatten="true">
<fileset dir="resources" erroronmissingdir="false">
<include name ="config/*" />
<include name ="user-scripts/*" />
<include name ="help/*" />
</fileset>
</copy>
<copy todir="${dist.lib.dir}" flatten="true">
<!-- common third party libraries-->
<fileset refid="3rd-dist.file.ref" erroronmissingdir="false" />
<!-- platform libraries-->
<fileset dir="${shared.lib.dir}/platforms/${platform}" includes="*" erroronmissingdir="false" />
</copy>
</target>
<!-- Clean -->
<target description="clean project" name="clean">
<delete dir="${build.dir}" />
<delete file="${dist.guitar.lib.dir}/${module}.jar" />
<delete dir="${dist.doc.dir}/${module}" />
</target>
<target name="all" depends="clean,pre,updateDepends,jar,post,copy,doc">
<echo message="This is ${module}" />
</target>
</project>