Project

Profile

Help

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

he / latest8.9 / build / build.xml @ 6437f63f

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

    
3
<project basedir="." default="all" name="Saxon-B The XSLT and XQuery Processor"
4
         xmlns:dn="antlib:org.apache.ant.dotnet">
5
    
6
    <!--TODO: 1: ensure saxon8api.netmodule is included in the build
7
           2: remove the archive target before shipping this file-->
8
    
9
    <!-- note : Ant 1.7 is needed for this script -->
10
    
11
    <!-- Ant 1,7 introduces a <service> element to allow META-INF/services
12
         directories to be created in JAR files. Unfortunately it is broken,
13
         see http://issues.apache.org/bugzilla/show_bug.cgi?id=41201. The relevant
14
         code here is retained in the form of comments, and can be reinstated
15
         when the bug is fixed. Meanwhile the directories are created manually -->
16
    
17
    <!-- Build file for Saxon. This builds all four for the released products:
18
         Saxon-B and Saxon-SA, on both the Java and .NET platforms. It also builds
19
         the released resources file. A full build requires access to Saxonica
20
         proprietary source code. The open source Saxon-B product can be built for
21
         Java using target "bj"; but building Saxon-B for .NET may require some
22
         disentangling of tasks that depend on Saxon-SA being present. -->
23
         
24
    <!-- THIS BUILD FILE CONTAINS DEPENDENCIES ON THE BUILD ENVIRONMENT. IT
25
         WILL NEED TO BE CUSTOMIZED TO WORK IN A DIFFERENT ENVIRONMENT -->     
26
         
27
    <!-- Naming conventions:
28
         -n   : .NET
29
         -j   : Java
30
         -b   : Saxon-B
31
         -sa  : Saxon-SA
32
         combined as appropriate, so -bj denotes Saxon-B on the Java platform
33
    -->     
34
    
35
    <property name="version" value="8.9.0.3"/>
36
    <property name="versionh" value="8-9-0-3"/>
37
    <property name="release.date" value="2007-03-15"/>
38
    
39
    <!-- following locations are specific to the machine -->
40

    
41
                    <!-- root drive -->
42
                    <property name="root" value="c:/"/>
43
                    
44
                    <!-- directory holding Java source code -->
45
                    <property name="development-j.dir" value="${root}/MyJava/saxon8.x"/>
46
                    
47
                    <!-- directory holding Java source code as in Subversion -->
48
                    <property name="subversion-j.dir" value="${root}/saxon-svn2/latest8.9/bj"/>                
49
                    
50
                    <!-- directory holding latest patch state of Saxon-SA Java code -->
51
                    <property name="saj-patch.dir" value="${root}/saxon-89-patch"/>                                        
52
                    
53
                    <!-- directory holding Java test drivers -->
54
                    <property name="drivers-j.dir" value="${root}/MyJava/test"/>                    
55
                    
56
                    <!-- directories holding C# source code -->
57
                    <property name="development-n.dir" value="${root}/MyDotNet/source"/>
58
                    <property name="vss-n.dir" value="${root}/Documents and Settings/Mike/My Documents/Visual Studio 2005/Projects/Saxon.Api"/>
59

    
60
                    <!-- directory holding C# source code as in Subversion -->
61
                    <property name="subversion-n.dir" value="${root}/saxon-svn2/latest8.9/bn/csource"/>        
62
                    
63
                    <!-- directory holding XML user documentation -->
64
                    <property name="userdoc.dir" value="${root}/MyJava/doc/saxon8"/>
65
                    
