-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
274 lines (227 loc) · 10.1 KB
/
build.xml
File metadata and controls
274 lines (227 loc) · 10.1 KB
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<project name="grouperClient" default="build" basedir=".">
<!-- ant contrib allows conditionals in ant scripts -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${basedir}/lib/ant/ant-contrib.jar" />
</classpath>
</taskdef>
<target name="build" description="full build" depends="init,clean,compile,jarPrepare,jar">
</target>
<target name="init">
<tstamp />
<property file="${basedir}/misc/version.properties"/>
<property name="cvs.branch" value="HEAD" />
<property name="main.sourceDir" value="src/java" />
<property name="main.sourceExtDir" value="src/ext" />
<property name="main.sourceExtMoreDir" value="src/extMore" />
<property name="main.confDir" value="conf" />
<property name="main.lib" value="lib" />
<property name="main.binDir" value="dist/bin" />
<property name="main.outputDir" value="dist" />
<property name="main.appName" value="grouperClient" />
<property name="main.jarFile" value="${main.outputDir}/${main.appName}.jar" />
<path id="main.extClasspath">
<fileset dir="${main.lib}">
<include name="**/*.jar" />
</fileset>
</path>
<condition property="main.os" value="windows">
<os family="windows" />
</condition>
<condition property="main.os" value="unix">
<os family="unix" />
</condition>
<pathconvert targetos="${main.os}" property="main.theExtClasspath" refid="main.extClasspath" />
<if><not><available file="${main.confDir}/grouper.client.properties" /></not>
<then><copy file="${main.confDir}/grouper.client.example.properties"
tofile="${main.confDir}/grouper.client.properties" /></then>
</if>
<if><not><available file="${main.confDir}/grouper.client.usage.txt" /></not>
<then><copy file="${main.confDir}/grouper.client.usage.example.txt"
tofile="${main.confDir}/grouper.client.usage.txt" /></then>
</if>
<if><not><available file="misc/README.txt" /></not>
<then><copy file="misc/README.example.txt"
tofile="misc/README.txt" /></then>
</if>
</target>
<target name="clean">
<mkdir dir="${main.binDir}" />
<delete dir="${main.binDir}" />
<mkdir dir="${main.binDir}" />
</target>
<target name="compile">
<mkdir dir="${main.outputDir}" />
<mkdir dir="${main.binDir}" />
<javac target="1.5"
srcdir="${main.sourceExtDir}" destdir="${main.binDir}" debug="true" classpath="${main.theExtClasspath}" />
<javac target="1.5"
srcdir="${main.sourceDir}" destdir="${main.binDir}" debug="true" />
<javac target="1.5"
srcdir="${main.sourceExtMoreDir}" destdir="${main.binDir}" debug="true" classpath="${main.theExtClasspath}"/>
<javac target="1.5"
srcdir="src/extCustom" destdir="${main.binDir}" debug="true" classpath="${main.theExtClasspath}" />
<javac target="1.5"
srcdir="src/custom" destdir="${main.binDir}" debug="true" />
</target>
<target name="jarPrepare">
<mkdir dir="${main.binDir}" />
<copy todir="${main.binDir}">
<fileset dir="${main.sourceDir}">
<include name="**/*.java"/> <!-- source -->
<include name="**/*.txt"/> <!-- txt -->
<include name="**/*.html"/> <!-- html -->
</fileset>
<fileset dir="${main.sourceExtDir}">
<include name="**/*.java"/> <!-- source -->
</fileset>
<fileset dir="${main.sourceExtMoreDir}">
<include name="**/*.java"/> <!-- source -->
</fileset>
<fileset dir="${main.confDir}">
<include name="*.example.properties"/> <!-- sample config -->
<include name="grouper.client.usage*.txt"/> <!-- sample config -->
</fileset>
<fileset dir="${basedir}">
<include name="README.txt"/> <!-- sample config -->
</fileset>
</copy>
</target>
<target name="jar">
<tstamp>
<format property="the.timestamp" pattern="yyyy/MM/dd HH:mm:ss" />
</tstamp>
<jar jarfile="${main.jarFile}" duplicate="fail">
<fileset dir="misc">
<include name="META-INF/*" />
</fileset>
<fileset dir="${main.binDir}" />
<manifest>
<attribute name="Main-Class" value="edu.internet2.middleware.grouperClient.GrouperClient"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Implementation-Vendor" value="Internet2"/>
<attribute name="Implementation-Title" value="grouperClient"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-URL" value="https://wiki.internet2.edu/confluence/display/GrouperWG/Grouper+Client"/>
<attribute name="Build-Timestamp" value="${the.timestamp}"/>
</manifest>
</jar>
<property name="instName" value="grouperClient.institution-${version}" />
<mkdir dir="dist/institution/${instName}"/>
<copy todir="dist/institution/${instName}">
<fileset dir="${main.confDir}">
<include name="grouper.client.properties"/>
</fileset>
<fileset dir="dist">
<include name="grouperClient.jar"/>
</fileset>
<fileset dir="misc">
<include name="README.txt"/>
</fileset>
</copy>
<tar destfile="dist/${instName}.tar.gz" compression="gzip">
<tarfileset dir="dist/institution" >
<include name="${instName}/**"/>
</tarfileset>
</tar>
<echo message="Output is: dist/grouperClient.jar and dist/${instName}.tar.gz" />
<echo message="Note: dist/${instName}.tar.gz contains the conf/grouper.client.properties, make sure it has no sensitive credentials in it" />
</target>
<target name="distPackage" description="build tar gz on internet2 box" depends="init,javadoc">
<delete dir="doc" />
<copy todir="${basedir}/../grouper.client-${version}">
<fileset dir="${basedir}/../grouperClient" />
</copy>
<!-- this assumes that everything was checked out to the right place, and no other dirs exist -->
<tar destfile="${basedir}/../grouper.client-${version}.tar.gz" compression="gzip">
<tarfileset dir="${basedir}/.." >
<include name="grouper.client-${version}/**"/>
</tarfileset>
</tar>
</target>
<target name="distBinaryPreJar">
<!-- we dont want this in the jar, we want it next to the jar -->
<delete file="${main.binDir}/grouper.client.usage.txt" />
</target>
<target name="distBinary" description="build tar gz on internet2 box" depends="init,clean,compile,jarPrepare,distBinaryPreJar,jar">
<property name="binName" value="grouper.clientBinary-${version}" />
<mkdir dir="dist/binary/${binName}"/>
<copy todir="dist/binary/${binName}">
<fileset dir="${main.confDir}">
<include name="grouper.client*.properties"/>
<include name="grouper.client.usage*.txt"/>
</fileset>
<fileset dir="dist">
<include name="grouperClient.jar"/>
</fileset>
<fileset dir="misc">
<include name="BINARY-README.txt"/>
</fileset>
</copy>
<tar destfile="${basedir}/../${binName}.tar.gz" compression="gzip">
<tarfileset dir="dist/binary" >
<include name="${binName}/**"/>
</tarfileset>
</tar>
</target>
<target name="javadoc" description="generate public api docs for users to javadoc/api" depends="init">
<!-- Let's be sure we clear out old cruft first... -->
<mkdir dir="javadoc/api" />
<delete dir="javadoc/api" />
<mkdir dir="javadoc/api" />
<!-- header="<script>alert('whatever');</script>" -->
<javadoc destdir="javadoc/api" access="public"
additionalparam="-notimestamp" >
<packageset dir="src/java" defaultexcludes="yes">
<include name="edu/internet2/middleware/grouperClient/**" />
</packageset>
<link href="http://struts.apache.org/1.2.x/api/" />
<link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api" />
<link href="http://java.sun.com/j2se/1.4.2/docs/api" />
</javadoc>
</target>
<target name="javadocInternal" description="generate public api docs for cvs to doc/api" depends="init">
<!-- Let's be sure we clear out old cruft first... -->
<mkdir dir="doc/api" />
<delete dir="doc/api" />
<mkdir dir="doc/api" />
<!-- header="<script>alert('whatever');</script>" -->
<javadoc destdir="doc/api" access="public"
additionalparam="-notimestamp" >
<packageset dir="src/java" defaultexcludes="yes">
<include name="edu/internet2/middleware/grouperClient/**" />
</packageset>
<link href="http://struts.apache.org/1.2.x/api/" />
<link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api" />
<link href="http://java.sun.com/j2se/1.4.2/docs/api" />
</javadoc>
<!-- replace .html?edu/internet2/middleware/grouper/webservices/GrouperService.html" with
.html" -->
<!-- take out existing params, these are used by javascript to go to frames gracefully, trash them -->
<replaceregexp flags="g">
<regexp pattern="\.html\?[^" ]*"" />
<substitution expression="\.html"" />
<fileset dir="doc/api" includes="**/*.html" />
</replaceregexp>
<!-- replace relative links, e.g. method links -->
<replaceregexp flags="g">
<regexp pattern="\.html#([^">]*)"" />
<substitution expression="\.html?view=co#\1"" />
<fileset dir="doc/api" includes="**/*.html" />
</replaceregexp>
<!-- replace onLoad="top.loadFrames()" with onLoad="", this javascript messes things up with viewvc params -->
<replace file="doc/api/index.html">
<replacetoken><![CDATA[onLoad="top.loadFrames()"]]></replacetoken>
<replacevalue><![CDATA[onLoad=""]]></replacevalue>
</replace>
<!-- replace for cvs web: .html" with .html?view=co" -->
<replace dir="doc/api" value=".html?view=co"">
<include name="**/*.html" />
<replacetoken><![CDATA[.html"]]></replacetoken>
</replace>
<replace dir="doc/api" value=".css?view=co"">
<include name="**/*.html" />
<replacetoken><![CDATA[.css"]]></replacetoken>
</replace>
</target>
</project>