File: build.xml

package info (click to toggle)
libjdom0-java 0.9b-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,148 kB
  • ctags: 3,104
  • sloc: java: 9,604; xml: 595; makefile: 49; sh: 33; perl: 31
file content (269 lines) | stat: -rw-r--r-- 11,087 bytes parent folder | download | duplicates (2)
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
<!-- $Id: build.xml,v 1.44 2003/04/10 08:36:05 jhunter Exp $ -->

<!-- 
For instructions on how to build JDOM, please view the README.txt file.
-->

<project default="package" basedir=".">

  <!-- =================================================================== -->
  <!-- Initialization target                                               -->
  <!-- =================================================================== -->
  <target name="init">
    <tstamp/>
    <property name="Name" value="JDOM"/>
    <property name="name" value="jdom"/>
    <property name="version" value="1.0beta9"/>
    <property name="version.impl" value="${version}"/>
    <property name="version.spec" value="0.9"/>
    <property name="year" value="2003"/>

    <echo message="----------- ${Name} ${version} ------------"/>

    <property name="build.compiler" value="classic"/>
    <property name="debug" value="on"/>
    <property name="optimize" value="on"/>
    <property name="deprecation" value="on"/>

    <property name="src.dir" value="./src/java"/>
    <property name="samples.dir" value="./samples"/>
    <property name="samples.dest" value="./build/samples"/>
    <property name="lib.dir" value="./lib"/>
    <property name="packages" value="org.jdom.*"/>

    <property name="build.dir" value="./build"/>
    <property name="build.src" value="./build/src"/>
    <property name="build.dest" value="./build/classes"/>
    <property name="build.javadocs" value="./build/apidocs"/>

    <property name="dist.root" value="./dist"/>
    <property name="dist.dir" value="${dist.root}/${name}-${version}"/>

    <property name="package.dir" value="./package"/>

    <filter token="year" value="${year}"/>
    <filter token="version" value="${version}"/>
    <filter token="date" value="${TODAY}"/>
    <filter token="log" value="true"/>
    <filter token="verbose" value="true"/>

    <!-- Default JAR libraries -->
    <property name="xml-apis.jar"       value="${lib.dir}/xml-apis.jar"/>
    <property name="parser.jar"         value="${lib.dir}/xerces.jar"/>
    <property name="jdom-core"          value="${build.dest}"/>
    <property name="jaxen-jdom.jar"     value="${lib.dir}/jaxen-jdom.jar"/>
    <property name="jaxen-core.jar"     value="${lib.dir}/jaxen-core.jar"/>
    <property name="jaxen-saxpath.jar"  value="${lib.dir}/saxpath.jar"/>

    <!-- Compilation class path -->
    <path id="compile.class.path">
      <pathelement location="${xml-apis.jar}"/>
      <pathelement location="${parser.jar}"/>
      <pathelement location="${jaxen-jdom.jar}"/>
      <pathelement location="${jaxen-core.jar}"/>
      <pathelement location="${jaxen-saxpath.jar}"/>

      <!-- We used to include the CLASSPATH environment variable in 
           compilation path as it might contain the path to the JDK 1.1 
           collections.  That's not needed anymore.  We'll keep it here
           in case there's a future need to include the CLASSPATH.
      <pathelement path="${java.class.path}" />
       -->
    </path>

    <path id="run.class.path">
      <path refid="compile.class.path"/>
      <pathelement location="${jdom-core}"/>
    </path>

  </target>

  <!-- =================================================================== -->
  <!-- Help on usage                                                       -->
  <!-- =================================================================== -->
  <target name="usage">
    <echo message=""/>
    <echo message=""/>
    <echo message="JDOM Build file"/>
    <echo message="-------------------------------------------------------------"/>
    <echo message=""/>
    <echo message=" available targets are:"/>
    <echo message=""/>
    <echo message="   package  --> generates the jdom.jar file (default)"/>
    <echo message="   compile  --> compiles the source code"/>
    <echo message="   javadoc  --> generates the API documentation"/>
    <echo message="   clean    --> cleans up the directory"/>
    <echo message=""/>
    <echo message=" See the comments inside the build.xml file for more details."/>
    <echo message="-------------------------------------------------------------"/>
    <echo message=""/>
    <echo message=""/>
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the build directory                                        -->
  <!-- =================================================================== -->
  <target name="prepare" depends="init">
    <mkdir dir="${build.dir}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the source code                                            -->
  <!-- =================================================================== -->
  <target name="prepare-src" depends="prepare">
    <!-- create directories -->
    <mkdir dir="${build.src}"/>
    <mkdir dir="${build.dest}"/>

    <!-- copy src files -->
    <copy todir="${build.src}"
          filtering="yes">
      <fileset dir="${src.dir}"/>
    </copy>
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the example code                                           -->
  <!-- =================================================================== -->
  <target name="prepare-samples" depends="prepare">
    <!-- create directories -->
    <mkdir dir="${samples.dest}"/>

    <!-- copy src files -->
    <copy todir="${samples.dest}"
          filtering="yes">
          <fileset dir="${samples.dir}"/>
    </copy>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the source directory                                       -->
  <!-- =================================================================== -->
  <target name="compile" depends="prepare-src"
          description="Compiles the source code">
    <!-- Compile the JaxenXPath adapter only if Jaxen classes are found -->
    <available property="jaxen.present"
               classname="org.jaxen.JaxenException"
               classpathref="compile.class.path"/>

    <javac srcdir="${build.src}"
           destdir="${build.dest}"
           debug="${debug}"
           optimize="${optimize}">

      <exclude name="**/Jaxen*" unless="jaxen.present"/>

      <classpath refid="compile.class.path"/>
    </javac>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the "About" code unless JDK1.1 is being used               -->
  <!-- =================================================================== -->
  <target name="about" unless="coll.present"
          description="Compiles the About code unless JDK 1.1 is being used">
    <javac srcdir="${package.dir}"
           destdir="${build.dest}"
           debug="${debug}"
           optimize="${optimize}">
      <classpath refid="compile.class.path"/>
    </javac>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the samples directory                                      -->
  <!-- =================================================================== -->
  <target name="samples" depends="prepare-samples,package"
          description="Compiles the samples directory">
    <javac srcdir="${samples.dest}"
           destdir="${samples.dest}"
           debug="${debug}"
           optimize="${optimize}">
      <classpath refid="run.class.path"/>
    </javac>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the class package                                           -->
  <!-- =================================================================== -->
  <target name="package" depends="compile,about"
          description="Creates the class package">
    <fixcrlf srcdir="." includes="**/*.bat" excludes="build*.*" eol="crlf"/>
    <fixcrlf srcdir="." includes="**/*.sh" excludes="build*.*" eol="lf"/>

    <!-- Filters defined specifically for updating the manifest -->
    <filter token="version.spec" value="${version.spec}"/>
    <filter token="version.impl" value="${version.impl}"/>
    <copy todir="${build.dest}/META-INF"
          filtering="yes">
          <fileset dir="${package.dir}/META-INF"/>
    </copy>
    <jar jarfile="${build.dir}/${name}.jar"
         basedir="${build.dest}"
         excludes="META-INF/MANIFEST.MF"
         manifest="${build.dest}/META-INF/MANIFEST.MF"/>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the API documentation                                       -->
  <!-- =================================================================== -->
  <target name="javadoc" depends="prepare-src"
          description="Creates the API documentation">
    <mkdir dir="${build.javadocs}"/>
    <javadoc packagenames="${packages}"
             sourcepath="${build.src}"
             destdir="${build.javadocs}"
             author="true"
             version="true"
             use="true"
             splitindex="true"
             noindex="false"
             windowtitle="${Name} API"
             doctitle="${Name}"
             bottom="Copyright &#169; ${year} Jason Hunter, Brett McLaughlin. All Rights Reserved.">
      <classpath refid="run.class.path"/>
    </javadoc>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the API documentation, with links to JDK 1.4 classes        -->
  <!-- We can use linkoffline with a newer Ant and avoid this target       -->
  <!-- =================================================================== -->
  <target name="javadoc-link" depends="prepare-src"
          description="Creates the API documentation with links to JDK 1.4 classes">
    <mkdir dir="${build.javadocs}"/>
    <javadoc packagenames="${packages}"
             sourcepath="${build.src}"
             destdir="${build.javadocs}"
             author="true"
             version="true"
             use="true"
             splitindex="true"
             noindex="false"
             windowtitle="${Name} API"
             doctitle="${Name}"
             link="http://java.sun.com/j2se/1.4/docs/api"
             bottom="Copyright &#169; ${year} Jason Hunter, Brett McLaughlin. All Rights Reserved.">
      <classpath refid="run.class.path"/>
    </javadoc>
  </target>

  <!-- =================================================================== -->
  <!-- Clean targets                                                       -->
  <!-- =================================================================== -->
  <target name="clean" depends="init"
          description="Removes build files">
    <delete dir="${build.dir}"/>
  </target>

  <target name="distclean" depends="clean"
          description="Removes the dist files">
    <delete dir="${dist.root}"/>
    <delete file="${Name}-${version}.tar.gz"/>
    <delete file="${Name}-${version}.tar"/>
    <delete file="${Name}-${version}.zip"/>
  </target>

</project>

<!-- End of file -->