66
                    <!-- directory holding .NET API documentation (which is built manually using NDOC -->
67
                    <property name="dotnetdoc.dir" value="${root}/MyDotNet/dotnetdoc"/>
68
                    
69
                    <!-- directories holding use cases and sample applications -->
70
                    <property name="usercases.dir" value="${root}/MyJava/use-cases"/>
71
                    <property name="samples.dir" value="${root}/MyJava/samples"/>
72
                    
73
                    <!-- directory in which to build the product for release -->
74
                    <property name="product.dir" value="${root}/saxon-build/${version}"/>
75
                    
76
                    <!-- directory in which to build the issued .ZIP files -->
77
                    <property name="issue.dir" value="${root}/saxon-issues/saxon-issue-${release.date}"/>
78
                    
79
                    <!-- location of the C# compiler -->
80
                    <property name="csharp.compiler" value="c:/Windows/Microsoft.NET/Framework/v1.1.4322/csc.exe"/>   
81
                    
82
    
83
    <!-- following locations are for IKVMC code used to build the .NET product -->
84
    
85
    <property name="development-ikvm.dir" value="${root}/MyDotNet"/>
86
    <property name="ikvm.dir" value="${development-ikvm.dir}/ikvm-0.32.0.0"/>
87
    <property name="generated.stubs.dir" value="${development-ikvm.dir}/stubs"/>
88
    <property name="saxondotnet.snk" value="${development-ikvm.dir}/make/saxondotnet.snk"/>
89
    
90
    <!-- Precondition for .NET compilation: IKVM is installed.
91
         * Download from www.ikvm.net
92
         * Unzip into ${development-ikvm.dir}
93
         * Register in the GAC (access the Microsoft .NET Framework Configuration item in the 
94
                                Windows Control Panel, and add the assemblies to the Assembly Cache. 
95
                                At a minimum, install the IKVM.GNU.Classpath.dll and IKVM.Runtime.dll)
96
         * Generate stubs in ${generated.stubs.dir} 
97
           for System.Xml.dll, System.Security.dll, and IKVM.GNU.Classpath.dll
98
    -->       
99
    
100
    <!-- following locations are relative to the build file -->
101
        
102
    <property name="lib.dir" value="libs"/>
103
    <property name="temp.dir" value="temp"/>
104
    <property name="archive.dir" value="archive"/>
105
    <property name="services.dir" value="services"/>
106
    <property name="temp-src-j.dir" value="${temp.dir}/j/source"/>
107
    <property name="temp-src-nj.dir" value="${temp.dir}/n/jsource"/>
108
    <property name="temp-src-nc.dir" value="${temp.dir}/n/csource"/>
109
    <property name="classes-j.dir" value="${temp.dir}/j/classes"/> 
110
    <property name="classes-n.dir" value="${temp.dir}/n/classes"/> 
111
    <property name="jar-n.dir" value="${temp.dir}/n/jar"/> 
112
    <property name="dll-n.dir" value="${temp.dir}/n/dll"/>  
113

    
114
                <!-- following locations are relative to the destination directory -->
115
                
116
                <property name="build-bj.dir" value="${product.dir}/bj"/>  
117
                <property name="build-saj.dir" value="${product.dir}/saj"/> 
118
                <property name="build-bn.dir" value="${product.dir}/bn"/>  
119
                <property name="build-san.dir" value="${product.dir}/san"/>
120
                <property name="build-resources.dir" value="${product.dir}/resources"/> 
121
          <property name="javadoc.dir" value="${build-resources.dir}/doc/javadoc"/>   
122
    
123

    
124
    <property name="build.debug" value="true"/>
125
    <property name="build.debuglevel" value="source,lines"/>
126
    <property name="build.deprecation" value="true"/>
127
    <property name="build.optimize" value="true"/>
128
    <property name="build.compiler.source" value="1.4"/>
129
    <property name="build.compiler.target" value="1.4"/>
130
    <property name="build.compress" value="false"/>
131
    
132
    <!-- following properties can be switched to determine whether to build from patch source
133
         or from development source -->
134
         
135
    <!-- patch source -->     
136
         
137
    <property name="source-bj.dir" value="${subversion-j.dir}"/>
138
    <property name="source-saj.dir" value="${saj-patch.dir}"/>
139
    <property name="source-api-n.dir" value="${subversion-n.dir}/api/Saxon.Api"/>
140
    <property name="source-cmd-n.dir" value="${subversion-n.dir}/cmd"/>
141
    <property name="source-samples-n.dir" value="${subversion-n.dir}/samples"/>
142
    
143
    <!-- development source -->
144
    
145
    <!-- 
146
    <property name="source-bj.dir" value="${development-j.dir}"/>
147
    <property name="source-saj.dir" value="${development-j.dir}"/>
148
    <property name="source-api-n.dir" value="${vss-n.dir}"/>
149
    <property name="source-cmd-n.dir" value="${vss-n.dir}"/>
150
    <property name="source-samples-n.dir" value="${vss-n.dir}"/>        
151
    -->    
152

    
153
    <path id="classpath-j">
154
        <fileset dir="${lib.dir}">
155
            <include name="*.jar"/>
156
        </fileset>
157
    </path>
158
        
159
    <path id="classpath-n">
160
        <fileset dir="${lib.dir}">
161
            <include name="*.jar"/>
162
        </fileset>
163
        <fileset dir="${ikvm.dir}">
164
                 <include name="classpath/mscorlib.jar"/>
165
                 <include name="classpath/System.jar"/>
166
                 <include name="bin/IKVM.GNU.Classpath.jar"/>
167
                 <include name="bin/IKVM.Runtime.jar"/>
168
        </fileset>
169
        <fileset dir="${generated.stubs.dir}">         
170
                 <include name="System.Xml.jar"/>
171
                 <include name="System.Security.jar"/>
172
        </fileset>         
173
    </path>
174
    
175
    <path id="classpath-samples">
176
        <fileset dir="${lib.dir}">
177
            <include name="*.jar"/>
178
        </fileset>
179
        <fileset dir="${build-saj.dir}">
180
            <include name="*.jar"/>
181
        </fileset>
182
        <!-- Substitute build-bj.dir if there is no requirement to compile the sample applications
183
             that depend on Saxon-SA -->
184
    </path> 
185
    
186
    <target name="clean" description="Clean all files other than source code and downloaded jars.">
187
        <delete dir="${temp.dir}"/>
188
        <delete dir="${product.dir}"/>
189
        <mkdir dir="${product.dir}"/>
190
    </target>
191
    
192
    <target name="download" description="Download third-party jar files.">
193
        <get src="http://mirrors.ibiblio.org/pub/mirrors/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"
194
            dest="${lib.dir}/dom4j-1.6.1.jar" verbose="true"/>
195

    
196
        <get src="http://www.ibiblio.org/maven/jdom/jars/jdom-1.0.jar"
197
            dest="${lib.dir}/jdom-1.0.jar" verbose="true"/>
198

    
199
        <get src="http://www.cafeconleche.org/XOM/xom-1.1.jar" dest="${lib.dir}/xom-1.1.jar"
200
            verbose="true"/>
201
            
202
        <get src="http://dist.codehaus.org/stax/jars/stax-api-1.0.1.jar" dest="${lib.dir}/stax-api-1.0.1.jar"
203
            verbose="true"/> 
204
            
205
            <!-- add servlet.jar, ant.jar -->   
206
            
207
    </target>               
208
    
209
    <target name="copysource-patch" description="Copy relevant source files from patch directories">
210
        <copy todir="${temp-src-j.dir}">
211
          <fileset dir="${source-bj.dir}">
212
            <include name="net/sf/saxon/**/*.java"/>
213
            <exclude name="**/dotnet/**"/>
214
            <include name="net/sf/saxon/**/package.html"/>
215
          </fileset>
216
          <fileset dir="${source-saj.dir}">
217
            <include name="com/saxonica/**/*.java"/>
218
            <exclude name="com/saxonica/validate/DotNetVerifier.java"/>
219
            <include name="com/saxonica/**/package.html"/>
220
          </fileset>          
221
        </copy>
222
        <replace file="${temp-src-j.dir}/com/saxonica/validate/SchemaAwareConfiguration.java"
223
                 token="/*DOTNETONLY*/"
224
                 value="//"
225
                 summary="yes"/>  
226
        <replace file="${temp-src-j.dir}/net/sf/saxon/Configuration.java"
227
                 token="/*DOTNETONLY*/"
228
                 value="//"
229
                 summary="yes"/>                
230
        <copy todir="${temp-src-nj.dir}">
231
          <fileset dir="${source-bj.dir}">
232
            <include name="net/sf/saxon/**/*.java"/>
233
            <exclude name="**/ant/**"/>
234
            <exclude name="**/dom/**"/>
235
            <exclude name="**/dom4j/**"/>
236
            <exclude name="**/java/**"/>
237
            <exclude name="**/javax/**"/>
238
            <exclude name="**/jdom/**"/>
239
            <exclude name="**/pull/PullToStax.java"/>
240
            <exclude name="**/pull/StaxBridge.java"/>
241
            <exclude name="**/xom/**"/>
242
            <exclude name="**/xpath/**"/>
243
            <exclude name="**/xqj/**"/>
244
          </fileset>
245
                                        <fileset dir="${source-saj.dir}">
246
            <include name="com/saxonica/extra/*.java"/>
247
            <include name="com/saxonica/fsa/*.java"/>
248
            <include name="com/saxonica/ptree/*.java"/>
249
            <include name="com/saxonica/schema/*.java"/>
250
            <include name="com/saxonica/sdoc/*.java"/>
251
            <include name="com/saxonica/validate/*.java"/>
252
            <include name="com/saxonica/Validate.java"/>
253
          </fileset>          
254
        </copy>
255
        <replace file="${temp-src-nj.dir}/com/saxonica/validate/SchemaAwareConfiguration.java"
256
                 token="/*JAVAONLY*/"
257
                 value="//"
258
                 summary="yes"/>  
259
        <replace file="${temp-src-nj.dir}/net/sf/saxon/Configuration.java"
260
                 token="/*JAVAONLY*/"
261
                 value="//"
262
                 summary="yes"/>
263
        <copy todir="${temp-src-nc.dir}/api">
264
          <fileset dir="${vss-n.dir}">
265
            <include name="Saxon.Api/*.cs"/>
266
          </fileset>
267
        </copy>
268
        <copy todir="${temp-src-nc.dir}/cmd">
269
          <fileset dir="${source-cmd-n.dir}">
270
            <include name="*.cs"/>
271
          </fileset>
272
        </copy>
273
        <copy todir="${temp-src-nc.dir}/samples">
274
                <fileset dir="${source-samples-n.dir}">
275
            <include name="*.cs"/>
276
          </fileset>
277
        </copy>
278
        
279
    </target>
280
    
281
    <target name="copysource-development" description="Copy relevant source files from development directory">
282
        <copy todir="${temp-src-j.dir}">
283
          <fileset dir="${source-bj.dir}">
284
            <include name="net/sf/saxon/**/*.java"/>
285
            <exclude name="**/dotnet/**"/>
286
            <include name="net/sf/saxon/**/package.html"/>
287
          </fileset>
288
          <fileset dir="${source-saj.dir}">
289
            <include name="com/saxonica/**/*.java"/>
290
            <exclude name="com/saxonica/validate/DotNetVerifier.java"/>
291
            <include name="com/saxonica/**/package.html"/>
292
          </fileset>          
293
        </copy>
294
        <replace file="${temp-src-j.dir}/com/saxonica/validate/SchemaAwareConfiguration.java"
295
                 token="/*DOTNETONLY*/"
296
                 value="//"
297
                 summary="yes"/>  
298
        <replace file="${temp-src-j.dir}/net/sf/saxon/Configuration.java"
299
                 token="/*DOTNETONLY*/"
300
                 value="//"
301
                 summary="yes"/>                
302
        <copy todir="${temp-src-nj.dir}">
303
          <fileset dir="${source-bj.dir}">
304
            <include name="net/sf/saxon/**/*.java"/>
305
            <exclude name="**/ant/**"/>
306
            <exclude name="**/dom/**"/>
307
            <exclude name="**/dom4j/**"/>
308
            <exclude name="**/java/**"/>
309
            <exclude name="**/javax/**"/>
310
            <exclude name="**/jdom/**"/>
311
            <exclude name="**/pull/PullToStax.java"/>
312
            <exclude name="**/pull/StaxBridge.java"/>
313
            <exclude name="**/xom/**"/>
314
            <exclude name="**/xpath/**"/>
315
            <exclude name="**/xqj/**"/>
316
          </fileset>
317
                                        <fileset dir="${source-saj.dir}">
318
            <include name="com/saxonica/extra/*.java"/>
319
            <include name="com/saxonica/fsa/*.java"/>
320
            <include name="com/saxonica/ptree/*.java"/>
321
            <include name="com/saxonica/schema/*.java"/>
322
            <include name="com/saxonica/sdoc/*.java"/>
323
            <include name="com/saxonica/validate/*.java"/>
324
            <include name="com/saxonica/Validate.java"/>
325
          </fileset>          
326
        </copy>
327
        <replace file="${temp-src-nj.dir}/com/saxonica/validate/SchemaAwareConfiguration.java"
328
                 token="/*JAVAONLY*/"
329
                 value="//"
330
                 summary="yes"/>  
331
        <replace file="${temp-src-nj.dir}/net/sf/saxon/Configuration.java"
332
                 token="/*JAVAONLY*/"
333
                 value="//"
334
                 summary="yes"/>
335
        <copy todir="${temp-src-nc.dir}/api">
336
          <fileset dir="${vss-n.dir}">
337
            <include name="Saxon.Api/*.cs"/>
338
          </fileset>
339
        </copy>
340
        <copy todir="${temp-src-nc.dir}/cmd">
341
          <fileset dir="${source-cmd-n.dir}/Transform">
342
            <include name="*.cs"/>
343
          </fileset>
344
          <fileset dir="${source-cmd-n.dir}/Query">
345
            <include name="*.cs"/>
346
          </fileset>
347
          <fileset dir="${source-cmd-n.dir}/Validate">
348
            <include name="*.cs"/>
349
          </fileset>
350
        </copy>
351
        <copy todir="${temp-src-nc.dir}/samples">
352
          <fileset dir="${source-samples-n.dir}/XQueryExamples">
353
            <include name="*.cs"/>
354
          </fileset>
355
          <fileset dir="${source-samples-n.dir}/XPathExample">
356
            <include name="*.cs"/>
357
          </fileset>
358
          <fileset dir="${source-samples-n.dir}/XsltExamples">
359
            <include name="*.cs"/>
360
          </fileset>
361
          <fileset dir="${source-samples-n.dir}/SchemaExamples">
362
            <include name="*.cs"/>
363
          </fileset>
364
          <fileset dir="${source-samples-n.dir}/XsltTestSuiteDriver">
365
            <include name="*.cs"/>
366
          </fileset>
367
          <fileset dir="${source-samples-n.dir}/XQueryTestSuiteDriver">
368
            <include name="*.cs"/>
369
          </fileset>       
370
        </copy>
371
        
372
    </target>    
373
    
374
    <target name="create-meta-inf" description="Create contents of META-INF/services files">    
375
        
376
        <!-- given the Ant 1.7.0 bug, create the services files here for copying into the JARS -->
377
        <mkdir dir="${services.dir}/saxon8/META-INF/services"/>
378
        <echo file="${services.dir}/saxon8/META-INF/services/javax.xml.transform.TransformerFactory"
379
              message="net.sf.saxon.TransformerFactoryImpl"/>
380
        <mkdir dir="${services.dir}/saxon8-xpath/META-INF/services"/>
381
        <echo file="${services.dir}/saxon8-xpath/META-INF/services/javax.xml.xpath.XPathFactory"
382
>net.sf.saxon.xpath.XPathFactoryImpl
383
http\://java.sun.com/jaxp/xpath/dom:    net.sf.saxon.xpath.XPathFactoryImpl
384
http\://saxon.sf.net/jaxp/xpath/om:     net.sf.saxon.xpath.XPathFactoryImpl
385
http\://www.xom.nu/jaxp/xpath/xom:      net.sf.saxon.xpath.XPathFactoryImpl
386
http\://jdom.org/jaxp/xpath/jdom:       net.sf.saxon.xpath.XPathFactoryImpl
387
http\://www.dom4j.org/jaxp/xpath/dom4j: net.sf.saxon.xpath.XPathFactoryImpl
388
</echo> 
389
        <mkdir dir="${services.dir}/saxon8sa/META-INF/services"/>
390
        <echo file="${services.dir}/saxon8sa/META-INF/services/javax.xml.transform.TransformerFactory"
391
              message="com.saxonica.SchemaAwareTransformerFactory"/>     
392
        <mkdir dir="${services.dir}/saxon8sa-jaxp/META-INF/services"/>
393
        <echo file="${services.dir}/saxon8sa-jaxp/META-INF/services/javax.xml.validation.SchemaFactory"
394
>com.saxonica.jaxp.SchemaFactoryImpl
395
http\://www.w3.org/2001/XMLSchema: com.saxonica.jaxp.SchemaFactoryImpl
396
</echo>         
397
                                      
398

    
399
    </target>
400
    
401
    <target name="compile-bj" description="Compile Saxon-B classes for Java." depends="">
402
        <mkdir dir="${classes-j.dir}"/>
403
        <javac debug="${build.debug}" debuglevel="${build.debuglevel}" 
404
            deprecation="${build.deprecation}" destdir="${classes-j.dir}"
405
            optimize="${build.optimize}" srcdir="${temp-src-j.dir}" source="${build.compiler.source}"
406
            target="${build.compiler.target}">
407

    
408
            <include name="net/**"/>
409
            <exclude name="**/ant/**"/>
410
            <exclude name="**/dotnet/**"/>
411
            <classpath>
412
                <path refid="classpath-j"/>
413
            </classpath>
414
        </javac>
415
    </target>
416
    
417
    <target name="compile-saj" description="Compile Saxon-SA classes for Java." depends="">
418
        <mkdir dir="${classes-j.dir}"/>
419
        <javac debug="${build.debug}"  debuglevel="${build.debuglevel}" 
420
            deprecation="${build.deprecation}" destdir="${classes-j.dir}"
421
            optimize="${build.optimize}" srcdir="${temp-src-j.dir}" source="${build.compiler.source}"
422
            target="${build.compiler.target}">
423

    
424
            <include name="com/saxonica/**"/>
425
            <include name="net/sf/saxon/ant/**"/>
426
            <exclude name="com/saxonica/validate/DotNetVerifier.java"/>
427
            <classpath>
428
                <path refid="classpath-j"/>
429
            </classpath>
430
        </javac>
431
    </target>
432
    
433
    <target name="compile-bn" description="Compile Saxon-B classes for .NET" depends="">
434
        <mkdir dir="${classes-n.dir}"/>
435
        <javac debug="${build.debug}" debuglevel="${build.debuglevel}" 
436
            deprecation="${build.deprecation}" destdir="${classes-n.dir}"
437
            optimize="${build.optimize}" srcdir="${temp-src-nj.dir}" source="${build.compiler.source}"
438
            target="${build.compiler.target}">
439

    
440
            <include name="net/**"/>
441
            <classpath>
442
                <path refid="classpath-n"/>
443
            </classpath>
444
        </javac>
445
    </target>
446
    
447
    <target name="compile-san" description="Compile Saxon-SA classes for .NET" depends="">
448
        <mkdir dir="${classes-n.dir}"/>
449
        <javac debug="${build.debug}"  debuglevel="${build.debuglevel}" 
450
            deprecation="${build.deprecation}" destdir="${classes-n.dir}"
451
            optimize="${build.optimize}" srcdir="${temp-src-nj.dir}" source="${build.compiler.source}"
452
            target="${build.compiler.target}">
453

    
454
            <include name="com/saxonica/**"/>
455
            <exclude name="com/saxonica/validate/JavaVerifier.java"/>
456
            <classpath>
457
                <path refid="classpath-n"/>
458
            </classpath>
459
        </javac>
460
    </target>        
461

    
462
    <target name="jar-bj" description="Create Saxon-B jar files for Java" depends="compile-bj">
463
        <mkdir dir="${product.dir}/bj"/>
464
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8.jar">
465
            <include name="net/**/*.class"/>
466
            <exclude name="**/ant/**/*.class"/>
467
            <exclude name="**/dom/**/*.class"/>
468
            <exclude name="**/dom4j/**/*.class"/>
469
            <exclude name="**/javax/**/*.class"/>
470
            <exclude name="**/jdom/**/*.class"/>
471
            <exclude name="**/sql/**/*.class"/>
472
            <exclude name="**/xom/**/*.class"/>
473
            <exclude name="**/xpath/**/*.class"/>
474
            <exclude name="**/xqj/**/*.class"/>
475
            <include name="META-INF/**"/>
476
            <manifest>
477
                <attribute name="Project-Name" value="Saxon-B"/>
478
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
479
            </manifest>
480
            <metainf dir="${services.dir}/saxon8/META-INF"/>
481
            <!--
482
            <service type="javax.xml.transform.TransformerFactory"
483
                provider="net.sf.saxon.TransformerFactoryImpl"/>
484
            -->    
485
        </jar>
486
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8-dom.jar">
487
            <include name="net/sf/saxon/dom/*.class"/>
488
        </jar>
489
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8-dom4j.jar">
490
            <include name="net/sf/saxon/dom4j/*.class"/>
491
        </jar>
492
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8-jdom.jar">
493
            <include name="net/sf/saxon/jdom/*.class"/>
494
        </jar>
495
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8-sql.jar">
496
            <include name="net/sf/saxon/sql/*.class"/>
497
        </jar> 
498
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8-xom.jar">
499
            <include name="net/sf/saxon/xom/*.class"/>
500
        </jar> 
501
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8-xpath.jar">
502
            <include name="net/sf/saxon/xpath/*.class"/>
503
            <metainf dir="${services.dir}/saxon8-xpath/META-INF"/>
504
            <!--
505
            <service type="javax.xml.xpath.XPathFactory">
506
                <provider classname="net.sf.saxon.xpath.XPathFactoryImpl"/>
507
                <provider classname="http\://java.sun.com/jaxp/xpath/dom:    net.sf.saxon.xpath.XPathFactoryImpl"/>
508
                <provider classname="http\://saxon.sf.net/jaxp/xpath/om:     net.sf.saxon.xpath.XPathFactoryImpl"/>
509
                <provider classname="http\://www.xom.nu/jaxp/xpath/xom:      net.sf.saxon.xpath.XPathFactoryImpl"/>
510
                <provider classname="http\://jdom.org/jaxp/xpath/jdom:       net.sf.saxon.xpath.XPathFactoryImpl"/>
511
                <provider classname="http\://www.dom4j.org/jaxp/xpath/dom4j: net.sf.saxon.xpath.XPathFactoryImpl"/>
512
            </service>-->
513
        </jar>  
514
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8-xqj.jar">
515
            <include name="net/sf/saxon/xqj/*.class"/>
516
            <include name="net/sf/saxon/javax/xml/namespace/*.class"/>
517
            <include name="net/sf/saxon/javax/xml/xquery/*.class"/>
518
        </jar>                       
519
    </target>
520
    
521
    <target name="jar-saj" description="Create Saxon-SA jar files for Java" depends="compile-saj, jar-bj">
522
        <mkdir dir="${product.dir}/saj"/>
523
        <copy todir="${product.dir}/saj">
524
          <fileset dir="${product.dir}/bj">
525
            <include name="*.jar"/>
526
          </fileset>
527
        </copy>          
528
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/saj/saxon8sa.jar">
529
            <include name="net/**/*.class"/>
530
            <exclude name="**/dom/**/*.class"/>
531
            <exclude name="**/dom4j/**/*.class"/>
532
            <exclude name="**/javax/**/*.class"/>
533
            <exclude name="**/jdom/**/*.class"/>
534
            <exclude name="**/sql/**/*.class"/>
535
            <exclude name="**/xom/**/*.class"/>
536
            <exclude name="**/xpath/**/*.class"/>
537
            <exclude name="**/xqj/**/*.class"/>
538
            <include name="com/saxonica/**/*.class"/>
539
            <exclude name="com/saxonica/jaxp/*.class"/>
540
            <exclude name="com.saxonica.CompileQuery.class"/>
541
            <manifest>
542
                <attribute name="Project-Name" value="Saxon-SA"/>
543
            </manifest>
544
            <metainf dir="${services.dir}/saxon8sa/META-INF"/>
545
            <!--
546
            <service type="javax.xml.transform.TransformerFactory"
547
                provider="com.saxonica.SchemaAwareTransformerFactory"/>
548
            -->    
549
        </jar>
550
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/saj/saxon8sa-jaxp.jar">
551
            <include name="com/saxonica/jaxp/*.class"/>
552
            <include name="net/sf/saxon/dom/TypeInfoImpl.class"/>
553
            <metainf dir="${services.dir}/saxon8sa-jaxp/META-INF"/>
554
            <!--
555
            <service type="javax.xml.validation.SchemaFactory">
556
                <provider classname="com.saxonica.jaxp.SchemaFactoryImpl"/>
557
                <provider classname="http\://www.w3.org/2001/XMLSchema: com.saxonica.jaxp.SchemaFactoryImpl"/>
558
            </service>
559
            -->
560
        </jar>
561
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/saj/saxon8sa-qc.jar">
562
            <include name="com/saxonica/codegen/*.class"/>
563
            <include name="com.saxonica.CompileQuery.class"/>
564
        </jar>
565
        <!-- The Saxon-Ant task is delivered with Saxon-B but it won't compile without Saxon-SA present,
566
             unless modified -->
567
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon8-ant.jar">
568
            <include name="net/sf/saxon/ant/*.class"/>
569
        </jar> 
570
    </target>
571
    
572
    <target name="jar-bn" description="Create Saxon-B jar files for .NET" depends="compile-bn">
573
        <mkdir dir="${jar-n.dir}"/>
574
        <jar basedir="${classes-n.dir}" compress="${build.compress}" jarfile="${jar-n.dir}/saxon8.jar">
575
            <include name="net/**/*.class"/>
576
        </jar>
577
    </target> 
578
    
579
    <target name="jar-san" description="Create Saxon-SA jar files for .NET" depends="compile-san">
580
        <mkdir dir="${jar-n.dir}"/>
581
        <jar basedir="${classes-n.dir}" compress="${build.compress}" jarfile="${jar-n.dir}/saxon8sa.jar">
582
            <include name="com/saxonica/**/*.class"/>
583
        </jar>
584
    </target>
585
    
586
    <target name="dll-n" description="Create DLLs for .NET" depends="jar-bn, jar-san">
587
        <mkdir dir="${dll-n.dir}"/>
588
        <copy todir="${dll-n.dir}">
589
          <fileset dir="${ikvm.dir}/bin">
590
            <include name="IKVM.GNU.Classpath.dll"/>
591
            <include name="IKVM.Runtime.dll"/>
592
          </fileset>
593
        </copy>
594
        <copy file="${saxondotnet.snk}" todir="${basedir}"/> 
595
        <!--
596
            Invoke IKVMC to cross-compile the JAR files into DLLs
597
        -->           
598
        <exec dir="." executable="ikvmc.cmd" >
599
          <arg line="live"/>
600
          <arg line="${basedir}/${jar-n.dir}"/>
601
          <arg line="${basedir}/${dll-n.dir}"/>
602
          <arg line="${version}"/>
603
        </exec>
604
    </target>
605
    
606
    <target name="csharp-n" description="Compile C# source for .NET commands and API library"
607
        depends="dll-n"> 
608

    
609
                                <mkdir dir="${dll-n.dir}/samples"/>
610
                                <mkdir dir="${dll-n.dir}/tests"/>
611
                                
612
                                <exec dir="." executable="csharp-compile.cmd" >
613
          <arg line="${basedir}/${temp-src-nc.dir}"/>
614
          <arg line="${basedir}/${dll-n.dir}"/>
615
          <arg line="${version}"/>
616
        </exec>
617

    
618
        
619
<!--        <taskdef 
620
            uri="antlib:org.apache.ant.dotnet">
621
            <classpath>
622
              <pathelement location="c:/javalib/ant-dotnet-1.0/ant-dotnet-1.0.jar"/>
623
            </classpath>
624
          </taskdef>
625
                    <dn:csc xmlns:dn="antlib:org.apache.ant.dotnet"
626
                              executable="${csharp.compiler}"
627
                                                 srcdir="${temp-src-nc.dir}/cmd"
628
                                                 targettype="exe"
629
                                                 win32icon="c:\MyDotNet\icons\gyfu.ico"
630
                                                 destdir="${dll-n.dir}">
631
                         <reference file="${dll-n.dir}/IKVM.GNU.Classpath.dll"/>
632
                         <reference file="${dll-n.dir}/IKVM.Runtime.dll"/>
633
                         <reference file="${dll-n.dir}/saxon8.dll"/>
634
                         <reference file="${dll-n.dir}/saxon8sa.dll"/>
635
              </dn:csc>           
636
                    <dn:csc xmlns:dn="antlib:org.apache.ant.dotnet"
637
                              executable="${csharp.compiler}"
638
                                                 srcdir="${temp-src-nc.dir}/api"
639
                                                 targettype="module"
640
                                                 win32icon="c:\MyDotNet\icons\gyfu.ico"
641
                                                 destdir="${dll-n.dir}">
642
                         <reference file="${dll-n.dir}/IKVM.GNU.Classpath.dll"/>
643
                         <reference file="${dll-n.dir}/IKVM.Runtime.dll"/>
644
                         <reference file="${dll-n.dir}/saxon8.dll"/>
645
                         <reference file="${dll-n.dir}/saxon8sa.dll"/> 
646
              </dn:csc> 
647
-->                                        
648
    </target>
649
    
650
    <target name="product-bn" description="Assemble product.directory for Saxon-B on .NET"
651
                                                                                           depends="csharp-n, dll-n">
652
      <mkdir dir="${build-bn.dir}/bin"/>                                                                                     
653
      <copy todir="${build-bn.dir}/bin">
654
        <fileset dir="${dll-n.dir}">
655
                       <include name="IKVM.GNU.Classpath.dll"/>
656
          <include name="IKVM.Runtime.dll"/>
657
          <include name="saxon8.dll"/>
658
          <include name="saxon8api.dll"/>
659
          <include name="saxon8api.netmodule"/>
660
          <include name="Query.exe"/>
661
          <include name="Transform.exe"/>
662
        </fileset>
663
      </copy>
664
                        <echo file="${build-bn.dir}/bin/install-gac.cmd">
665
                                set NET="%PROGRAMFILES%\Microsoft.NET\SDK\v1.1\Bin"
666
                                %NET%\gacutil /if IKVM.Runtime.dll
667
                                %NET%\gacutil /if IKVM.GNU.Classpath.dll
668
                                %NET%\gacutil /if saxon8.dll 
669
                                %NET%\gacutil /if saxon8api.dll                
670
      </echo>      
671
    </target>  
672
    
673
    <target name="product-san" description="Assemble product.directory for Saxon-SA on .NET"
674
                                                                                           depends="csharp-n, dll-n">
675
      <copy todir="${build-san.dir}/bin">
676
        <fileset dir="${dll-n.dir}">
677
                       <include name="IKVM.GNU.Classpath.dll"/>
678
          <include name="IKVM.Runtime.dll"/>
679
          <include name="saxon8.dll"/>
680
          <include name="saxon8sa.dll"/>
681
          <include name="saxon8api.dll"/>
682
          <include name="saxon8api.netmodule"/>
683
          <include name="Query.exe"/>
684
          <include name="Transform.exe"/>
685
          <include name="Validate.exe"/>
686
        </fileset> 
687
      </copy>
688
      <echo file="${build-san.dir}/bin/install-gac.cmd">
689
                                set NET="%PROGRAMFILES%\Microsoft.NET\SDK\v1.1\Bin"
690
                                %NET%\gacutil /if IKVM.Runtime.dll
691
                                %NET%\gacutil /if IKVM.GNU.Classpath.dll
692
                                %NET%\gacutil /if saxon8.dll 
693
                                %NET%\gacutil /if saxon8sa.dll 
694
                                %NET%\gacutil /if saxon8api.dll             
695
      </echo>             
696
    </target>
697
    
698
    <target name="samples" description="Assemble Cross-Platform Samples and Use-Cases">
699
            <mkdir dir="${build-resources.dir}/samples"/>
700
      <copy todir="${product.dir}/resources/use-cases">
701
        <fileset dir="${usercases.dir}"/>
702
      </copy>
703
      <copy todir="${product.dir}/resources/samples">
704
        <fileset dir="${samples.dir}">
705
          <include name="analysis/timing-profile.xsl"/>
706
          <include name="data/*.xml"/>
707
          <include name="data/*.xsd"/>
708
          <include name="data/*.dtd"/>
709
          <include name="query/*.xq"/>
710
          <include name="styles/*.xsl"/>
711
          <include name="trax/xml/**/*.xml"/>
712
          <include name="trax/xsl/**/*.xsl"/>
713
          <include name="trax/xsl/**/preamble.txt"/>
714
        </fileset>
715
      </copy>
716
    </target>
717
    
718
    <target name="samples-j" description="Copy and Compile Java Samples"
719
                                    depends="jar-saj">
720
      <mkdir dir="${product.dir}/resources/samples/java"/>
721
      <mkdir dir="${product.dir}/resources/samples/java/classes"/>
722
      <copy todir="${product.dir}/resources/samples/java">
723
        <fileset dir="${samples.dir}/java">
724
          <include name="ApplyXPathJAXP.java"/>
725
          <include name="ExampleContentHandler.java"/>
726
          <include name="JDOMExample.java"/>
727
          <include name="PullExamples.java"/>
728
          <include name="QueryAPIExamples.java"/>
729
          <include name="QuickValidator.java"/>
730
          <include name="SaxonServlet.java"/>
731
          <include name="SaxonSAServlet.java"/>
732
          <include name="SchemaValidatorExample.java"/>
733
          <include name="SchemaValidatorHandlerExample.java"/>
734
          <include name="TraxExamples.java"/>
735
          <include name="XMarkBenchmark.java"/>
736
          <include name="XPathExample.java"/>
737
          <include name="XPathExampleDOM.java"/>
738
          <include name="XPathExampleSA.java"/>
739
          <include name="XPathExampleServlet.java"/>
740
          <include name="XQJExamples.java"/>
741
        </fileset>
742
      </copy>
743
                        <javac debug="true" debuglevel="source, lines" 
744
                              destdir="${product.dir}/resources/samples/java/classes"
745
            srcdir="${product.dir}/resources/samples/java" 
746
            source="${build.compiler.source}"
747
            target="${build.compiler.target}">
748
        <include name="*.java"/>    
749
        <classpath>
750
            <path refid="classpath-samples"/>
751
        </classpath>
752
     </javac>            
753
    </target>
754
    
755
    <target name="testdrivers-j" description="Copy Java Test Drivers">
756
                        <mkdir dir="${product.dir}/resources/drivers/java/test"/>
757
                        <copy todir="${product.dir}/resources/drivers/java/test">
758
                          <fileset dir="${drivers-j.dir}">
759
                            <include name="XQueryTestSuiteDriver.java"/> 
760
                            <include name="XsltTestSuiteDriver.java"/> 
761
                            <include name="CanonicalXML.java"/> 
762
                            <include name="XQTSModuleURIResolver.java"/> 
763
                            <include name="XQTSCollectionURIResolver.java"/> 
764
                            <include name="SchemaTestSuiteDriver.java"/> 
765
        </fileset>
766
      </copy>
767
    </target>           
768
    
769
    <target name="samples-n" description="Assemble release samples for .NET"
770
                  depends="csharp-n">
771
      <mkdir dir="${build-resources.dir}/samples/cs"/>
772
      <copy todir="${build-resources.dir}/samples/cs"> 
773
        <fileset dir="${dll-n.dir}/samples">
774
          <include name="samples/*.exe"/>
775
          <include name="tests/*.exe"/>
776
        </fileset>
777
        <fileset dir="${temp-src-nc.dir}/samples">
778
          <include name="*.cs"/>
779
        </fileset>
780
      </copy>
781
    </target>               
782
                  
783
    <target name="product-javadoc" description="Generate Javadoc.">
784
        <javadoc bottom="Copyright (C) Michael H. Kay. All rights reserved."
785
            destdir="${javadoc.dir}" doctitle="Saxon8 Javadocs"
786
            noindex="true" notree="true" access="public"
787
            maxmemory="512M" source="1.4">
788
            <packageset dir="${temp-src-j.dir}">
789
                <include name="net/**"/>
790
                <include name="com/**"/>
791
                <exclude name="**/dotnet/**"/>
792
                <exclude name="**/DotNetVerifier.java"/>
793
            </packageset>
794
            <classpath>
795
                <path refid="classpath-j"/>
796
            </classpath>
797
            
798
            <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
799
            <link href="http://www.xom.nu/apidocs/"/>
800
            
801
        </javadoc>
802
        <copy file="${userdoc.dir}/fixed/javadoc/stylesheet.css"
803
              tofile="${javadoc.dir}/stylesheet.css"
804
              overwrite="true"/>
805
    </target>
806
    
807
    <target name="product-dotnetdoc" description="Copy .NET API documentation">
808
      <mkdir dir="${build-resources.dir}/doc/dotnetdoc"/>
809
      <copy todir="${build-resources.dir}/doc/dotnetdoc">
810
        <fileset dir="${dotnetdoc.dir}"/>
811
      </copy>
812
    </target>  
813
    
814
    
815
    <target name="release-userdoc" description="Generate User Documentation">
816
                        <taskdef name="saxon-xslt" 
817
                                 classname="net.sf.saxon.ant.AntTransform" 
818
                                 classpath="c:\MyJava;c:\saxon-licenses"/>
819
                        <copy todir="${build-resources.dir}/doc">
820
        <fileset dir="${userdoc.dir}/fixed"/>
821
      </copy> 
822
                        <copy todir="${product.dir}/bj">
823
        <fileset dir="${userdoc.dir}/welcome">
824
          <include name="doc/**"/>
825
        </fileset>
826
      </copy>
827
      <copy todir="${product.dir}/saj">
828
        <fileset dir="${userdoc.dir}/welcome">
829
          <include name="doc/**"/>
830
        </fileset>
831
      </copy>
832
      <copy todir="${product.dir}/bn">
833
        <fileset dir="${userdoc.dir}/welcome">
834
          <include name="doc/**"/>
835
        </fileset>
836
      </copy>
837
      <copy todir="${product.dir}/san">
838
        <fileset dir="${userdoc.dir}/welcome">
839
          <include name="doc/**"/>
840
        </fileset>
841
      </copy>       
842
                        <saxon-xslt in="${userdoc.dir}/catalog.xml" 
843
                                    style="${userdoc.dir}/render-page2.xsl"
844
                                    schemaaware="true"
845
                                    validation="strict" 
846
                                    out="${product.dir}/resources/doc/dummy.html">
847
                          <param name="destination" expression="offline"/>
848
                        </saxon-xslt> 
849
                        <zip zipfile="${build-resources.dir}/source-userdoc.zip">
850
                          <fileset dir="${userdoc.dir}">
851
                            <include name="**/*.xml"/>
852
                            <include name="**/*.xsl"/>
853
                            <include name="**/*.xsd"/>
854
                            <include name="**/*.css"/>
855
                            <include name="fixed/**"/>
856
                            <include name="welcome/**"/>
857
                          </fileset>
858
                        </zip>                               
859
    </target>
860
    
861
    <target name="release-source" description="Generate Zip file containing issued Source Code">
862
      <zip zipfile="${build-resources.dir}/source.zip">
863
        <fileset dir="${development-j.dir}">
864
           <include name="net/**/*.java"/>
865
           <include name="net/**/package.html"/>
866
           <!-- TODO: add .NET source code -->
867
        </fileset>
868
        <fileset dir="${temp-src-nc.dir}">
869
           <include name="api/**/*.cs"/>
870
           <include name="cmd/**/*.cs"/>
871
        </fileset>   
872
      </zip>
873
      <zip zipfile="${development-j.dir}/sa-source.zip">
874
        <fileset dir="${development-j.dir}">
875
           <include name="com/saxonica/**/*.java"/>
876
           <include name="com/saxonica/**/package.html"/>
877
        </fileset>
878
      </zip>
879
    </target>
880
    
881
    <target name="resources" description="Generate contents of released resources file"
882
              depends="release-userdoc, product-javadoc, product-dotnetdoc,
883
                       samples, samples-j, testdrivers-j, samples-n, release-source">
884
      <mkdir dir="${product.dir}/resources/build"/>
885
      <copy todir="${product.dir}/resources/build">
886
        <fileset dir="${basedir}">
887
          <include name="build.xml"/>
888
          <include name="ikvmc.cmd"/>
889
          <include name="csharp-compile.cmd"/>
890
        </fileset>  
891
      </copy>
892
    </target>  
893
      
894
    <target name="bj" depends="compile-bj, jar-bj"
895
        description="Generate Saxon-B for the Java platform"/>
896

    
897
    <target name="saj" depends="bj, jar-saj"
898
        description="Generate Saxon-SA for the Java platform"/>
899
        
900
    <target name="n" depends="product-bn, product-san"
901
                    description="Generate Saxon for the .NET platform"/>    
902

    
903
    <target name="build" description="Complete Saxon product build"
904
              depends="bj, saj, n"/> <!-- add resources -->
905
      
906
    <target name="release" description="Create .ZIP files for release" depends="build"
907
        >  <!--depends="build"-->
908
      <mkdir dir="${issue.dir}"/> 
909
      <zip zipfile="${issue.dir}/saxonb${versionh}j.zip">
910
        <fileset dir="${product.dir}/bj"/>
911
      </zip>
912
      <zip zipfile="${issue.dir}/saxonb${versionh}n.zip">
913
        <fileset dir="${product.dir}/bn"/>
914
      </zip>
915
                        <zip zipfile="${issue.dir}/saxonsa${versionh}j.zip">
916
        <fileset dir="${product.dir}/saj"/>
917
      </zip>                     
918
      <zip zipfile="${issue.dir}/saxonsa${versionh}n.zip">
919
        <fileset dir="${product.dir}/san"/>
920
      </zip>
921
      <!--
922
      <zip zipfile="${issue.dir}/saxon-resources${versionh}.zip">
923
        <fileset dir="${product.dir}/resources"/>
924
      </zip>-->
925
    </target>
926
    
927
    <target name="archive" description="Archive everything needed for backup"> 
928
      <mkdir dir="${archive.dir}"/>
929
      <copy todir="${archive.dir}">
930
       <fileset dir="${issue.dir}"/>
931
       <fileset dir="${development-j.dir}" includes="sa-source.zip"/>
932
       <fileset dir="${build-resources.dir}" includes="source.zip"/>
933
      </copy>
934
      <zip zipfile="${archive.dir}/saxontests.zip">
935
        <fileset dir="c:/tests">
936
          <include name="testsuite/*.*"/>
937
          <include name="java/**/*.java"/>
938
          <include name="xqts-current/SaxonDriver/**"/>
939
          <include name="xqts-extra/**"/>
940
          <include name="xslts_1_0_4/**/SaxonDriver/**"/>
941
        </fileset>  
942
        <fileset dir="c:/tests/java" includes ="**/*.java"/>
943
      </zip>
944
      <zip zipfile="${archive.dir}/licensetool.zip">
945
        <fileset dir="c:/MyJava/licensetool"/>
946
      </zip>
947
      <zip zipfile="${archive.dir}/licenses.zip">
948
        <fileset dir="c:/saxon-licenses"/>
949
      </zip>
950
    </target>  
951
      
952
       
953
    
954
</project>
    (1-1/1)