-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
268 lines (240 loc) · 14.5 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
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
<?xml version="1.0" ?>
<!-- $Id: build.xml,v 1.447 2007/09/05 09:11:13 agoubard Exp $ -->
<project name="xins" default="all">
<!-- Extra build file contains XINS dev-specific targets -->
<import file="build-dev.xml" optional="true" />
<!-- Generate everything -->
<target name="all" depends="jars,javadoc" description="Generates everything" />
<!-- Determine current version by reading version file. -->
<target name="-load-version">
<property name="version.file" value=".version.properties" />
<property file="${version.file}" />
<condition property="version.isset">
<and>
<isset property="version.major" />
<isset property="version.middle" />
</and>
</condition>
<fail unless="version.isset">Missing properties 'version.major' and 'version.middle'.</fail>
<condition property="dot.version.minor" value="${version.minor}">
<or>
<equals arg1="${version.minor}" arg2="-alpha" />
<equals arg1="${version.minor}" arg2="-beta" />
<equals arg1="${version.minor}" arg2="-rc" />
<equals arg1="${version.minor}" arg2="" />
</or>
</condition>
<property name="dot.version.minor" value=".${version.minor}" />
</target>
<!-- Initialization settings -->
<target name="-init" depends="-load-version">
<!-- General project properties -->
<property name="project.title" value="XINS" />
<property name="project.name" value="${ant.project.name}" />
<property name="name" value="${project.name}" />
<property name="project.version" value="${version.major}.${version.middle}${dot.version.minor}${version.build}${version.suffix}" />
<property name="project.vendor" value="Online Breedband B.V." />
<property name="project.sourcedir" value="src/java" />
<property name="project.url" value="http://github.com/znerd/xins/" />
<property name="project.outputdir" value="${basedir}/build" />
<property name="classes.outputdir" value="${project.outputdir}/classes" />
<property name="metainf.outputdir" value="${classes.outputdir}/META-INF" />
<property name="package-basename" value="${project.name}-${project.version}" />
<!-- Java compiler-related settings -->
<property name="javac.sourceversion" value="1.5" />
<property name="javac.targetvm" value="1.5" />
<property name="javac.debug" value="true" />
<property name="javac.deprecation" value="true" />
<property name="javac.optimize" value="false" />
<property name="javac.maxerrs" value="9999" />
<property name="javac.maxwarns" value="9999" />
<property name="javac.includes" value="org/xins/**/*.java" />
<property name="javac.compilerargs" value="-Xlint -Xmaxwarns ${javac.maxwarns} -Xmaxerrs ${javac.maxerrs}" />
<property name="tests.deprecation" value="false" />
<!-- Settings related to unit- and performance-testing -->
<property name="testclass" value="org.xins.tests.AllTests" />
<property name="perftestclass" value="org.xins.perftests.AllTests" />
<!-- Class paths -->
<property name="logdoc-base.jar" value="${basedir}/lib/logdoc-base.jar" />
<property name="logdoc-ant-tasks.jar" value="${basedir}/lib/logdoc-ant-tasks.jar" />
</target>
<!-- Display relevant versions -->
<target name="version" depends="-init">
<echo message="Java ${java.version}" />
<echo message="${ant.version}" />
<echo message="${project.title} ${project.version}" />
</target>
<!-- Clean generated files -->
<target name="clean" description="Removes all generated files">
<delete dir="${project.outputdir}" />
<delete dir="src/tests/build" />
<!-- Logdoc-generated files -->
<delete file="src/java/org/xins/client/Log.java" />
<delete file="src/java/org/xins/client/TranslationBundle.java" />
<delete file="src/java/org/xins/client/TranslationBundle_en_US.java" />
<delete file="src/java/org/xins/client/TranslationBundle_fr_FR.java" />
<delete file="src/java/org/xins/common/Log.java" />
<delete file="src/java/org/xins/common/TranslationBundle.java" />
<delete file="src/java/org/xins/common/TranslationBundle_en_US.java" />
<delete file="src/java/org/xins/common/TranslationBundle_fr_FR.java" />
<delete file="src/java/org/xins/server/DefaultResultCodes.java" />
<delete file="src/java/org/xins/server/Log.java" />
<delete file="src/java/org/xins/server/TranslationBundle.java" />
<delete file="src/java/org/xins/server/TranslationBundle_en_US.java" />
<delete file="src/java/org/xins/server/TranslationBundle_fr_FR.java" />
</target>
<!-- Prepare for compilation (typically used inside IDEs, too) -->
<target name="prepare-compile" depends="-init,-logdoc-task" description="Prepares for the compilation, by generating source files and/or other files to be placed with the compiled files">
<!-- Generate Java source files -->
<xslt in="src/xml/default_resultcodes.xml" style="src/xslt/java-server-framework/default_resultcodes_to_java.xslt" out="${project.sourcedir}/org/xins/server/DefaultResultCodes.java" />
<logdoc-code in="src/logdoc/common" out="src/java" />
<logdoc-code in="src/logdoc/client" out="src/java" />
<logdoc-code in="src/logdoc/server" out="src/java" />
<!-- Stick auxiliary files in location where compiled code will go -->
<mkdir dir="${classes.outputdir}" />
<copy todir="${classes.outputdir}">
<fileset dir="${project.sourcedir}">
<exclude name="**/*.swp" />
<exclude name="**/*.java" />
<exclude name="**/package.html" />
</fileset>
</copy>
</target>
<!-- Compile all source files -->
<target name="compile" depends="prepare-compile" description="Compiles the source code">
<javac srcdir="${project.sourcedir}"
includes="${javac.includes}"
destdir="${classes.outputdir}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
optimize="${javac.optimize}"
source="${javac.sourceversion}"
target="${javac.targetvm}"
includeAntRuntime="true">
<compilerarg line="${javac.compilerargs}" />
<classpath>
<fileset dir="lib" includes="*.jar" />
</classpath>
</javac>
</target>
<!-- Generate all JAR files -->
<target name="jars" depends="compile" description="Generates the JAR files">
<!-- Macro used for generating each JAR -->
<macrodef name="create-jar">
<attribute name="name" />
<attribute name="title" />
<sequential>
<jar destfile="${project.outputdir}/xins-@{name}.jar" basedir="${project.outputdir}/classes/" includes="org/xins/@{name}/** META-INF/**">
<manifest>
<attribute name="Main-Class" value="org.xins.@{name}.Library" />
<section name="org/xins/@{name}/">
<attribute name="Specification-Title" value="@{title}" />
<attribute name="Specification-Version" value="${project.version}" />
<attribute name="Specification-Vendor" value="${project.vendor}" />
<attribute name="Implementation-Title" value="@{title}" />
<attribute name="Implementation-Version" value="${project.version}" />
<attribute name="Implementation-Vendor" value="${project.vendor}" />
</section>
</manifest>
</jar>
</sequential>
</macrodef>
<!-- Generate all 3 JARs -->
<create-jar name="common" title="XINS/Java Common Library" />
<create-jar name="client" title="XINS/Java Client Framework" />
<create-jar name="server" title="XINS/Java Server Framework" />
</target>
<!-- Logdoc -->
<target name="-logdoc-task" depends="-init" description="Initializes the Logdoc task">
<taskdef resource="org/znerd/logdoc/ant/antlib.xml">
<classpath>
<pathelement location="${logdoc-base.jar}" />
<pathelement location="${logdoc-ant-tasks.jar}" />
</classpath>
</taskdef>
</target>
<target name="logdoc-html" depends="-logdoc-task" description="Generates the HTML for the Logdoc documentation">
<logdoc-doc in="src/logdoc/client" out="${project.outputdir}/logdoc/common/html" />
<logdoc-doc in="src/logdoc/client" out="${project.outputdir}/logdoc/client/html" />
<logdoc-doc in="src/logdoc/server" out="${project.outputdir}/logdoc/server/html" />
<copy file="src/css/logdoc/style.css" todir="${project.outputdir}/logdoc/common/html" />
<copy file="src/css/logdoc/style.css" todir="${project.outputdir}/logdoc/client/html" />
<copy file="src/css/logdoc/style.css" todir="${project.outputdir}/logdoc/server/html" />
</target>
<!-- Generate Javadoc -->
<target name="-javadoc-macro" depends="-init" description="Defines the macro for generating Javadoc">
<macrodef name="generate-javadoc">
<attribute name="title" />
<attribute name="destdir" />
<attribute name="private" />
<attribute name="footer" />
<sequential>
<mkdir dir="@{destdir}" />
<javadoc doctitle="@{title}" windowtitle="@{title}" destdir="@{destdir}" private="@{private}" bottom="@{footer}" source="${javac.sourceversion}" version="yes" use="yes" author="yes">
<packageset dir="${project.sourcedir}">
<exclude name="org/xins/common/internal" />
<exclude name="org/xins/common/internal/**" />
</packageset>
<group title="XINS/Java Common Library" packages="org.xins.common*" />
<group title="XINS/Java Client Framework" packages="org.xins.client*" />
<group title="XINS/Java Server Framework" packages="org.xins.server*" />
<classpath>
<fileset dir="lib" includes="*.jar" />
<fileset dir="${ant.home}/lib" includes="*.jar" />
</classpath>
<!-- TODO: Link to Logdoc API docs -->
<link offline="true" packagelistloc="src/package-lists/servlet/" href="http://tomcat.apache.org/tomcat-6.0-doc/api/" />
<link offline="true" packagelistloc="src/package-lists/javase/" href="http://java.sun.com/javase/6/docs/api" />
<link offline="true" packagelistloc="src/package-lists/log4j/" href="http://jakarta.apache.org/log4j/docs/api/" />
<link offline="true" packagelistloc="src/package-lists/commons-lang/" href="http://commons.apache.org/lang/api-release/" />
<link offline="true" packagelistloc="src/package-lists/commons-logging/" href="http://jakarta.apache.org/commons/logging/api/" />
<link offline="true" packagelistloc="src/package-lists/commons-httpclient/" href="http://jakarta.apache.org/commons/httpclient/apidocs/" />
<link offline="true" packagelistloc="src/package-lists/oro/" href="http://jakarta.apache.org/oro/api/" />
<link offline="true" packagelistloc="src/package-lists/xmlenc/" href="http://xmlenc.sourceforge.net/javadoc/0.52/" />
<link offline="true" packagelistloc="src/package-lists/ant/" href="http://api.dpml.net/ant/1.7.0/" />
<link offline="true" packagelistloc="src/package-lists/json/" href="http://www.json.org/javadoc/" />
</javadoc>
<copy file="src/css/javadoc/style.css" tofile="@{destdir}/stylesheet.css" overwrite="true" />
</sequential>
</macrodef>
</target>
<target name="javadoc-public" depends="-javadoc-macro" description="Generates public Javadoc API documentation" unless="nodocs">
<generate-javadoc private="no" destdir="${project.outputdir}/javadoc" title="${project.title} ${project.version}" footer="See <a target="_top" href='${project.url}'>${project.url}</a>." />
</target>
<target name="javadoc-private" depends="-javadoc-macro" description="Generates private Javadoc API documentation" unless="nodocs">
<generate-javadoc private="yes" destdir="${project.outputdir}/javadoc-private" title="${project.title} ${project.version}" footer="See <a target="_top" href='${project.url}'>${project.url}</a>.<br />This Javadoc API documentation set contains private and package private members as well." />
</target>
<target name="javadoc" depends="javadoc-public,javadoc-private" description="Generates all Javadoc API documentation" unless="nodocs" />
<!-- Help -->
<target name="help" description="Print the help of the main targets" depends="-init">
<echo message="XINS ${project.version}" />
<echo message="" />
<echo message="Main targets:" />
<echo message=" clean : Remove all generated files" />
<echo message=" java : Compile all Java source files" />
<echo message=" javadoc : Generate the Javadoc API docs" />
<echo message=" logdoc-html : Generate the Logdoc HTML pages" />
<echo message=" version : Print the XINS version" />
<echo message="* tests : Run all unit tests" />
<echo message="* release : Create a new XINS release" />
<echo />
<echo message="The targets marked with an asterisk (*) need '-lib lib' to be" />
<echo message="passed on the command line." />
<echo />
<echo message="Supported options (can change at any time):" />
<echo message="1) -Dforce=true : Skip -dev suffix check on release" />
<echo message="2) -Dmajor.release=true : Skip version update on release" />
<echo message="3) -Dno-upload=true : Skip uploads except FTP uploads" />
<echo message="4) -Dno-ftp=true : Skip FTP upload actions" />
<echo />
<echo message="To create a release the following requirements apply:" />
<echo message="1) CVS module 'xins-docs' must be checked out in parent directory" />
<echo message=" and should be up-to-date;" />
<echo message="2) CVS module 'xins-examples' must be checked out in parent" />
<echo message=" directory and should be up-to-date;" />
<echo message="3) File .sourceforge.properties must exist in home directory and" />
<echo message=" must contain valid sf.user and sf.password properties." />
<echo message="4) The DOCBOOK_XSLT_HOME environment variable must be set and" />
<echo message=" refer to the directory containing the Docbook XSLT files." />
</target>
</project>