-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
247 lines (229 loc) · 11.3 KB
/
build.xml
File metadata and controls
247 lines (229 loc) · 11.3 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
<?xml version="1.0" encoding="utf-8"?>
<project name="DDMSence" default="compile" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- Release Process (need to automate parts of this)
1) Update version in build.xml.
2) Double-check @since tags on new classes.
3) Update index and web downloads page with latest release.
4) Update CHANGES-template.txt.
5) Run "dist" target and review archives.
6) Upload archives and deprecate last release.
7) Delete and reupload javadoc.
8) Upload web files.
9) Upload new DDMSence JAR to webserver and bounce.
10) Test Validator and Builder webapps.
11) Commit any remaining changes and tag as new release.
12) Manual sign-deploy steps for Maven Central Repository upload
13) Announcements (Google Groups / freecode / LinkedIn)
-->
<property name="version" value="2.2.0" />
<property name="conf.dir" value="conf" />
<property name="data.dir" value="data" />
<property name="local.web.dir" value="/projects/urizone/output/tomcat/webapps/ddmsence" />
<property name="src.main.dir" value="src/main" />
<property name="src.samples.dir" value="src/samples" />
<property name="src.test.dir" value="src/test" />
<property name="output.dir" value="output" />
<property name="compile.main.dir" value="${output.dir}/classes/main/" />
<property name="compile.samples.dir" value="${output.dir}/classes/samples/" />
<property name="compile.test.dir" value="${output.dir}/classes/test/" />
<property name="docs.dir" value="${output.dir}/docs" />
<property name="jars.dir" value="${output.dir}/jars" />
<property name="dist.dir" value="${output.dir}/dist" />
<property name="dist.maven.dir" value="${dist.dir}/maven" />
<property name="reports.dir" value="${output.dir}/reports" />
<path id="classpath.compile">
<fileset dir="lib/" includes="*.jar" />
</path>
<path id="classpath.samples">
<path refid="classpath.compile" />
<pathelement location="${compile.main.dir}" />
</path>
<path id="classpath.test">
<path refid="classpath.compile" />
<pathelement location="${compile.main.dir}" />
<pathelement location="${compile.test.dir}" />
<fileset dir="lib/test/" includes="*.jar" />
<!-- This is used to compile the DDMSVersionTaglet, which is used in generating docs -->
<fileset dir="${java.home}/../lib/" includes="tools.jar" />
</path>
<fileset dir="src/main/resources/conf" id="files.properties">
<include name="*.properties" />
</fileset>
<fileset dir="src/main/resources/data" id="files.requiredData">
<include name="schemas/**" />
<include name="schematron/**" />
</fileset>
<fileset dir="src/main/resources/data" id="files.website">
<include name="web/**" />
<exclude name="web/images/**" />
<exclude name="web/favicon.ico" />
</fileset>
<fileset dir="src/main/resources/data" id="files.website.images">
<include name="web/images/**" />
<include name="web/favicon.ico" />
</fileset>
<target name="clean" description="Removes the temporary build directories">
<delete quiet="true" dir="${output.dir}" />
</target>
<target name="compile" description="Compiles the Java classes and copies property files">
<mkdir dir="${compile.main.dir}" />
<mkdir dir="${compile.samples.dir}" />
<mkdir dir="${compile.test.dir}" />
<filter token="ddmsence.version" value="${version}"/>
<javac srcdir="${src.main.dir}" destdir="${compile.main.dir}" classpathref="classpath.compile" source="1.6" includeantruntime="false" />
<copy todir="${compile.main.dir}" filtering="true">
<fileset refid="files.properties" />
<fileset refid="files.requiredData" />
</copy>
<javac srcdir="${src.samples.dir}" destdir="${compile.samples.dir}" classpathref="classpath.samples" source="1.6" includeantruntime="false" />
<javac srcdir="${src.test.dir}" destdir="${compile.test.dir}" classpathref="classpath.test" source="1.6" includeantruntime="false" />
<copy todir="${compile.test.dir}" filtering="true">
<fileset refid="files.properties" />
<fileset refid="files.requiredData" />
</copy>
<copy todir="${output.dir}" filtering="true">
<fileset refid="files.website" />
</copy>
<copy todir="${output.dir}">
<fileset refid="files.website.images" />
</copy>
</target>
<target name="dist" depends="clean, compile, docs, tests" description="Performs a full build of the project and creates the bin/src downloads">
<mkdir dir="${jars.dir}" />
<mkdir dir="${dist.dir}/ddmsence-src-${version}" />
<mkdir dir="${dist.dir}/ddmsence-bin-${version}" />
<mkdir dir="${dist.maven.dir}" />
<!-- Build the src-flavored download archive -->
<copy todir="${dist.dir}/ddmsence-src-${version}" includeEmptyDirs="false">
<fileset dir=".">
<exclude name=".settings/**"/>
<exclude name="${output.dir}/**"/>
</fileset>
</copy>
<copy tofile="${dist.dir}/ddmsence-src-${version}/CHANGES.txt" file="src/main/resources/conf/CHANGES-template.txt" />
<copy tofile="${dist.dir}/ddmsence-src-${version}/LICENSE.txt" file="src/main/resources/conf/LICENSE-template.txt" />
<zip destfile="${dist.dir}/ddmsence-src-${version}.zip" basedir="${dist.dir}" includes="ddmsence-src-${version}/**" />
<!-- Build the bin-flavored download archive -->
<jar destfile="${jars.dir}/ddmsence-${version}.jar" basedir="${compile.main.dir}">
<manifest>
<attribute name="Specification-Title" value="DDMSence"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="Brian Uri!"/>
<attribute name="Implementation-Title" value="DDMSence"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="Brian Uri!"/>
</manifest>
</jar>
<jar destfile="${jars.dir}/ddmsence-samples-${version}.jar" basedir="${compile.samples.dir}">
<manifest>
<attribute name="Specification-Title" value="DDMSence"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="Brian Uri!"/>
<attribute name="Implementation-Title" value="DDMSence"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="Brian Uri!"/>
</manifest>
</jar>
<copy todir="${dist.dir}/ddmsence-bin-${version}" includeEmptyDirs="false">
<fileset dir=".">
<exclude name=".classpath"/>
<exclude name=".project"/>
<exclude name="build.xml"/>
<exclude name="pom.xml"/>
<exclude name=".settings/**"/>
<exclude name="${src.main.dir}/**"/>
<exclude name="${src.test.dir}/**"/>
<exclude name="${conf.dir}/**"/>
<exclude name="${output.dir}/**"/>
<exclude name="${data.dir}/schemas/**"/>
<exclude name="${data.dir}/schematron/**"/>
<exclude name="${data.dir}/test/**"/>
<exclude name="${data.dir}/web/**"/>
<exclude name="lib/test/**"/>
</fileset>
<fileset dir="${output.dir}">
<include name="docs/**" />
</fileset>
</copy>
<copy tofile="${dist.dir}/ddmsence-bin-${version}/CHANGES.txt" file="src/main/resources/conf/CHANGES-template.txt" />
<copy tofile="${dist.dir}/ddmsence-bin-${version}/LICENSE.txt" file="src/main/resources/conf/LICENSE-template.txt" />
<copy todir="${dist.dir}/ddmsence-bin-${version}/lib">
<fileset dir="${jars.dir}" />
</copy>
<zip destfile="${dist.dir}/ddmsence-bin-${version}.zip" basedir="${dist.dir}" includes="ddmsence-bin-${version}/**" />
<!-- Build the Maven Central Repository archive -->
<copy todir="${dist.maven.dir}" file="${jars.dir}/ddmsence-${version}.jar" />
<jar jarfile="${dist.maven.dir}/ddmsence-${version}-javadoc.jar">
<fileset dir="${docs.dir}" />
</jar>
<jar jarfile="${dist.maven.dir}/ddmsence-${version}-sources.jar">
<fileset dir="${src.main.dir}" />
</jar>
<!-- Deploy manual commands:
mvn gpg:sign-and-deploy-file -DpomFile=pom.xml -Dfile=./output/dist/maven/ddmsence-2.1.0.jar -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging
mvn gpg:sign-and-deploy-file -DpomFile=pom.xml -Dfile=./output/dist/maven/ddmsence-2.1.0-sources.jar -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -Dclassifier=sources
mvn gpg:sign-and-deploy-file -DpomFile=pom.xml -Dfile=./output/dist/maven/ddmsence-2.1.0-javadoc.jar -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -Dclassifier=javadoc
Then, Close and Release repository via Nexus UI.
-->
<!-- Cleanup -->
<delete quiet="true" dir="${dist.dir}/ddmsence-src-${version}" />
<delete quiet="true" dir="${dist.dir}/ddmsence-bin-${version}" />
</target>
<target name="docs" depends="compile" description="Generates API Documentation">
<tstamp>
<format property="javadoc.time" pattern="MM/dd/yyyy hh:mm aa" />
</tstamp>
<javadoc packagenames="buri.ddmsence.*" sourcepath="${src.main.dir}" destdir="${docs.dir}" classpathref="classpath.compile"
noqualifier="java.*"
overview="src/main/resources/conf/javadoc-overview.html"
use="true" splitindex="false"
windowtitle="DDMSence ${version} API"
docencoding="UTF-8" charset="UTF-8"
doctitle="DDMSence ${version}"
bottom="Copyright 2010 - 2013 by Brian Uri!<br />Generated on ${javadoc.time}<br /><a target='_top' href='http://ddmsence.urizone.net/'>http://ddmsence.urizone.net/</a>"
stylesheetfile="src/main/resources/conf/javadoc-stylesheet.css"
>
<taglet name="buri.ddmsence.util.taglet.DDMSChildInfoTaglet">
<path refid="classpath.test" />
</taglet>
<taglet name="buri.ddmsence.util.taglet.DDMSRuleTaglet">
<path refid="classpath.test" />
</taglet>
<taglet name="buri.ddmsence.util.taglet.DDMSVersionTaglet">
<path refid="classpath.test" />
</taglet>
<taglet name="buri.ddmsence.util.taglet.TableFooterTaglet">
<path refid="classpath.test" />
</taglet>
<taglet name="buri.ddmsence.util.taglet.TableHeaderTaglet">
<path refid="classpath.test" />
</taglet>
</javadoc>
</target>
<target name="tests" description="Runs unit tests">
<delete quiet="true" dir="${reports.dir}" />
<mkdir dir="${reports.dir}" />
<junit printsummary="false" haltonfailure="true" fork="true" forkmode="perBatch">
<classpath refid="classpath.test" />
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="${reports.dir}">
<fileset dir="${compile.test.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
<target name="localWeb" depends="compile" description="Deploys the website pages locally for testing">
<mkdir dir="${local.web.dir}" />
<copy todir="${local.web.dir}" includeEmptyDirs="false">
<fileset dir="${output.dir}/web">
<include name="**/**" />
</fileset>
</copy>
</target>
<target name="localZip" description="Creates a ZIP of the entire project">
<tstamp>
<format property="backupStamp" pattern="yyMMdd-HHmm"/>
</tstamp>
<zip destfile="../${backupStamp}-DDMSence-${version}.zip" basedir=".." includes="ddmsence/**" excludes="ddmsence/output/**" />
</target>
</project>