File: build.xml

package info (click to toggle)
xml-soap 2.2-6
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 2,492 kB
  • ctags: 1,934
  • sloc: java: 15,895; xml: 740; jsp: 580; cpp: 561; sh: 235; makefile: 127
file content (410 lines) | stat: -rw-r--r-- 16,271 bytes parent folder | download
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
<?xml version="1.0"?>

<!-- ===================================================================

   Build file for Soap

Notes:
   This is a build file for use with the Jakarta Ant build tool.

Prerequisites:

   jakarta-ant from http://jakarta.apache.org
   Any JAXP-compliant XML parser
     (xml-xerces from http://xml.apache.org works just fine)
   JavaMail from http://java.sun.com/products/javamail/
   Java Activation Framework
       from http://java.sun.com/products/beans/glasgow/jaf.html

Optional additions:

   http://www.alphaworks.ibm.com/tech/xmitoolkit
   http://oss.software.ibm.com/developerworks/opensource/pop3/index.html
   http://oss.software.ibm.com/developerworks/opensource/smtp/index.html
   http://java.sun.com/products/jsse/
   JUnit Test Framework from http://www.junit.org
   
Build Instructions:
   To build, run

     java org.apache.tools.ant.Main <target>

   on the directory where this file is located with the target you want.

Most useful targets:

 - compile  -> creates the "soap.jar" package in "./build/lib"
 - javadocs -> creates the javadocs in "./build/javadocs"
 - dist     -> creates the complete binary distribution
 - srcdist  -> creates the complete src distribution

Authors:
  Sam Ruby <rubys@us.ibm.com>
  Matthew J. Duftler <duftler@us.ibm.com>


Copyright:
  Copyright (c) 2001 Apache Software Foundation.

==================================================================== -->

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

  <!-- Moved out of a target so they can be referenced by peer of
      target (such as path test-classpath).
  -->
  <property name="build.dir" value="./build"/>
  <property name="build.dest" value="./build/classes"/>

  <target name="init">
    <property name="name" value="soap"/>
    <property name="Name" value="Soap"/>
    <property name="version" value="2.2"/>
    <property name="year" value="2001"/>

    <property name="build.compiler" value="jikes"/>
    <property name="debug" value="off"/>

    <property name="src.dir" value="./src"/>
    <property name="src.comprovider" value="${src.dir}\org\apache\soap\providers\com" />
    <property name="docs.dir" value="./docs"/>
    <property name="samples.dir" value="./samples"/>

    <property name="packages" value="org.*"/>

    <property name="build.file" value="build.xml"/>
    <property name="build.lib" value="./build/lib"/>
    <property name="build.samples" value="./build/samples"/>
    <property name="build.javadocs" value="./build/apidoc"/>

    <property name="webapps" value="./webapps"/>

    <property name="dist.dir.name" value="soap-2_2"/>
    <property name="dist.dir" value="./${dist.dir.name}"/>
    <property name="dist.bin.file" value="${name}-bin-${version}"/>
    <property name="dist.src.file" value="${name}-src-${version}"/>

    <available property="com.present" file="${src.comprovider}\org_apache_soap_providers_com_RPCProvider.h" />
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the build directory                                        -->
  <!-- =================================================================== -->
  <target name="prepare" depends="init">
    <mkdir dir="${build.dir}"/>
    <available property="bsf.present" classname="com.ibm.bsf.BSFManager" />
    <available property="xmi.present" classname="com.ibm.xmi.job.Job" />
    <available property="pop3.present" 
      classname="com.ibm.network.mail.pop3.event.StatusListener" />
    <available property="smtp.present" 
      classname="com.ibm.network.mail.smtp.protocol.CoreProtocolBean" />
    <available property="ejb.present" classname="javax.ejb.SessionBean" />
    <available property="ssl.present" classname="javax.net.ssl.SSLSocket" />
    <available property="junit.present" classname="junit.framework.TestCase" />


    <uptodate property="javac.notRequired"
              targetfile="${build.lib}/${name}.jar">
      <srcfiles dir="${src.dir}">
        <patternset refid="javac.source.files"/>
      </srcfiles>
    </uptodate>

    <uptodate property="javadoc.required"
              targetfile="${build.lib}/${name}.jar">
      <srcfiles dir="${build.dir}" includes="**/*.html"/>
    </uptodate>

    <antcall target="checkDependencies"/>
  </target>

  <!-- =================================================================== -->
  <!-- Warn the user about items not being compiled                        -->
  <!-- =================================================================== -->
  <target name="checkBSF" unless="bsf.present">
    <echo message="Warning: BSF dependencies were not resolved."/>
  </target>
  <target name="checkXMI" unless="xmi.present">
    <echo message="Warning: XMI dependencies were not resolved."/>
  </target>
  <target name="checkPOP3" unless="pop3.present">
    <echo message="Warning: POP3 dependencies were not resolved."/>
  </target>
  <target name="checkSMTP" unless="smtp.present">
    <echo message="Warning: SMTP dependencies were not resolved."/>
  </target>
  <target name="checkEJB" unless="ejb.present">
    <echo message="Warning: EJB dependencies were not resolved."/>
  </target>
  <target name="checkSSL" unless="ssl.present">
    <echo message="Warning: SSL dependencies were not resolved."/>
  </target>
  <target name="checkDependencies" unless="javac.notRequired">
    <antcall target="checkBSF"/>
    <antcall target="checkXMI"/>
    <antcall target="checkPOP3"/>
    <antcall target="checkSMTP"/>
    <antcall target="checkEJB"/>
    <antcall target="checkSSL"/>
  </target>

  <!-- =================================================================== -->
  <!-- Source files to be compiled                                         -->
  <!-- =================================================================== -->
  <patternset id="javac.source.files">
    <exclude name="**/InvokeBSF.java" unless="bsf.present" />
    <exclude name="**/XMI*.java" unless="xmi.present" />
    <exclude name="**/*SMTP*.java" unless="smtp.present" />
    <exclude name="**/*SMTP*.java" unless="pop3.present" />
    <exclude name="**/POP*.java" unless="smtp.present" />
    <exclude name="**/POP*.java" unless="pop3.present" />
    <exclude name="**/*EJB*.java" unless="ejb.present" />
    <exclude name="**/SSLUtils.java" unless="ssl.present" />
  </patternset>

  <patternset id="dllfiles">
    <include name="*.dll"/>
  </patternset>

  <!-- =================================================================== -->
  <!-- Compiles the source directory                                       -->
  <!-- =================================================================== -->
  <target name="compile"
          depends="prepare"
          description="Compiles the source files.">
    <mkdir dir="${build.dest}"/>
    <javac srcdir="${src.dir}" destdir="${build.dest}" debug="${debug}">
      <patternset refid="javac.source.files"/>
    </javac>

    <copy todir="${build.dest}">
      <fileset dir="${src.dir}">
         <include name="**/*.properties" />
      </fileset>
    </copy>

    <copy todir="${build.lib}">
      <fileset dir="${src.comprovider}">
        <patternset refid="dllfiles"/>
      </fileset>
    </copy>

    <mkdir dir="${build.lib}"/>
    <jar jarfile="${build.lib}/${name}.jar" basedir="${build.dest}" />

    <uptodate property="javadoc.required"
              targetfile="${build.lib}/${name}.jar">
      <srcfiles dir="${build.dir}" includes="**/*.html"/>
    </uptodate>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the samples                                                -->
  <!-- =================================================================== -->
  <target name="samples"
          depends="compile"
          description="Compiles the samples.">
    <javac srcdir="." destdir="${build.dir}" 
           classpath="${build.lib}/${name}.jar" debug="${debug}">
      <include name="samples/**/*.java" />
      <exclude name="samples/**/*SMTP*.java" unless="smtp.present" />
    </javac>
    <copy todir="${build.samples}">
      <fileset dir="${samples.dir}"/>
    </copy>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the JUnit testcases                                        -->
  <!-- =================================================================== -->

  <path id="test-classpath">
    <!-- build.dir for test classes and build.dest for classes to test -->
    <pathelement location="${build.dir}" />
    <pathelement location="${build.dest}" />
    <pathelement path="${java.class.path}" />
  </path>

  <target name="buildTest" if="junit.present"
        depends="init, prepare, compile">
    <echo message="junit package found ..."/>

    <!-- Tests are packaged as test.*, so source dir is main dir -->
    <javac srcdir="${basedir}"
      destdir="${build.dir}">
      <include name="test/**/*.java" />
      <classpath refid="test-classpath" />
    </javac>
  </target>


  <!-- =================================================================== -->
  <!-- Runs the JUnit testcases                                            -->
  <!-- =================================================================== -->
  <target name="junit" if="junit.present"
          depends="buildTest">
    <junit printsummary="yes" haltonfailure="yes" fork="yes">
      <classpath refid="test-classpath" />
      <formatter type="plain" />
      <batchtest>
        <fileset dir="${build.dir}">
          <!-- Convention: each package that's being tested
                has its own test class collecting all the tests -->
          <include name="**/PackageTests.class" />
        </fileset>
      </batchtest>
    </junit>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the MS COM Pluggable Provider CPP code requires MS VS 6.0  -->
  <!-- =================================================================== -->

  <target name="com"  depends="compile">
    <exec dir="${src.comprovider}" executable="nmake" failonerror="Yes">
    <arg line= "/NOLOGO ANTBUILD=1 ANTBUILDDEBUG=right${debug} ANTBUILDTARGET=${basedir}\${build.lib} ANTBUILDCLASSPATH=${basedir}\${build.dest}"/>
    </exec>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the API documentation                                       -->
  <!-- =================================================================== -->
  <target name="javadocs"
          depends="prepare"
          description="Generates the API documentation.">
    <mkdir dir="${build.javadocs}"/>
    <javadoc packagenames="${packages}"
             sourcepath="${src.dir}"
             destdir="${build.javadocs}"
             author="true"
             version="true"
             use="true"
             windowtitle="${Name} API"
             doctitle="${Name}"
             bottom="Copyright &#169; ${year} Apache XML Project. All Rights Reserved."
    />
  </target>

  <!-- =================================================================== -->
  <!-- Creates the API documentation if necessary                          -->
  <!-- =================================================================== -->
  <target name="javadocsIfRequired" if="javadoc.required" depends="prepare">
    <antcall target="javadocs"/>
  </target>
  
  <!-- =================================================================== -->
  <!-- Creates the binary distribution                                     -->
  <!-- =================================================================== -->
  <target name="dist"
          depends="compile, junit, javadocsIfRequired, samples"
          description="Creates the binary distribution.">
    <mkdir dir="${dist.dir}"/>
    <mkdir dir="${dist.dir}/docs"/>
    <mkdir dir="${dist.dir}/docs/apiDocs"/>
    <mkdir dir="${dist.dir}/lib"/>
    <mkdir dir="${dist.dir}/samples"/>
    <mkdir dir="${dist.dir}/webapps"/>

    <copy todir="${dist.dir}/docs/apiDocs">
      <fileset dir="${build.javadocs}"/>
    </copy>
    <copy todir="${dist.dir}/lib">
      <fileset dir="${build.lib}"/>
    </copy>
    <copy todir="${dist.dir}/samples">
      <fileset dir="${build.samples}"/>
    </copy>
    <copy todir="${dist.dir}/docs">
      <fileset dir="${docs.dir}"/>
    </copy>
    <copy todir="${dist.dir}/webapps">
      <fileset dir="${webapps}"/>
    </copy>

    <antcall target="buildwar"/>

    <copy file="LICENSE" tofile="${dist.dir}/LICENSE"/>
    <copy file="README" tofile="${dist.dir}/README"/>

    <!-- ================================================================= -->
    <!-- Produces the tar/gzip file                                        -->
    <!-- ================================================================= -->
    <tar tarfile="${dist.bin.file}.tar"
         basedir="."
         includes="${dist.dir.name}/**"/>
    <gzip src="${dist.bin.file}.tar" zipfile="${dist.bin.file}.tar.gz"/>
    <delete file="${dist.bin.file}.tar"/>

    <!-- ================================================================= -->
    <!-- Produces the zip file                                             -->
    <!-- ================================================================= -->
    <zip zipfile="${dist.bin.file}.zip"
         basedir="."
         includes="${dist.dir.name}/**"/>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the source distribution                                     -->
  <!-- =================================================================== -->
  <target name="srcdist"
          depends="init"
          description="Creates the source distribution.">
    <copy todir="${dist.dir}/src">
      <fileset dir="${src.dir}"/>
    </copy>

    <copy file="LICENSE" tofile="${dist.dir}/LICENSE"/>
    <copy file="${build.file}" tofile="${dist.dir}/${build.file}"/>

    <!-- ================================================================= -->
    <!-- Produces the tar/gzip file                                        -->
    <!-- ================================================================= -->
    <tar tarfile="${dist.src.file}.tar"
         basedir="."
         includes="${dist.dir.name}/**"/>
    <gzip src="${dist.src.file}.tar" zipfile="${dist.src.file}.tar.gz"/>
    <delete file="${dist.src.file}.tar"/>

    <!-- ================================================================= -->
    <!-- Produces the zip file                                             -->
    <!-- ================================================================= -->
    <zip zipfile="${dist.src.file}.zip"
         basedir="."
         includes="${dist.dir.name}/**"/>
  </target>

  <!-- =================================================================== -->
  <!-- Packages the Web Application as a Web ARchive.                      -->
  <!-- =================================================================== -->
  <target name="buildwar" depends="compile, samples">
    <mkdir dir="${dist.dir}/webapps"/>

    <war warfile="${dist.dir}/webapps/${name}.war"
         webxml="${webapps}/soap/WEB-INF/web.xml">
      <fileset dir="${webapps}/soap">
        <include name="*.html"/>
        <include name="admin/*.*"/>
      </fileset>
      <classes dir="${build.dest}"/>
      <classes dir="${build.dir}">
        <include name="samples/**/*.class"/>
      </classes>
    </war>
  </target>

  <!-- =================================================================== -->
  <!-- Cleans everything                                                   -->
  <!-- =================================================================== -->
  <target name="clean"
          depends="init,clean.java,clean.com"
          description="Cleans the build and distribution directories."/>
  <target name="clean.java" depends="init">
    <delete dir="${build.dir}"/>
    <delete dir="${dist.dir}"/>
  </target>
  <target name="clean.com" depends="init" if="com.present">
    <exec dir="${src.comprovider}" executable="nmake" failonerror="Yes">
    <arg line= " /NOLOGO ANTBUILD=1 ANTBUILDTARGET=${basedir}\${build.lib} ANTBUILDCLASSPATH=${basedir}\${build.dest} clean"/>
    </exec>
  </target>
</project>