Project

Profile

Help

How to connect?
Download (20.5 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.5 / build / build.xml @ 6717e3bc

1
<?xml version="1.0" encoding="UTF-8"?>
2

    
3
<project basedir="." default="all" name="Saxon: The XSLT and XQuery Processor"
4
         xmlns:dn="antlib:org.apache.ant.dotnet">
5
    
6
    
7
    <!-- note : Ant 1.7 is needed for this script -->
8
    
9
    <!-- Ant 1.7 introduces a <service> element to allow META-INF/services
10
         directories to be created in JAR files. Unfortunately it is broken,
11
         see http://issues.apache.org/bugzilla/show_bug.cgi?id=41201. The relevant
12
         code here is retained in the form of comments, and can be reinstated
13
         when the bug is fixed. Meanwhile the directories are created manually -->
14
    
15
    <!-- Build file for Saxon. This builds all six for the released products:
16
         Saxon-HE, -PE, and -EE, on both the Java and .NET platforms. It also builds
17
         the released resources file. A full build requires access to Saxonica
18
         proprietary source code. The open source Saxon-HE product can be built for
19
         Java using target "hej"; but building Saxon-HE for .NET may require some
20
         disentangling of tasks that depend on Saxon-EE code being present. -->
21
         
22
    <!-- Useful targets:
23
    
24
         prepare      clears temporary directories, generates fixed files
25
         j            builds executables for Saxon on Java
26
         n            builds executables for Saxon on .NET
27
         build        builds all executables
28
         resources    builds samples and documentation
29
         release      builds ZIP files for published downloads, runs regression tests
30
         archive      produces a back-up archive  -->
31
             
32
         
33
    <!-- Naming conventions:
34
         -n   : .NET
35
         -j   : Java
36
         -he  : Home Edition
37
         -pe  : Professional Edition
38
         -ee  : Enterprise Edition
39
         combined as appropriate, so -pej denotes Saxon-PE on the Java platform
40
    -->
41
    
42
    <import file="build-constants.xml"/>
43
    
44
    <!-- If building for only one platform, 
45
       (a) remove one of the imports below
46
       (b) remove dependencies on targets in that build file, which are always suffixed -j or -n respectively 
47
    -->
48
       
49
    <import file="build-j.xml"/>
50
    <import file="build-n.xml"/>     
51
    <import file="test-j.xml"/>
52
    <import file="test-n.xml"/>   
53

    
54
    <path id="saxonee.class.path">
55
      <pathelement location="${product.dir}/eej/saxon9ee.jar"/>
56
    </path>
57
    
58

    
59
    
60
    <target name="clean" description="Clean all files other than source code and downloaded jars.">
61
        <delete dir="${temp.dir}"/>
62
        <delete dir="${product.dir}"/>
63
        <mkdir dir="${product.dir}"/>
64
    </target>
65
    
66
    <target name="prepare" description="Create 'fixed' files in build libraries"
67
      depends="clean, prepare-n, prepare-j"/>
68
             
69
    
70
    <target name="samples-common" description="Assemble Cross-Platform Samples and Use-Cases">
71
            <mkdir dir="${build-resources.dir}/samples"/>
72
      <copy todir="${product.dir}/resources/use-cases">
73
        <fileset dir="${usecases.dir}"/>
74
      </copy>
75
      <copy todir="${product.dir}/resources/samples">
76
        <fileset dir="${samples.dir}">
77
          <!-- stuff tends to gather in samples, so only select what's needed to be issued -->
78
          <include name="config/config.xml"/>
79
          <include name="config/config-HE.xml"/>
80
          <include name="config/config.xsd"/>
81
          <include name="config/saxon-attributes.xsd"/>
82
          <include name="data/books.xml"/>
83
          <include name="data/othello.xml"/>
84
          <include name="data/books.xsd"/>
85
          <include name="data/books.dtd"/>
86
          <include name="data/play.dtd"/>
87
          <include name="query/tour.xq"/>
88
          <include name="query/books.xq"/>
89
          <include name="query/books-to-html.xq"/>
90
          <include name="scm/scmschema.*"/>
91
          <include name="styles/books.xsl"/>
92
          <include name="styles/books.txt"/>
93
          <include name="styles/play.xsl"/>
94
          <include name="styles/identity.xsl"/>
95
          <include name="styles/books-csv.xsl"/>
96
          <include name="styles/books-sa.xsl"/>
97
          <include name="styles/books-sql.xsl"/>
98
          <include name="styles/tour.xsl"/>
99
          <include name="styles/summarize.xsl"/>
100
          <include name="trax/xml/**/*.xml"/>
101
          <include name="trax/xsl/**/*.xsl"/>
102
          <include name="trax/xsl/**/preamble.txt"/>
103
          <include name="trax/xsl/**/postamble.txt"/>
104
        </fileset>
105
      </copy>
106
    </target>
107
    
108
    <!-- The Saxonica build creates a cross-platform samples directory, but it's separated
109
         by platform in case a platform-specific build is needed -->
110
    
111
    
112
    <target name="samples" depends="samples-j"/> <!-- samples-n -->
113
    
114
 
115
  
116
  <target name="userdoc-html" description="Creates the static HTML version of the user documentation">
117
    <mkdir dir="${temp.dir}/tempdoc"/>
118
    
119
    <!-- Preprocess the changes.xml file to turn it into a standard article -->
120
    
121
    <xslt 
122
      in="${userdoc.dir}/viewer_app/doc/changes.xml" out="${userdoc.dir}/viewer_app/doc/changes-article.xml"
123
      style="${userdoc.dir}/to-static/c-changes.xsl">
124
      <classpath refid="saxonee.class.path"/>
125
      <factory name="com.saxonica.config.EnterpriseTransformerFactory"/>
126
    </xslt>
127
    
128
    <!-- Preprocess the functions.xml file to turn it into a standard article -->
129
    
130
    <xslt
131
      in="${userdoc.dir}/viewer_app/doc/functions.xml" out="${userdoc.dir}/viewer_app/doc/functions-article.xml"
132
      style="${userdoc.dir}/to-static/c-functions.xsl">
133
      <classpath refid="saxonee.class.path"/>
134
      <factory name="com.saxonica.config.EnterpriseTransformerFactory"/>
135
    </xslt>
136
    
137
    <!-- Now process all the articles -->
138
 
139
    <xslt 
140
      in="${userdoc.dir}/viewer_app/doc/catalog.xml" out="${userdoc.dir}/out/dummy.xml"
141
      style="${userdoc.dir}/to-static/s-cetree.xsl">
142
      <classpath refid="saxonee.class.path"/>
143
      <factory name="com.saxonica.config.EnterpriseTransformerFactory"/>
144
      <param name="changes-article" expression="../viewer_app/doc/changes-article.xml"/>
145
      <param name="functions-article" expression="../viewer_app/doc/functions-article.xml"/>
146
    </xslt>
147
    
148
    <!-- remove empty output file -->
149
    <delete file="${userdoc.dir}/out/dummy.xml"/>
150
    <delete file="${userdoc.dir}/doc/changes-article.xml"/>
151
    <delete file="${userdoc.dir}/doc/functions-article.xml"/>
152
  </target>
153
   
154
    
155
    <target name="release-userdoc" description="Generate User Documentation" depends="userdoc-html">
156
          <copy todir="${build-resources.dir}/doc">
157
        <fileset dir="${userdoc.dir}/fixed"/>
158
      </copy>
159
      <copy todir="${build-resources.dir}/doc">
160
        <fileset dir="${userdoc.dir}/style">
161
            <include name="make-menu.xsl"/>
162
        </fileset>
163
      </copy> 
164
          <copy todir="${product.dir}/hej">
165
        <fileset dir="${userdoc.dir}/welcome">
166
          <include name="doc/**"/>
167
          <include name="notices/CERN.txt"/>
168
          <include name="notices/JAMESCLARK.txt"/>
169
          <include name="notices/LICENSE.txt"/>
170
          <include name="notices/THAI.txt"/>
171
          <include name="notices/UNICODE.txt"/>
172
        </fileset>
173
      </copy>
174
      <copy todir="${product.dir}/pej">
175
        <fileset dir="${userdoc.dir}/welcome">
176
          <include name="doc/**"/>
177
          <include name="notices/CERN.txt"/>
178
          <include name="notices/JAMESCLARK.txt"/>
179
          <include name="notices/LICENSE.txt"/>
180
          <include name="notices/THAI.txt"/>
181
          <include name="notices/UNICODE.txt"/>
182
        </fileset>
183
      </copy>
184
      <copy todir="${product.dir}/eej">
185
        <fileset dir="${userdoc.dir}/welcome">
186
          <include name="doc/**"/>
187
          <include name="notices/ASM.txt"/>
188
          <include name="notices/CERN.txt"/>
189
          <include name="notices/JAMESCLARK.txt"/>
190
          <include name="notices/LICENSE.txt"/>
191
          <include name="notices/THAI.txt"/>
192
          <include name="notices/UNICODE.txt"/>
193
        </fileset>
194
      </copy>
195
      <copy todir="${product.dir}/hen">
196
        <fileset dir="${userdoc.dir}/welcome">
197
          <include name="doc/**"/>
198
          <include name="notices/CERN.txt"/>
199
          <include name="notices/JAMESCLARK.txt"/>
200
          <include name="notices/LICENSE.txt"/>
201
          <include name="notices/THAI.txt"/>
202
          <include name="notices/UNICODE.txt"/>
203
          <include name="notices/APACHE-XERCES.txt"/>
204
          <include name="notices/APACHE-RESOLVER.txt"/>
205
          <include name="notices/FRIJTERS.txt"/>
206
          <include name="notices/GPL+CLASSPATH.txt"/>
207
        </fileset>
208
      </copy>
209
      <copy todir="${product.dir}/pen">
210
        <fileset dir="${userdoc.dir}/welcome">
211
          <include name="doc/**"/>
212
          <include name="notices/CERN.txt"/>
213
          <include name="notices/JAMESCLARK.txt"/>
214
          <include name="notices/LICENSE.txt"/>
215
          <include name="notices/THAI.txt"/>
216
          <include name="notices/UNICODE.txt"/>
217
          <include name="notices/APACHE-XERCES.txt"/>
218
          <include name="notices/APACHE-RESOLVER.txt"/>
219
          <include name="notices/FRIJTERS.txt"/>
220
          <include name="notices/GPL+CLASSPATH.txt"/>
221
        </fileset>
222
      </copy>
223
      <copy todir="${product.dir}/een">
224
        <fileset dir="${userdoc.dir}/welcome">
225
          <include name="doc/**"/>
226
          <include name="notices/ASM.txt"/>
227
          <include name="notices/CERN.txt"/>
228
          <include name="notices/JAMESCLARK.txt"/>
229
          <include name="notices/LICENSE.txt"/>
230
          <include name="notices/THAI.txt"/>
231
          <include name="notices/UNICODE.txt"/>
232
          <include name="notices/APACHE-XERCES.txt"/>
233
          <include name="notices/APACHE-RESOLVER.txt"/>
234
          <include name="notices/FRIJTERS.txt"/>
235
          <include name="notices/GPL+CLASSPATH.txt"/>
236
        </fileset>
237
      </copy>
238
      <!--<dependset>
239
        <! rerun the XSLT transformations if any input files have changed >
240
        <srcfilelist
241
           dir   = "${userdoc.dir}/src/"
242
           files = "*.xml"/>
243
        <srcfilelist
244
           dir   = "${userdoc.dir}/style/"
245
           files = "*.xsl"/>
246
        <targetfileset
247
           dir      = "${product.dir}/resources/doc/"
248
           includes = "dummy.html"/>
249
        <targetfileset
250
           dir      = "${userdoc.dir}/src/"
251
           includes = "functions.xml"/>
252
        <targetfileset
253
           dir      = "${userdoc.dir}/src/"
254
           includes = "index-entries.xml, FeatureKeysDoc.xml"/>
255
    </dependset>  
256
      <xslt in="${userdoc.dir}/src/function-data2.xml"
257
            style="${userdoc.dir}/style/preprocess-functions2.xsl"
258
            out="${userdoc.dir}/src/functions.xml"
259
            >
260
            <factory name="com.saxonica.config.EnterpriseTransformerFactory">
261
                <attribute name="http://saxon.sf.net/feature/timing" value="true"/>
262
                <attribute name="http://saxon.sf.net/feature/xsltSchemaAware" value="true"/>
263
                <attribute name="http://saxon.sf.net/feature/schema-validation-mode" value="strict"/>
264
                <attribute name="http://saxon.sf.net/feature/xsd-version" value="1.1"/>
265
            </factory>
266
      </xslt>
267
      <xslt in="${userdoc.dir}/src/catalog.xml"
268
            style="${userdoc.dir}/style/index-builder.xsl"
269
            out="${userdoc.dir}/src/index-entries.xml"
270
            >
271
            <factory name="com.saxonica.config.EnterpriseTransformerFactory">
272
                <attribute name="http://saxon.sf.net/feature/xsltSchemaAware" value="true"/>
273
                <attribute name="http://saxon.sf.net/feature/schema-validation-mode" value="strict"/>
274
                <attribute name="http://saxon.sf.net/feature/xsd-version" value="1.1"/>
275
            </factory>
276
      </xslt><!-\-classpath=".;../output/saxon-build/9.3.0.6/eej/saxon9ee.jar;../saxon-licenses"-\->
277
      <xslt in="${userdoc.dir}/src/FeatureKeys.xml"
278
            style="${userdoc.dir}/style/FeatureKeysToDoc.xsl"
279
            out="${userdoc.dir}/src/FeatureKeysDoc.xml"
280
            >
281
            <factory name="com.saxonica.config.EnterpriseTransformerFactory">
282
                <attribute name="http://saxon.sf.net/feature/xsltSchemaAware" value="true"/>
283
                <attribute name="http://saxon.sf.net/feature/schema-validation-mode" value="lax"/>
284
                <attribute name="http://saxon.sf.net/feature/xsd-version" value="1.1"/>
285
            </factory>
286
      </xslt>
287
      <xslt in="${userdoc.dir}/src/catalog.xml"
288
            style="${userdoc.dir}/style/page-splitter.xsl"
289
            out="${product.dir}/resources/doc/dummy.html"
290
            >
291
            <factory name="com.saxonica.config.EnterpriseTransformerFactory">
292
                <attribute name="http://saxon.sf.net/feature/xsltSchemaAware" value="true"/>
293
                <attribute name="http://saxon.sf.net/feature/timing" value="true"/>
294
                <attribute name="http://saxon.sf.net/feature/schema-validation-mode" value="lax"/>
295
                <attribute name="http://saxon.sf.net/feature/xsd-version" value="1.1"/>
296
                <attribute name="http://saxon.sf.net/feature/recognize-uri-query-parameters" value="true"/>
297
            </factory>
298
      </xslt>-->
299
 
300
          <zip zipfile="${build-resources.dir}/source-userdoc.zip">
301
                  <fileset dir="${userdoc.dir}/viewer_app" />
302
         </zip>                               
303
    </target>
304
    
305
    <target name="release-source" description="Generate Zip file containing issued Source Code">
306
      <zip zipfile="${product.dir}/saxon${versionh}source.zip">
307
        <fileset dir="${temp.dir}/preprocessed/hej/source">
308
           <include name="net/**/*.java"/>
309
           <include name="net/**/package.html"/>
310
        </fileset>
311
        <fileset dir="${temp-src-nc.dir}">
312
           <include name="api/**/*.cs"/>
313
           <include name="cmd/**/*.cs"/>
314
        </fileset>   
315
      </zip>
316
      <zip zipfile="${repo-priv}/releases/saxonee${versionh}source.zip">
317
        <fileset dir="${source-eej.dir}">
318
           <include name="com/saxonica/**/*.java"/>
319
           <include name="com/saxonica/**/package.html"/>
320
        </fileset>
321
      </zip>
322
    </target>
323
    
324
    <target name="NO-resources" depends="release-source, release-userdoc"/>
325
    
326
    <target name="resources" description="Generate contents of released resources file"
327
              depends="release-userdoc, product-javadoc, product-dotnetdoc,
328
                       samples, samples-j, testdrivers-j,  release-source, release-userdoc-n">  <!-- samples-n, -->
329
      <mkdir dir="${product.dir}/resources/build"/>
330
      <copy todir="${product.dir}/resources/build">
331
        <fileset dir="${basedir}">
332
          <include name="build.xml"/>
333
          <include name="build-n.xml"/>
334
          <include name="build-j.xml"/>
335
          <include name="build-constants.xml"/>
336
          <include name="test-j.xml"/>
337
          <include name="test-n.xml"/>
338
          
339
        </fileset>  
340
      </copy>
341
      <copy todir="${product.dir}/resources">
342
        <fileset dir="${userdoc.dir}/welcome">
343
          <include name="notices/**"/>
344
        </fileset>
345
      </copy>
346
    </target>  
347
      
348
    <target name="build" description="Complete Saxon product build"
349
              depends="j, n"/> 
350
      
351
    <target name="test" description="Run regression tests"
352
        depends="test-j, test-n"/>
353

    
354
    <target name="maintenance-release" description="Create .ZIP files for release"
355
        depends="build, release-j, release-n"
356
        >
357
        <!-- removed "resources" - not used in maintenance releases -->
358
        <!-- TODO add test -->
359

    
360
      <mkdir dir="${issue.dir}"/>
361
      <!-- <zip zipfile="${issue.dir}/saxonhe${versionh}j.zip">
362
        <fileset dir="${product.dir}/hej"/>
363
      </zip>
364
      <zip zipfile="${issue.dir}/saxonhe${versionh}n.zip">
365
        <fileset dir="${product.dir}/hen"/>
366
      </zip>
367
      <zip zipfile="${issue.dir}/saxonpe${versionh}j.zip">
368
        <fileset dir="${product.dir}/pej"/>
369
      </zip>
370
      <zip zipfile="${issue.dir}/saxonpe${versionh}n.zip">
371
        <fileset dir="${product.dir}/pen"/>
372
      </zip>
373
          <zip zipfile="${issue.dir}/saxonee${versionh}j.zip">
374
        <fileset dir="${product.dir}/eej"/>
375
      </zip>
376
      <zip zipfile="${issue.dir}/saxonee${versionh}n.zip">
377
        <fileset dir="${product.dir}/een"/>
378
      </zip>-->
379

    
380
      <!-- <copy file="${product.dir}/saxon${versionh}source.zip" todir="${issue.dir}"/>-->
381
    </target>
382
      
383
    <target name="release" description="Create .ZIP files for release"
384
        depends="build, release-j, release-n, resources"
385
        >
386

    
387
        <!-- removed "resources" - not used in maintenance releases -->
388
        <!-- TODO add test -->
389
        
390
      <mkdir dir="${issue.dir}"/> 
391
      <!-- <zip zipfile="${issue.dir}/saxonhe${versionh}j.zip">
392
        <fileset dir="${product.dir}/hej"/>
393
      </zip>
394
      <zip zipfile="${issue.dir}/saxonhe${versionh}n.zip">
395
        <fileset dir="${product.dir}/hen"/>
396
      </zip>
397
      <zip zipfile="${issue.dir}/saxonpe${versionh}j.zip">
398
        <fileset dir="${product.dir}/pej"/>
399
      </zip>                     
400
      <zip zipfile="${issue.dir}/saxonpe${versionh}n.zip">
401
        <fileset dir="${product.dir}/pen"/>
402
      </zip>
403
          <zip zipfile="${issue.dir}/saxonee${versionh}j.zip">
404
        <fileset dir="${product.dir}/eej"/>
405
      </zip>                     
406
      <zip zipfile="${issue.dir}/saxonee${versionh}n.zip">
407
        <fileset dir="${product.dir}/een"/>
408
      </zip>-->
409
      <zip zipfile="${issue.dir}/saxon-resources${major.versionh}.zip">
410
        <fileset dir="${product.dir}/resources"/>
411
      </zip>
412
      <copy file="${product.dir}/saxon${versionh}source.zip" todir="${issue.dir}"/>
413
    </target>
414
    
415
    <target name="archive" description="Archive everything needed for backup"> 
416
      <mkdir dir="${archive.dir}"/>
417
      <copy file="archive-contents.txt" todir="${archive.dir}"/>
418
      <replace file="${archive.dir}/archive-contents.txt"
419
                 token="N-N-N-N"
420
                 value="${version}"
421
                 summary="yes"/>
422
      <copy todir="${archive.dir}">
423
       <fileset dir="${issue.dir}"/>
424
       <fileset dir="${source-eej.dir}" includes="saxonee${version}source.zip"/>
425
       <fileset dir="${build-resources.dir}" includes="saxon${version}source.zip"/>
426
      </copy>
427
      <zip zipfile="${archive.dir}/testsuite.zip">
428
        <fileset dir="e:/tests">
429
          <include name="testsuite/**"/>
430
          <include name="gold/**"/>
431
        </fileset>
432
      </zip>        
433
      <zip zipfile="${archive.dir}/schematests.zip">
434
        <fileset dir="e:/tests">
435
          <include name="xmlschema2006-11-06/**"/>
436
          <exclude name="xmlschema2006-11-06/msData/**"/>
437
          <exclude name="xmlschema2006-11-06/sunData/**"/>
438
          <exclude name="xmlschema2006-11-06/nistData/**"/>
439
        </fileset>
440
      </zip>
441
      <zip zipfile="${archive.dir}/querytests.zip">
442
        <fileset dir="e:/tests/xqts-extra"/>
443
        <fileset dir="e:/xqts/saxon">
444
          <exclude name="results/**"/>
445
          <exclude name="results.net/**"/>
446
          <exclude name="**/java/**"/>
447
        </fileset>
448
        <fileset dir="e:/xquts/saxon">
449
          <exclude name="results/**"/>
450
          <exclude name="results.net/**"/>
451
        </fileset>
452
      </zip>
453
      <zip zipfile="${archive.dir}/xslttests.zip">
454
        <fileset dir="e:/xslts-extra"/>
455
        <fileset dir="e:/xslt20-test/TestSuiteStagingArea/SaxonResults">
456
          <include name="*.xml"/>
457
          <include name="*.xsl"/>
458
        </fileset>
459
        <fileset dir="e:/xslt20-test/TestSuiteStagingArea/SaxonResults.Net">
460
          <include name="*.xml"/>
461
          <include name="*.xsl"/>
462
        </fileset>
463
      </zip>
464
      <zip zipfile="${archive.dir}/javatests.zip">
465
        <fileset dir="c:/MyJava/testcode"/>
466
      </zip>
467
      <zip zipfile="${archive.dir}/doc.zip">
468
        <fileset dir="c:/MyJava/doc"/>
469
      </zip>
470
      <zip zipfile="${archive.dir}/licensetool.zip">
471
        <fileset dir="c:/MyJava/licensetool"/>
472
      </zip>
473
      <zip zipfile="${archive.dir}/dotnetmake.zip">
474
        <fileset dir="c:/MyDotNet/make"/>
475
      </zip>      
476
      <zip zipfile="${archive.dir}/licenses.zip">
477
        <fileset dir="c:/saxon-licenses">
478
            <exclude name="archived-licenses/**"/>
479
            <exclude name="licenses/**"/>
480
        </fileset>    
481
      </zip>
482
      <zip zipfile="${archive.dir}/build.zip">
483
        <fileset dir="c:/MyJava/build">
484
          <exclude name="c:/MyJava/build/temp/**"/>
485
        </fileset>
486
      </zip>
487
    </target>  
488
      
489
       
490
    
491
</project>
(5-5/7)