File: build.xml

package info (click to toggle)
libxapool-java 1.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,036 kB
  • ctags: 1,153
  • sloc: java: 9,858; xml: 523; sql: 15; sh: 12; makefile: 11
file content (266 lines) | stat: -rw-r--r-- 9,044 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
<!--
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - The contents of this file are subject to the LGPL Licence
 -
 -  author:      <a href="mailto:xavier.spengler@experlog.com">Xavier Spengler</a>
 -
 - Compilation directive for XAPool
 -
 -->
<project name="XAPOOL" default="dist">
  <description>
    This build file is used to compile and build XAPool.
  </description>

  <target name="init"/>

  <!-- directory definition -->
  <property name="src" 			value="${basedir}/src"/>
  <property name="doc" 			value="${basedir}/doc"/>
  <property name="jdoc" 		value="${basedir}/jdoc"/>
  <property name="bin" 			value="${basedir}/bin"/>
  <property name="ext" 			value="${basedir}/ext"/>
  <property name="examples"     	value="${basedir}/examples"/>
  <property name="test"                 value="${basedir}/test"/>
  <property name="config" 		value="${basedir}/config"/>
  <property name="archive" 		value="${basedir}/archive"/>
  <property name="externals.dir" 	value="${basedir}/externals"/>
  <property name="output" 		value="${basedir}/output"/>
  <property name="tmp" 	                value="${output}/tmp"/>
  <property name="tmp.doc"              value="${output}/tmp/doc"/>
  <property name="build" 		value="${output}/build"/>
  <property name="build.stub"  	        value="${build}/stub"/>
  <property name="dist" 		value="${output}/dist"/>

    <!--User properties file -->
  <property file="${basedir}/build.properties"/>

  <property name="dist.lib"  		value="${dist}/lib"/>
  <property name="dist.doc"  		value="${dist}/doc"/>
  <property name="dist.jdoc"  	        value="${dist}/jdoc"/>
  <property name="dist.etc"  		value="${dist}/etc"/>
  <property name="dist.bin"  		value="${dist}/bin"/>
  <property name="dist.config"          value="${dist}/config"/>
  <property name="dist.examples"        value="${dist}/examples"/>
  <property name="dist.test"            value="${dist}/test"/>
  <property name="build.stub"  	        value="${build}/stub"/>

  <!-- classpath for common jars -->
  <path id="externals.classpath">
    <fileset dir="${externals.dir}">
      <include name="**/*.jar"/>
    </fileset>
    <pathelement location="${build}"/>
  </path>

 <!-- classpath for compiling sun stubs -->
  <path id="sun.classpath">
    <fileset dir="${externals.dir}">
      <include name="**/*.jar"/>
    </fileset>
    <pathelement location="${build}/classes"/>
  </path>

  <!-- compile all compile.** targets -->
  <target name="compile"
    description="--> compile XAPool">
    <antcall target="compile.base"/>
  </target>

  <!-- compile all java classes -->
  <target name="compile.base">
    <mkdir dir="${build}/classes"/>
    <javac
      srcdir="${src}"
      destdir="${build}/classes"
      deprecation="${compiler.deprecation}"
      debug="${compiler.debug}"
      nowarn="${compiler.nowarn}"
      optimize="${compiler.optimize}">
      <classpath refid="externals.classpath"/>
      <include name="**/*.java"/>
    </javac>
  </target>


  <!-- create XAPool distribution -->
  <target name="dist" depends="init, compile"
    description="--> create a distribution of XAPool">
    <mkdir dir="${dist}"/>
    <copy file="${basedir}/README.txt" todir="${dist}"/>
    <!--<antcall target="bin"/>-->
    <antcall target="config"/>
    <antcall target="doc"/>
    <antcall target="examples"/>
    <antcall target="test"/>
    <antcall target="jar"/>
    <antcall target="jdoc"/>
  </target>

  <!-- populate distribution bin directory with required archives -->
  <target name="bin" depends="init">
      <mkdir dir="${dist.bin}"/>
    <copy todir="${dist.bin}">
      <fileset dir="${bin}"/>
    </copy>
  </target>

  <!-- populate distribution config directory with required archives -->
    <target name="config" depends="init">
    <mkdir dir="${dist.config}"/>
    <copy todir="${dist.config}">
      <fileset dir="${ext}"/>
    </copy>
  </target>

  <!-- this target compiles LaTeX documentation to PDF and HTMLfiles and put
       them in the distribution doc directory . -->
  <target name="doc" depends="init">
  	<copy todir="${dist.doc}">
  		<fileset dir="${doc}">
  			<include name="*.html" />
  			<include name="*.css" />
  		</fileset> 		
  	</copy>
    <antcall target="doc2pdf">
      <param name="LaTeX.doc.name" value="install" />
    </antcall>
    <antcall target="doc2html">
      <param name="LaTeX.doc.name" value="install" />
    </antcall>
    <antcall target="doc2pdf">
      <param name="LaTeX.doc.name" value="examples" />
    </antcall>
    <antcall target="doc2html">
      <param name="LaTeX.doc.name" value="examples" />
    </antcall>
  </target>

  <!-- This target is executed only if the property pdflatex is
  set by the user on the command line (by -Dpdflatex=1).
  That means it's up to the user to have required tools for
  this target (pdflatex command)
  -->
  <target name="doc2pdf" depends="init"  if="pdflatex">
    <mkdir dir="${tmp.doc}" />
    <copy file="${doc}/${LaTeX.doc.name}.tex" todir="${tmp.doc}" />
    <!-- the command pdflatex is executed 3 times
         due to cross-references resolution -->
    <exec dir="${tmp.doc}" executable="pdflatex">
      <arg line="${LaTeX.doc.name}"/>
    </exec>
    <exec dir="${tmp.doc}" executable="pdflatex">
      <arg line="${LaTeX.doc.name}"/>
    </exec>
    <exec dir="${tmp.doc}" executable="pdflatex">
      <arg line="${LaTeX.doc.name}"/>
    </exec>
    <copy file="${tmp.doc}/${LaTeX.doc.name}.pdf" todir="${dist.doc}" />
    <delete dir="${tmp.doc}" />
  </target>


  <!-- This target is executed only if the property latex2html is
  set by the user on the command line (by -Dlatex2html=1).
  That means it's up to the user to have required tools for
  this target (latex2html command).
  Note also that doc2html is a shell script and will work only
  on Linux systems
  -->
  <target name="doc2html" depends="init" if="latex2html">
    <exec dir="${doc}" os="Linux" executable="${doc}/doc2html">
      <arg line="${LaTeX.doc.name}.tex"/>
    </exec>
  </target>

  <!-- populate distribution example directory with required archives -->
  <target name="examples" depends="init">
    <copy todir="${dist.examples}">
        <fileset dir="${examples}"/>
    </copy>
  </target>

  <!-- populate distribution test directory with required archives -->
  <target name="test" depends="init">
    <copy todir="${dist.test}">
	<fileset dir="${test}"/>
    </copy>
  </target>



  <!-- populate distribution lib directory with required archives -->
  <target name="jar" depends="init">
    <mkdir dir="${dist.lib}"/>
    <copy todir="${dist.lib}" >
      <fileset dir="${externals.dir}" >
	<include name="*.jar"/>
      </fileset>
    </copy>
    <ant antfile="${archive}/xapool_jar.xml" dir="${basedir}"/>
  </target>


  <!-- create javadoc  documentation -->
  <target name="jdoc" depends="init"
    description="--> generate Javadoc">
    <mkdir dir="${dist.jdoc}"/>
    <javadoc
      packagenames="org.enhydra.*"
      destdir="${dist.jdoc}"
      windowtitle="XAPool Developer Documentation"
      author="true" version="true" use="true" >
      <doctitle><![CDATA[<h1>XAPool Developer Documentation</h1>]]></doctitle>
      <sourcepath>
        <pathelement path="${src}"/>
      </sourcepath>
      <classpath refid="externals.classpath"/>
    </javadoc>
  </target>

  <!-- clean all directory and files created by various targets -->
  <target name="clean" depends="init"
    description="--> delete generated files">
    <delete dir="${output}" />
    <delete file="${jts.jar}" />
  </target>

 <target name="packages" depends="clean"
    if="version"
    description="--> create two packages (source and binaries) (version is specified by -Dversion=x.y.z)">
    <antcall target="package.src"/>
    <antcall target="package.jar"/>
  </target>

  <target name="package.jar" depends="dist" if="version">
    <delete dir="${tmp}/xapool-${version}" />
    <mkdir dir="${tmp}" />
    <copy todir="${tmp}/xapool-${version}" includeEmptyDirs="no">
      <fileset dir="${dist}" />
    </copy>
    <tar tarfile="${tmp}/xapool-${version}.tar"
      longfile="gnu"
      basedir="${tmp}/"
      includes="xapool-${version}/**" />
    <gzip zipfile="${output}/xapool-${version}.tgz" src="${tmp}/xapool-${version}.tar" />
    <delete file="${tmp}/xapool-${version}.tar" />
    <delete dir="${tmp}/xapool-${version}" />
  </target>

  <target name="package.src" depends="clean" if="version">
    <delete dir="${tmp}/xapool-${version}" />
    <mkdir dir="${tmp}" />
    <copy todir="${tmp}/xapool-${version}" includeEmptyDirs="no">
      <fileset dir="${basedir}">
      	<exclude name="eclipse-bin/**" />
      </fileset>
    </copy>
    <tar tarfile="${tmp}/xapool-${version}-src.tar"
      longfile="gnu"
      basedir="${tmp}/"
      includes="xapool-${version}/**" />
    <gzip zipfile="${output}/xapool-${version}-src.tgz" src="${tmp}/xapool-${version}-src.tar" />
    <delete file="${tmp}/xapool-${version}-src.tar" />
    <delete dir="${tmp.dir}" />
  </target>
 </project>