Project

Profile

Help

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

he / tags / 9.8.0.8 / build / build-j.xml @ 02f8308b

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

    
3
<project basedir="." default="all" name="Saxon for the Java platform"
4
    xmlns:dn="antlib:org.apache.ant.dotnet" xmlns:if="ant:if" xmlns:unless="ant:unless">
5
    <!-- The use of ant:if and ant:unless requires Ant 1.9.1 -
6
        for IntelliJ the built-in is 1.8.2, but an external Ant can be configured on the Ant menu  -->
7

    
8
    <!-- Build file for Saxon on the Java platform. This build file is designed to be imported
9
         from build.xml -->
10

    
11
    <import file="build-constants.xml"/>
12
    <import file="samples-common.xml"/>
13

    
14
    <!-- Import of private Saxonica build file for signing the issued JARs (task private-signjars). -->
15
    <!-- This can be replaced by a reference to different signing tool -->
16

    
17
    <import file="build-j-signer.xml"/>
18
    <import file="documentation.xml"/>
19

    
20

    
21

    
22
    <!-- directory holding Java test drivers -->
23
    <property name="drivers-j.dir" value="../MyJava/testcode/test"/>
24

    
25
    <!-- The source preprocessor - see https://code.google.com/p/java-comment-preprocessor/wiki/UsageFromAnt -->
26
    <taskdef resource="com/igormaznitsa/jcp/ant/tasks.properties" classpath="../lib/jcp-5.3.jar"/>
27

    
28
    <!-- following locations are relative to the build file -->
29

    
30
    <property name="services.dir" value="services"/>
31
    <property name="temp-src-j.dir" value="${temp.dir}/j/source"/>
32
    <property name="temp-src-prep0-hej.dir" value="${temp.dir}/preprocessed0/hej/source"/>
33
    <property name="temp-src-prep0-eej.dir" value="${temp.dir}/preprocessed0/eej/source"/>
34
    <property name="temp-src-prep0-pej.dir" value="${temp.dir}/preprocessed0/pej/source"/>
35
    <property name="temp-src-prep-hej.dir" value="${temp.dir}/preprocessed/hej/source"/>
36
    <property name="temp-src-prep-eej.dir" value="${temp.dir}/preprocessed/eej/source"/>
37
    <property name="temp-src-prep-pej.dir" value="${temp.dir}/preprocessed/pej/source"/>
38
    <property name="temp-src-prep-test.dir" value="${temp.dir}/preprocessed/testdriver"/>
39
    <property name="classes-j.dir" value="${temp.dir}/j/classes"/>
40

    
41
    <property name="jar-signer-certificate" value="codesigner.p12"/>
42

    
43
    <!-- following locations are relative to the destination directory -->
44

    
45
    <property name="build-hej.dir" value="${product.dir}/hej"/>
46
    <property name="build-pej.dir" value="${product.dir}/pej"/>
47
    <property name="build-eej.dir" value="${product.dir}/eej"/>
48
    
49

    
50
    <property name="javadoc.dir" value="${build-resources.dir}/doc/javadoc"/>
51

    
52

    
53
    <path id="classpath-j">
54
        <fileset dir="${lib.dir}">
55
            <include name="*.jar"/>
56
            <include name="asm-5.0.3/*.jar"/>
57
        </fileset>
58
    </path>
59

    
60

    
61
    <path id="classpath-samples">
62
        <fileset dir="${lib.dir}">
63
            <include name="*.jar"/>
64
        </fileset>
65
        <fileset dir="${build-eej.dir}">
66
            <include name="*.jar"/>
67
        </fileset>
68
        <!-- Substitute build-hej.dir if there is no requirement to compile the sample applications
69
             that depend on Saxon-EE -->
70
    </path>
71

    
72

    
73
    <target name="create-meta-inf" description="Create contents of META-INF/services files">
74

    
75
        <!-- given the Ant 1.7.0 bug, create the services files here for copying into the JARS -->
76
        <mkdir dir="${services.dir}/saxon9he/META-INF/services"/>
77
        <echo
78
            file="${services.dir}/saxon9he/META-INF/services/javax.xml.transform.TransformerFactory"
79
            message="net.sf.saxon.TransformerFactoryImpl"/>
80
        <mkdir dir="${services.dir}/saxon9he/META-INF/services"/>
81
        <!-- The peculiar format of these files is due to the bug described at
82
             http://markmail.org/message/obgfqbnrkuhzl6wl. The correct format is
83
             just to use the first line: this works for JDK 1.6. But JDK 1.5 incorrectly
84
             expects a properties file, in the form of the subsequent line. The combination
85
             works with both Java releases -->
86
        <!-- See also Saxon bug 1944.
87
             Decided that from 9.6 we will drop the services information for XPath.
88
        echo file="${services.dir}/saxon9he/META-INF/services/javax.xml.xpath.XPathFactory"
89
>net.sf.saxon.xpath.XPathFactoryImpl
90
http\://java.sun.com/jaxp/xpath/dom:    net.sf.saxon.xpath.XPathFactoryImpl
91
http\://saxon.sf.net/jaxp/xpath/om:     net.sf.saxon.xpath.XPathFactoryImpl
92
</echo>-->
93

    
94
        <mkdir dir="${services.dir}/saxon9pe/META-INF/services"/>
95
        <echo
96
            file="${services.dir}/saxon9pe/META-INF/services/javax.xml.transform.TransformerFactory"
97
            message="com.saxonica.config.ProfessionalTransformerFactory"/>
98
        <!--<echo file="${services.dir}/saxon9pe/META-INF/services/javax.xml.xpath.XPathFactory"
99
>com.saxonica.config.ProfessionalXPathFactory
100
http\://java.sun.com/jaxp/xpath/dom:    com.saxonica.config.ProfessionalXPathFactory
101
http\://saxon.sf.net/jaxp/xpath/om:     com.saxonica.config.ProfessionalXPathFactory
102
http\://www.xom.nu/jaxp/xpath/xom:      com.saxonica.config.ProfessionalXPathFactory
103
http\://jdom.org/jaxp/xpath/jdom:       com.saxonica.config.ProfessionalXPathFactory
104
http\://www.dom4j.org/jaxp/xpath/dom4j: com.saxonica.config.ProfessionalXPathFactory
105
</echo>-->
106

    
107

    
108
        <mkdir dir="${services.dir}/saxon9ee/META-INF/services"/>
109
        <echo
110
            file="${services.dir}/saxon9ee/META-INF/services/javax.xml.transform.TransformerFactory"
111
            message="com.saxonica.config.EnterpriseTransformerFactory"/>
112
        <!--<echo file="${services.dir}/saxon9ee/META-INF/services/javax.xml.xpath.XPathFactory"
113
>com.saxonica.config.EnterpriseXPathFactory
114
http\://java.sun.com/jaxp/xpath/dom:    com.saxonica.config.EnterpriseXPathFactory
115
http\://saxon.sf.net/jaxp/xpath/om:     com.saxonica.config.EnterpriseXPathFactory
116
http\://www.xom.nu/jaxp/xpath/xom:      com.saxonica.config.EnterpriseXPathFactory
117
http\://jdom.org/jaxp/xpath/jdom:       com.saxonica.config.EnterpriseXPathFactory
118
http\://www.dom4j.org/jaxp/xpath/dom4j: com.saxonica.config.EnterpriseXPathFactory
119
</echo>-->
120
        <echo file="${services.dir}/saxon9ee/META-INF/services/javax.xml.validation.SchemaFactory"
121
            >com.saxonica.ee.jaxp.SchemaFactoryImpl</echo>
122
        <!--<echo file="${services.dir}/saxon9ee/META-INF/services/javax.xml.validation.SchemaFactory"
123
>com.saxonica.jaxp.SchemaFactoryImpl
124
http\://www.w3.org/2001/XMLSchema: com.saxonica.jaxp.SchemaFactoryImpl
125
http\://www.w3.org/XML/XMLSchema: com.saxonica.jaxp.SchemaFactoryImpl
126
http\://www.w3.org/XML/XMLSchema/v1.0: com.saxonica.jaxp.SchemaFactoryImpl
127
http\://www.w3.org/XML/XMLSchema/v1.1: com.saxonica.jaxp.SchemaFactoryImpl
128
</echo>  -->
129
    </target>
130

    
131

    
132
    <target name="prepare-j" depends="create-meta-inf" />
133

    
134

    
135
    <target name="copysource-development-j"
136
        description="Copy relevant source files from development directory">
137
        <!--<copy todir="${temp-src-j.dir}">
138
            <fileset dir="${development-data.dir}">
139
                <include name="**/*.*"/>
140
            </fileset>
141
        </copy>-->
142
    </target>
143

    
144

    
145

    
146
    <target name="copysrc-hej">
147
        <mkdir dir="${temp-src-j.dir}/hej"/>
148
        <copy todir="${temp-src-j.dir}/hej">
149
            <fileset dir="${source-hej.dir}">
150
                <include name="net/sf/saxon/**/*.java"/>
151
                <exclude name="javax/xml/xquery/*.java"/>
152
                <exclude name="**/dotnet/**"/>
153
                <include name="net/sf/saxon/**/package.html"/>
154
                <exclude name="net/sf/saxon/testdriver/**"/>
155
                <exclude name="net/sf/saxon/option/sql/**"/>
156
                <include name="net/sf/saxon/data/**"/>
157
            </fileset>
158
            <!--<fileset dir="${source-eej.dir}">
159
              <include name="com/saxonica/testdriver/*.java"/> 
160
              <include name="com/saxonica/testdriver/gui/*.java"/>
161
              <exclude name="com/saxonica/testdriver/ActivateSaxon.java"/> 
162
          </fileset> -->
163
            
164
        </copy>
165
        <!--<mkdir dir="${temp-src-j.dir}/hej/data"/>
166
        <copy todir="${temp-src-j.dir}/hej/data">
167
            <fileset dir="${development-data.dir}">
168
                <include name="**/*.*"/>
169
                <exclude name="override.xsl"/>
170
                <exclude name="chameleon.xsl"/>
171
                <exclude name="json.xsd"/>
172
                <exclude name="xml-to-json*.xsl"/>
173
            </fileset>
174
        </copy>-->
175
        
176
    </target>
177

    
178
    <target name="copysrc-pej">
179
        <mkdir dir="${temp-src-j.dir}/pej"/>
180
        <copy todir="${temp-src-j.dir}/pej">
181
            <fileset dir="${source-hej.dir}">
182
                <include name="net/sf/saxon/**/*.java"/>
183
                <include name="javax/xml/xquery/*.java"/>
184
                <exclude name="**/dotnet/**"/>
185
                <include name="net/sf/saxon/**/package.html"/>
186
                <exclude name="net/sf/saxon/testdriver/**"/>
187
                <include name="net/sf/saxon/data/**"/>
188
            </fileset>
189
            <fileset dir="${source-eej.dir}">
190
                <include name="com/saxonica/**/*.java"/>
191
                <exclude name="com/saxonica/testdriver/**"/>
192
                <exclude name="com/saxonica/testdriver/ee/**/*.java"/>
193
                <exclude name="com/saxonica/testdriver/old/**/*.java"/>
194
                <exclude name="com/saxonica/ee/**"/>
195
                <exclude name="com/saxonica/config/EnterpriseConfiguration.java"/>
196
                <exclude name="com/saxonica/expr/CastToUnion.java"/>
197
                <exclude name="com/saxonica/expr/CastableToUnion.java"/>
198
                <exclude name="com/saxonica/expr/DotNetExtensionFunctionCall.java"/>
199
                <exclude name="com/saxonica/config/ee/**"/>
200
                <exclude name="com/saxonica/js/**"/>
201
                <exclude name="com/saxonica/config/DotNetExtensionLibrary.java"/>
202
                <exclude name="com/saxonica/config/DotNetExtensionFunctionFactory.java"/>
203
                <exclude name="com/saxonica/config/DotNetPlatformPE.java"/>
204
                <exclude name="com/saxonica/config/JavaPlatformEE.java"/>
205
                <exclude name="com/saxonica/config/JavaPlatformC.java"/>
206
                <exclude name="com/saxonica/Validate.java"/>
207
                <exclude name="com/saxonica/config/EnterpriseTransformerFactory.java"/>
208
                <exclude name="com/saxonica/config/StreamingTransformerFactory.java"/>
209
                <exclude name="com/saxonica/config/EnterpriseXPathFactory.java"/>
210
                <exclude name="com/saxonica/config/DynamicLoaderEE.java"/>
211
                <exclude name="com/saxonica/config/StandardSchemaResolver.java"/>
212
                <exclude name="com/saxonica/jaxp/SchemaFactoryImpl11.java"/>
213

    
214
            </fileset>
215
        </copy>
216
        <!--<mkdir dir="${temp-src-j.dir}/pej/data"/>
217
        <copy todir="${temp-src-j.dir}/pej/data">
218
            <fileset dir="${development-data.dir}">
219
                <include name="**/*.*"/>
220
                <exclude name="override.xsl"/>
221
                <exclude name="chameleon.xsl"/>
222
                <exclude name="json.xsd"/>
223
            </fileset>
224
        </copy>-->
225
    </target>
226

    
227
    <target name="copysrc-eej">
228
        <mkdir dir="${temp-src-j.dir}/eej"/>
229
        <copy todir="${temp-src-j.dir}/eej">
230
            <fileset dir="${source-hej.dir}">
231
                <include name="net/sf/saxon/**/*.java"/>
232
                <include name="javax/xml/xquery/*.java"/>
233
                <exclude name="**/dotnet/**"/>
234
                <include name="net/sf/saxon/**/package.html"/>
235
                <exclude name="net/sf/saxon/testdriver/**"/>
236
                <include name="net/sf/saxon/data/**"/>
237
            </fileset>
238
            <fileset dir="${source-eej.dir}">
239
                <include name="com/saxonica/**/*.java"/>
240
                <exclude name="com/saxonica/testdriver/**/*.java"/>
241
                <!--<exclude name="com/saxonica/config/pe/**"/>-->
242
                <exclude name="com/saxonica/config/DotNetExtensionFunctionFactory.java"/>
243
                <exclude name="com/saxonica/config/DotNetExtensionLibrary.java"/>
244
                <exclude name="com/saxonica/config/DotNetPlatformPE.java"/>
245
                <exclude name="com/saxonica/config/JavaPlatformC.java"/>
246
                <exclude name="com/saxonica/expr/DotNetExtensionFunctionCall.java"/>
247
                <include name="com/saxonica/**/package.html"/>
248
                <exclude name="com/saxonica/js/**"/>
249
            </fileset>
250
            <!--<fileset dir="${development-data.dir}">
251
                <include name="**/*.*"/>
252
            </fileset>-->
253
        </copy>
254
        <!--<mkdir dir="${temp-src-j.dir}/eej/data"/>
255
        <copy todir="${temp-src-j.dir}/eej/data">
256
            <fileset dir="${development-data.dir}">
257
                <include name="**/*.*"/>
258
            </fileset>
259
        </copy>-->
260
    </target>
261

    
262
    <target name="preprocess-hej" depends="copysrc-hej">
263
        <preprocess source="${temp-src-j.dir}/hej" destination="${temp-src-prep0-hej.dir}"
264
            verbose="false">
265
            <global name="EE" value="false"/>
266
            <global name="PE" value="false"/>
267
            <global name="DOTNET" value="false"/>
268
            <global name="OPT" value="false"/>
269
            <global name="SAXONC" value="false"/>
270
        </preprocess>
271
        <echo>Preprocessing hej complete.</echo>
272
        <copy todir="${temp-src-prep-hej.dir}">
273
           <fileset dir="${temp-src-prep0-hej.dir}"/>
274
           <filterchain>
275
              <linecontains negate="true">
276
                 <contains value="import com.saxonica"/>
277
              </linecontains>
278
           </filterchain>
279
       </copy>
280
        <echo>Import filtering for hej complete!</echo>
281
    </target>
282

    
283
    <target name="preprocess-android" depends="copysrc-eej">
284
        <preprocess source="${temp-src-j.dir}/eej" destination="${temp-src-prep-hej.dir}"
285
            verbose="false">
286
            <global name="HOF" value="true"/>
287
            <global name="STREAM" value="true"/>
288
        </preprocess>
289
        <replaceregexp match="import com\.saxonica\.bytecode(.*)" replace="" byline="yes">
290
            <fileset dir="${temp-src-prep-hej.dir}\net" includes="**/*.java"/>
291
        </replaceregexp>
292
        <replaceregexp match="import com\.saxonica\.bytecode(.*)" replace="" byline="yes">
293
            <fileset dir="${temp-src-prep-hej.dir}\com" includes="**/*.java"/>
294
        </replaceregexp>
295
        <delete dir="${temp-src-prep-hej.dir}/com/saxonica/bytecode"/>
296
        <delete dir="${temp-src-prep-hej.dir}/com/saxonica/testdriver"/>
297
        <echo>Preprocessing Android complete!</echo>
298
    </target>
299

    
300
    <target name="preprocess-pej" depends="copysrc-pej">
301
        <preprocess source="${temp-src-j.dir}/pej" destination="${temp-src-prep0-pej.dir}"
302
            verbose="false">
303
            <global name="DOTNET" value="false"/>
304
            <global name="HOF" value="true"/>
305
            <global name="SAXONC" value="false"/>
306
            <global name="PE" value="true"/>
307
            <global name="EE" value="false"/>
308
            <global name="OPT" value="false"/>
309
        </preprocess>
310
        <echo>Done preprocessing for PEJ.</echo>
311
        <copy todir="${temp-src-prep-pej.dir}">
312
           <fileset dir="${temp-src-prep0-pej.dir}"/>
313
           <filterchain>
314
              <linecontains negate="true">
315
                 <contains value="import com.saxonica.ee"/>
316
              </linecontains>
317
              <linecontains negate="true">
318
                 <contains value="import com.saxonica.config.ee"/>
319
              </linecontains>
320
           </filterchain>
321
        </copy>
322

    
323
       <echo>Import filtering for PEJ complete.</echo>
324

    
325
    </target>
326

    
327
    <target name="preprocess-eej" depends="copysrc-eej">
328
        <preprocess source="${temp-src-j.dir}/eej" destination="${temp-src-prep-eej.dir}"
329
            verbose="false">
330
            <global name="EE" value="true"/>
331
            <global name="PE" value="false"/>
332
            <global name="SAXONC" value="false"/>
333
            <global name="STREAM" value="true"/>
334
            <global name="PACKAGES" value="true"/>
335
            <global name="HOF" value="true"/>
336
            <global name="BYTECODE" value="true"/>
337
            <global name="SCHEMA" value="true"/>
338
            <global name="DOTNET" value="false"/>
339
            <global name="OPT" value="false"/>
340
        </preprocess>
341
    </target>
342

    
343
    <target name="compile-hej" description="Compile Saxon classes for the Java opensource product."
344
        depends="copysource-development-j, preprocess-hej">
345
        <mkdir dir="${classes-j.dir}/he"/>
346

    
347
        <javac debug="${build.debug}" debuglevel="${build.debuglevel}"
348
            deprecation="${build.deprecation}" destdir="${classes-j.dir}/he"
349
            optimize="${build.optimize}" srcdir="${temp-src-prep-hej.dir}"
350
            source="${build.compiler.source}" target="${build.compiler.target}" fork="true"
351
            memoryinitialsize="256m" memorymaximumsize="256m">
352

    
353
            <include name="net/**"/>
354
            <exclude name="net/sf/saxon/option/**/*.java"/>
355
            <!--<include name="com/saxonica/testdriver/**/*.java"/>-->
356

    
357
            <!--<exclude name="**/dotnet/**"/>-->
358
            <!--<exclude name="com/saxonica/validate/DotNetVerifier.java"/>-->
359
            <classpath>
360
                <path refid="classpath-j"/>
361
            </classpath>
362
        </javac>
363
    </target>
364

    
365
    <target name="compile-pej"
366
        description="Compile Saxon classes for the Java professional edition."
367
        depends="copysource-development-j, preprocess-pej">
368
        <mkdir dir="${classes-j.dir}/pe"/>
369

    
370
        <javac debug="${build.debug}" debuglevel="${build.debuglevel}"
371
            deprecation="${build.deprecation}" destdir="${classes-j.dir}/pe"
372
            optimize="${build.optimize}" srcdir="${temp-src-prep-pej.dir}"
373
            source="${build.compiler.source}" target="${build.compiler.target}" fork="true"
374
            memoryinitialsize="256m" memorymaximumsize="256m">
375

    
376
            <include name="net/**"/>
377
            <include name="javax/xml/xquery/**"/>
378
            <include name="com/saxonica/**"/>
379

    
380
            <classpath>
381
                <path refid="classpath-j"/>
382
            </classpath>
383
        </javac>
384
    </target>
385

    
386
    <target name="compile-eej" description="Compile Saxon classes for the Java enterprise edition."
387
        depends="copysource-development-j, preprocess-eej">
388
        <mkdir dir="${classes-j.dir}/ee"/>
389

    
390
        <javac debug="${build.debug}" debuglevel="${build.debuglevel}"
391
            deprecation="${build.deprecation}" destdir="${classes-j.dir}/ee"
392
            optimize="${build.optimize}" srcdir="${temp-src-prep-eej.dir}"
393
            source="${build.compiler.source}" target="${build.compiler.target}" fork="true"
394
            memoryinitialsize="256m" memorymaximumsize="256m" includeantruntime="false">
395

    
396
            <include name="net/**"/>
397
            <include name="javax/xml/xquery/**"/>
398
            <include name="com/saxonica/**"/>
399

    
400
            <classpath>
401
                <path refid="classpath-j"/>
402
            </classpath>
403
        </javac>
404
    </target>
405

    
406

    
407

    
408

    
409
    <target name="jar-hej" description="Create Saxon-HE jar files for Java" depends="testdrivers-j, compile-hej">
410
        <mkdir dir="${product.dir}/hej"/>
411
        <mkdir dir="${classes-j.dir}/he"/>
412

    
413
        <jar basedir="${classes-j.dir}/he" compress="${build.compress}"
414
            jarfile="${product.dir}/hej/saxon9he.jar">
415
            <include name="net/**/*.class"/>
416
            <exclude name="net/sf/saxon/option/**/*.class"/>
417
            <include name="META-INF/**"/>
418
            <manifest>
419
                <attribute name="Project-Name" value="Saxon-HE"/>
420
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
421
            </manifest>
422
            <metainf dir="${services.dir}/saxon9he/META-INF"/>
423
        </jar>
424

    
425
        <!-- add data files -->
426
        <jar basedir="${temp-src-j.dir}/hej" compress="${build.compress}"
427
            jarfile="${product.dir}/hej/saxon9he.jar" update="true">
428
            <include name="net/sf/saxon/data/**"/>
429
        </jar>
430

    
431
        <mkdir dir="${product.dir}/resources/drivers/java/classes"/>
432
        <javac debug="true" debuglevel="${build.debuglevel}"
433
               destdir="${product.dir}/resources/drivers/java/classes"
434
               srcdir="${product.dir}/resources/drivers/java" source="${build.compiler.source}"
435
               target="${build.compiler.target}">
436
            <include name="net/sf/saxon/testdriver/*.java"/>
437
            <classpath>
438
                <fileset dir="${lib.dir}">
439
                    <include name="*.jar"/>
440
                </fileset>
441
                <fileset dir="${build-hej.dir}">
442
                    <include name="*.jar"/>
443
                </fileset>
444
            </classpath>
445
        </javac>
446

    
447

    
448
        <copyfile dest="${product.dir}/resources/drivers/java/classes/com/saxonica/testdriver/gui/images/saxonica_logo.gif" src="${product.dir}/resources/drivers/java/com/saxonica/testdriver/gui/images/saxonica_logo.gif" />
449

    
450
        <!-- saxon9-test.jar -->
451
        <jar basedir="${product.dir}/resources/drivers/java/classes" compress="${build.compress}"
452
            jarfile="${product.dir}/hej/saxon9-test.jar">
453
            <include name="net/sf/saxon/testdriver/*.class"/>
454
            <!--<include name="com/saxonica/testdriver/gui/*.class"/>-->
455
            <manifest>
456
                <attribute name="Project-Name" value="Saxon-HE-TestDriver"/>
457
                <attribute name="Main-Class" value="com.saxonica.testdriver.gui.TestDriverGui"/>
458
            </manifest>
459
        </jar>
460

    
461
         <jar basedir="${classes-j.dir}/ee" compress="${build.compress}" jarfile="${product.dir}/hej/saxon9-xqj.jar">
462
            <include name="com/saxonica/xqj/**/*.class"/>
463
            <include name="javax/xml/xquery/**/*.class"/>
464
        </jar>
465

    
466
        <!--<jar basedir="${source-eej.dir}" compress="${build.compress}"
467
            jarfile="${product.dir}/hej/saxon9-test.jar" update="true">
468
            <include name="com/saxonica/testdriver/gui/images/**"/>
469
        </jar>-->
470

    
471
    </target>
472

    
473
    <target name="jar-pej" description="Create Saxon-PE jar files for Java"
474
        depends="testdrivers-j, compile-pej, jar-hej">
475
        <mkdir dir="${product.dir}/pej"/>
476
        <mkdir dir="${classes-j.dir}/pe"/>
477

    
478
        <jar basedir="${classes-j.dir}/pe" compress="${build.compress}"
479
            jarfile="${product.dir}/pej/saxon9pe.jar">
480
            <include name="net/**/*.class"/>
481
            <exclude name="net/sf/saxon/ant/*.class"/>
482
            <exclude name="**/sql/**/*.class"/>
483

    
484
            <include name="com/saxonica/**/*.class"/>
485
            <exclude name="com/saxonica/ee/**/*.class"/>
486
            <exclude name="com/saxonica/expr/CastToUnion.class"/>
487
            <exclude name="com/saxonica/expr/CastableToUnion.class"/>
488
            <exclude name="com/saxonica/expr/CastToList.class"/>
489
            <exclude name="com/saxonica/expr/CastableToList.class"/>
490
            <exclude name="com/saxonica/Validate.class"/>
491
            <exclude name="com/saxonica/CompileStylesheet.class"/>
492
            <exclude name="com/saxonica/CompileStylesheet$TracingObjectOutputStream.class"/>
493
            <exclude name="com/saxonica/config/EnterpriseConfiguration.class"/>
494
            <exclude name="com/saxonica/config/EnterpriseConfiguration$SurrogateSchema.class"/>
495
            <exclude name="com/saxonica/config/EnterpriseTransformerFactory.class"/>
496
            <exclude name="com/saxonica/config/StreamingTransformerFactory.class"/>
497
            <exclude name="com/saxonica/config/EnterpriseXPathFactory.class"/>
498

    
499
            <include name="javax/xml/xquery/*.class"/>
500

    
501
            <manifest>
502
                <attribute name="Project-Name" value="Saxon-PE"/>
503
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
504
            </manifest>
505
            <metainf dir="${services.dir}/saxon9pe/META-INF"/>
506

    
507
        </jar>
508
        
509
        <!-- add data files -->
510
        <jar basedir="${temp-src-j.dir}/pej" compress="${build.compress}"
511
            jarfile="${product.dir}/pej/saxon9pe.jar" update="true">
512
            <include name="net/sf/saxon/data/**"/>
513
        </jar>
514
        <!--<jar basedir="${development-data.dir}" compress="${build.compress}"
515
            jarfile="${product.dir}/pej/saxon9pe.jar" update="true">
516
            <include name="**"/>
517
        </jar>-->
518

    
519
        <!-- Include the ICU jar separately -->
520
        <copy file="${lib.dir}/icu4j-59_1.jar" todir="${product.dir}/pej" />
521

    
522
        <!-- <jar basedir="${classes-j.dir}/pe" compress="${build.compress}" jarfile="${product.dir}/pej/saxon9pe.jar" update="true">
523
            <include name="edition.properties"/>
524
        </jar>  -->
525
        <jar basedir="${classes-j.dir}/pe" compress="${build.compress}"
526
            jarfile="${product.dir}/pej/saxon9-sql.jar">
527
            <include name="net/sf/saxon/option/sql/*.class"/>
528
        </jar>
529

    
530
        <jar basedir="${classes-j.dir}/pe" compress="${build.compress}"
531
            jarfile="${product.dir}/pej/saxon9-sql.jar">
532
            <include name="net/sf/saxon/option/sql/*.class"/>
533
        </jar>
534

    
535
        <mkdir dir="${product.dir}/resources/drivers/java/classes"/>
536
        <javac debug="true" debuglevel="${build.debuglevel}"
537
               destdir="${product.dir}/resources/drivers/java/classes"
538
               srcdir="${product.dir}/resources/drivers/java" source="${build.compiler.source}"
539
               target="${build.compiler.target}">
540
            <include name="**/*.java"/>
541
            <classpath>
542
                <path refid="classpath-samples"/>
543
            </classpath>
544
        </javac>
545

    
546

    
547
        <copyfile dest="${product.dir}/resources/drivers/java/classes/com/saxonica/testdriver/gui/images/saxonica_logo.gif" src="${product.dir}/resources/drivers/java/com/saxonica/testdriver/gui/images/saxonica_logo.gif" />
548

    
549
        <!-- saxon9pe-test.jar -->
550
        <jar basedir="${product.dir}/resources/drivers/java/classes" compress="${build.compress}"
551
            jarfile="${product.dir}/pej/saxon9pe-test.jar">
552
            <include name="net/sf/saxon/testdriver/*.class"/>
553
            <include name="com/saxonica/testdriver/gui/*.class"/>
554
            <include name="com/saxonica/testdriver/*.class"/>
555
            <include name="com/saxonica/testdriver/gui/images/**"/>
556
            <manifest>
557
                <attribute name="Project-Name" value="Saxon-PE-TestDriver"/>
558
                <attribute name="Main-Class" value="com.saxonica.testdriver.gui.TestDriverForm"/>
559
            </manifest>
560
        </jar>
561

    
562
        <!-- <jar basedir="${source-eej.dir}" compress="${build.compress}"
563
            jarfile="${product.dir}/pej/saxon9pe-test.jar" update="true">
564
            <include name="com/saxonica/testdriver/gui/images/**"/>
565
        </jar>   -->
566

    
567
    </target>
568

    
569
   
570
    <target name="jar-eej" description="Create Saxon-EE jar files for Java" depends="testdrivers-j, compile-eej">
571
        <mkdir dir="${product.dir}/eej"/>
572
        <mkdir dir="${classes-j.dir}/ee"/>
573

    
574

    
575
        <jar basedir="${classes-j.dir}/ee" compress="${build.compress}"
576
            jarfile="${product.dir}/eej/saxon9-sql.jar">
577
            <include name="net/sf/saxon/option/sql/*.class"/>
578
        </jar>
579

    
580
        <!-- Put the SQL extensions in a separate jar -->
581
        <jar basedir="${classes-j.dir}/ee" compress="${build.compress}"
582
            jarfile="${product.dir}/eej/saxon9-sql.jar">
583
            <include name="net/sf/saxon/option/sql/*.class"/>
584
        </jar>
585
        
586
        <!-- Put the classes and data for StatsTransform in a separate jar -->
587
        <jar basedir="${stats-data.dir}" compress="${build.compress}"
588
            jarfile="${product.dir}/eej/saxon9-stats.jar">
589
            <include name="**"/>
590
        </jar>
591
        <jar basedir="${classes-j.dir}/ee" compress="${build.compress}"
592
            jarfile="${product.dir}/eej/saxon9-stats.jar" update="true">
593
            <include name="com/saxonica/StatsTransform*.class"/>
594
        </jar>
595

    
596
        <!-- Include the ICU jar separately -->
597
        <copy file="${lib.dir}/icu4j-59_1.jar" todir="${product.dir}/eej" />
598

    
599

    
600
        <!-- Build EEJ using jarjar to rename the ASM classes into a different package name, to allow coexistence with
601
             other ASM versions -->
602

    
603
        <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
604
            classpath="../lib/jarjar-1.1.jar"/>
605
        <jarjar basedir="${classes-j.dir}/ee" compress="${build.compress}"
606
            jarfile="${product.dir}/eej/saxon9ee.jar">
607
            <include name="net/**/*.class"/>
608
            <exclude name="**/sql/**/*.class"/>
609
            <include name="com/saxonica/**/*.class"/>
610
            <exclude name="com/saxonica/StatsTransform*.class"/>            
611
            <include name="javax/xml/xquery/*.class"/>
612
            <rule pattern="org.objectweb.**" result="com.saxonica.objectweb.@1"/>
613
            <manifest>
614
                <attribute name="Project-Name" value="Saxon-EE"/>
615
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
616
            </manifest>
617
            <metainf dir="${services.dir}/saxon9ee/META-INF"/>
618
            <!-- </jar> -->
619
        </jarjar>
620

    
621

    
622
        <!-- Include the ASM library, renamed into Saxonica space to avoid conflict with other versions -->
623
        <jarjar compress="${build.compress}" jarfile="${product.dir}/eej/saxon9ee.jar" update="true">
624
            <zipfileset src="${lib.dir}/asm-${asm.version}/asm-${asm.version}.jar"/>
625
            <zipfileset src="${lib.dir}/asm-${asm.version}/asm-analysis-${asm.version}.jar"/>
626
            <zipfileset src="${lib.dir}/asm-${asm.version}/asm-commons-${asm.version}.jar"/>
627
            <zipfileset src="${lib.dir}/asm-${asm.version}/asm-tree-${asm.version}.jar"/>
628
            <zipfileset src="${lib.dir}/asm-${asm.version}/asm-util-${asm.version}.jar"/>
629
            <rule pattern="org.objectweb.**" result="com.saxonica.objectweb.@1"/>
630
        </jarjar>
631

    
632
        <!--<jar basedir="${classes-j.dir}/ee" compress="${build.compress}" jarfile="${product.dir}/eej/saxon9ee.jar" update="true">
633
            <include name="edition.properties"/>
634
        </jar>      -->
635
        <!--<jar basedir="${development-data.dir}" compress="${build.compress}"
636
            jarfile="${product.dir}/eej/saxon9ee.jar" update="true">
637
            <include name="**"/>
638
        </jar>-->
639
        <jar basedir="${temp-src-j.dir}/eej" compress="${build.compress}"
640
            jarfile="${product.dir}/eej/saxon9ee.jar" update="true">
641
            <include name="net/sf/saxon/data/**"/>
642
        </jar>
643

    
644
        <mkdir dir="${product.dir}/resources/drivers/java/classes"/>
645
        <javac debug="true" debuglevel="${build.debuglevel}"
646
               destdir="${product.dir}/resources/drivers/java/classes"
647
               srcdir="${product.dir}/resources/drivers/java" source="${build.compiler.source}"
648
               target="${build.compiler.target}">
649
            <include name="**/*.java"/>
650
            <classpath>
651
                <path refid="classpath-samples"/>
652
            </classpath>
653
        </javac>
654

    
655
        <copyfile dest="${product.dir}/resources/drivers/java/classes/com/saxonica/testdriver/gui/images/saxonica_logo.gif" src="${product.dir}/resources/drivers/java/com/saxonica/testdriver/gui/images/saxonica_logo.gif" />
656

    
657
        <!-- saxon9ee-test.jar -->
658
        <jar basedir="${product.dir}/resources/drivers/java/classes" compress="${build.compress}"
659
            jarfile="${product.dir}/eej/saxon9ee-test.jar">
660
            <include name="net/sf/saxon/testdriver/*.class"/>
661
            <include name="com/saxonica/testdriver/gui/*.class"/>
662
            <include name="com/saxonica/testdriver/*.class"/>
663
            <include name="com/saxonica/testdriver/gui/images/**"/>
664
            <manifest>
665
                <attribute name="Project-Name" value="Saxon-EE-TestDriver"/>
666
                <attribute name="Main-Class" value="com.saxonica.testdriver.gui.TestDriverForm"/>
667
            </manifest>
668
        </jar>
669
       <!-- <jar basedir="${product.dir}/resources/drivers/java/com/saxonica/testdriver/gui" compress="${build.compress}"
670
            jarfile="${product.dir}/hej/saxon9he.jar" update="true">
671
            <include name="**"/>
672
        </jar>   -->
673

    
674
    </target>
675

    
676

    
677
    <target name="maven" description="Build files ready for maven" depends="copysource-development-j, jar-eej,compile-hej">
678
       <mkdir dir="${product.dir}/maven" />
679
        <mkdir dir="${product.dir}/maven/javadoc" />
680

    
681
       <copyfile dest="${product.dir}/maven/Saxon-HE-${version.maven}.pom" src="../maven/${version}/Saxon-HE-${version.maven}.pom" />
682
       <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="../lib/jarjar-1.1.jar"/>
683
       <jar basedir="${temp-src-prep-hej.dir}" compress="true" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}-sources.jar">
684
           <include name="net/**/*.java"/>
685
           <include name="net/**/package.html"/>
686
       </jar>
687

    
688

    
689
        <jar basedir="${temp-src-prep-eej.dir}" compress="${build.compress}" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}-sources.jar" update="true">
690
                   <include name="com/saxonica/xqj/**"/>
691
                   <include name="javax/xml/xquery/**"/>
692
        </jar>
693

    
694
        <!--<jar basedir="${development-data.dir}" compress="true" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}-sources.jar" update="true">
695
            <include name="**"/>
696
        </jar>-->
697
        <jar basedir="${temp-src-j.dir}/hej" compress="true"
698
            jarfile="${product.dir}/maven/Saxon-HE-${version.maven}-sources.jar" update="true">
699
            <include name="net/sf/saxon/data/**"/>
700
        </jar>
701

    
702

    
703
      <jar basedir="${classes-j.dir}/he" compress="${build.compress}" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}.jar">
704
            <include name="net/**/*.class"/>
705
            <exclude name="net/sf/saxon/option/**/*.class"/>
706
            <!--<exclude name="**/javax/**/*.class"/>
707
            <exclude name="**/xpath/**/*.class"/>-->
708
            <exclude name="**/xqj/**/*.class"/>
709
            <exclude name="javax/xml/xquery/*.class"/>
710
            <include name="META-INF/**"/>
711
            <manifest>
712
                <attribute name="Project-Name" value="Saxon-HE"/>
713
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
714
            </manifest>
715
            <metainf dir="${services.dir}/saxon9he/META-INF"/>
716
            <!--<metainf dir="${services.dir}/saxon9-xpath/META-INF"/>-->
717
            <!--
718
            <service type="javax.xml.transform.TransformerFactory"
719
                provider="net.sf.saxon.TransformerFactoryImpl"/>
720
            -->
721
        </jar>
722

    
723
        <jar basedir="${classes-j.dir}/ee" compress="${build.compress}" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}-xqj.jar">
724
            <include name="com/saxonica/xqj/**/*.class"/>
725
            <include name="javax/xml/xquery/**/*.class"/>
726
        </jar>
727

    
728
        <!-- <jar basedir="${classes-j.dir}/he" compress="${build.compress}" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}.jar" update="true">
729
            <include name="**"/>
730
        </jar> -->
731
  
732

    
733
       <!-- <jar basedir="${classes-j.dir}/he" compress="true" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}-compressed.jar">
734
            <include name="net/**/*.class"/>
735
            <exclude name="net/sf/saxon/option/**/*.class"/>
736

737
            <exclude name="**/xqj/**/*.class"/>
738
            <exclude name="javax/xml/xquery/*.class"/>
739
            <include name="META-INF/**"/>
740
            <manifest>
741
                <attribute name="Project-Name" value="Saxon-HE"/>
742
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
743
            </manifest>
744
            <metainf dir="${services.dir}/saxon9he/META-INF"/>
745

746
        </jar>      -->
747

    
748
        <javadoc bottom="Copyright (c) 2004-2017 Saxonica Limited. All rights reserved."
749
            destdir="${product.dir}/maven/javadoc" doctitle="Saxon9 Java API Documentation" noindex="false"
750
            notree="false" access="protected" maxmemory="512M" source="1.5">
751
            <packageset dir="${temp-src-j.dir}/hej">
752
                <include name="net/**"/>
753

    
754
                <include name="javax/xml/query/**"/>
755
                <exclude name="net/sf/saxon/testdriver/**"/>
756
                <exclude name="**/dotnet/**"/>
757
                <exclude name="**/DotNetVerifier.java"/>
758
            </packageset>
759
            <packageset dir="${repository}/lib/xqj-final/ri/src"/>
760
            <classpath>
761
                <path refid="classpath-j"/>
762
            </classpath>
763

    
764
            <link href="http://download.oracle.com/javase/6/docs/api/"/>
765
            <link href="http://www.xom.nu/apidocs/"/>
766

    
767
            <group title="s9api Interface" packages="net.sf.saxon.s9api"/>
768
            <group title="Other Interfaces">
769
                <package name="net.sf.saxon"/>
770
                <package name="net.sf.saxon.lib"/>
771
                <package name="net.sf.saxon.om"/>
772
                <package name="net.sf.saxon.query"/>
773
                <package name="net.sf.saxon.sxpath"/>
774
                <package name="net.sf.saxon.value"/>
775
                <package name="net.sf.saxon.type"/>
776
                <package name="net.sf.saxon.xpath"/>
777
                <package name="net.sf.saxon.xqj"/>
778

    
779
            </group>
780
            <group title="External Interfaces">
781
                <package name="javax.xml.xquery"/>
782
            </group>
783

    
784

    
785
        </javadoc>
786

    
787
        <copy file="${userdoc.dir}/saxon9/fixed/javadoc/stylesheet.css"
788
            tofile="${product.dir}/maven/javadoc/stylesheet.css" overwrite="true"/>
789

    
790
        <jar basedir="${product.dir}/maven/javadoc" compress="true" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}-javadoc.jar" update="true">
791
            <include name="**/*" />
792
        </jar>
793

    
794
       <delete dir="${product.dir}/maven/javadoc" />
795

    
796
                <!-- add data files -->
797
        <!-- <jar basedir="${development-data.dir}" compress="true" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}-compressed.jar" update="true">
798
            <include name="**"/>
799
        </jar> -->
800

    
801
        <jar basedir="${development-data.dir}" compress="true" jarfile="${product.dir}/maven/Saxon-HE-${version.maven}.jar" update="true">
802
            <include name="**"/>
803
        </jar>
804

    
805
        <echo message="${build.compress}"/>
806
    </target>
807

    
808

    
809
    
810
    <target name="jar-j" depends="jar-eej, jar-hej, jar-pej"/>
811

    
812
    <target name="samples-j" description="Copy and Compile Java Samples"
813
        depends="config-sample, samples-common">
814
        <mkdir dir="${product.dir}/resources/samples/java/he"/>
815
        <mkdir dir="${product.dir}/resources/samples/java/classes/he"/>
816
        <mkdir dir="${product.dir}/resources/samples/java/ee"/>
817
        <mkdir dir="${product.dir}/resources/samples/java/classes/ee"/>
818
        <copy todir="${product.dir}/resources/samples/java/he">
819
            <fileset dir="${samples.dir}/java/he">
820
                <include name="ApplyXPathJAXP.java"/>
821
                <include name="ExampleContentHandler.java"/>
822
                <include name="QueryAPIExamples.java"/>
823
                <include name="S9APIExamples.java"/>
824
                <include name="SaxonServlet.java"/>
825
                <include name="JAXPExamples.java"/>
826
                <include name="XPathExample.java"/>
827
                <include name="XPathExampleDOM.java"/>
828
                <include name="XPathExampleServlet.java"/>
829
            </fileset>
830
        </copy>
831
        <javac debug="true" debuglevel="${build.debuglevel}"
832
            destdir="${product.dir}/resources/samples/java/classes"
833
            srcdir="${product.dir}/resources/samples/java/he" source="${build.compiler.source}"
834
            target="${build.compiler.target}" includeantruntime="false">
835
            <include name="*.java"/>
836
            <classpath>
837
                <path refid="classpath-samples"/>
838
            </classpath>
839
        </javac>
840
        <copy todir="${product.dir}/resources/samples/java/ee">
841
            <fileset dir="${samples.dir}/java/ee">
842
                <include name="JDOM2Example.java"/>
843
                <include name="PullExamples.java"/>
844
                <include name="QuickValidator.java"/>
845
                <include name="SaxonSAServlet.java"/>
846
                <include name="SchemaValidatorExample.java"/>
847
                <include name="SchemaValidatorHandlerExample.java"/>
848
                <include name="XMarkBenchmark.java"/>
849
                <include name="XPathExampleSA.java"/>
850
                <include name="XQJExamples.java"/>
851
            </fileset>
852
        </copy>
853
        <javac debug="true" debuglevel="${build.debuglevel}"
854
               destdir="${product.dir}/resources/samples/java/classes"
855
               srcdir="${product.dir}/resources/samples/java/ee" source="${build.compiler.source}"
856
               target="${build.compiler.target}" includeantruntime="false">
857
            <include name="*.java"/>
858
            <classpath>
859
                <path refid="classpath-samples"/>
860
            </classpath>
861
        </javac>
862
    </target>
863

    
864
    <target name="config-sample" description="Generate annotated configuration file schema in samples">
865
        <xslt in="${featureKeys.dir}/FeatureKeys.xml" out="${samples.dir}/config/annotatedConfig.xsd"
866
              style="${featureKeys.dir}/FeatureKeysToSchema.xsl" classpathref="saxon.class.path">
867
            <param name="FeatureKeys" expression="FeatureKeys.xml"/>
868
            <param name="AdditionalFeatures" expression="AdditionalFeatures.xml"/>
869
            <param name="ConfigSchema" expression="${samples.uri}/config/config.xsd"/>
870
            <factory name="com.saxonica.config.EnterpriseTransformerFactory">
871
                <attribute name="http://saxon.sf.net/feature/licenseFileLocation"
872
                           value="${saxon.license}"/>
873
                <attribute name="http://saxon.sf.net/feature/initialTemplate" value="main"/>
874
            </factory>
875
        </xslt>
876
        <!-- Touch to ensure that the annotatedConfig.xsd schema is always
877
         regenerated when running this target.
878
         (Otherwise a change in config.xsd only would not automatically be picked up.)-->
879
        <touch file="${featureKeys.dir}/FeatureKeys.xml"/>
880
    </target>
881

    
882
    <target name="preprocess-testdriver-j">
883
        <mkdir dir="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver"/>
884
        <mkdir dir="${temp-src-prep-test.dir}/pej/com/saxonica/testdriver"/>
885
        <mkdir dir="${temp-src-prep-test.dir}/eej/com/saxonica/testdriver"/>
886
        <copy todir="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver">
887
            <fileset dir="${source-eej.dir}/com/saxonica/testdriver">
888
                <exclude name="com/saxonica/testdriver/FOTestSuiteDriver.java"/>
889
                <exclude name="com/saxonica/testdriver/XQueryTestSuiteDriver.java"/>
890
                <exclude name="com/saxonica/testdriver/XsltTestSuiteDriver.java"/>
891
                <exclude name="com/saxonica/testdriver/XQTSModuleURIResolver.java"/>
892
                <exclude name="com/saxonica/testdriver/XQTSCollectionURIResolver.java"/>
893
                <exclude name="com/saxonica/testdriver/SchemaTestSuiteDriver.java"/>
894
            </fileset>
895
        </copy>
896

    
897
        <copy todir="${temp-src-prep-test.dir}/pej/com/saxonica/testdriver">
898
            <fileset dir="${source-eej.dir}/com/saxonica/testdriver">
899
                <exclude name="com/saxonica/testdriver/XsltTestSuiteDriver.java"/>
900
                <exclude name="com/saxonica/testdriver/XQTSModuleURIResolver.java"/>
901
                <exclude name="com/saxonica/testdriver/XQTSCollectionURIResolver.java"/>
902
                <exclude name="com/saxonica/testdriver/SchemaTestSuiteDriver.java"/>
903
            </fileset>
904
        </copy>
905

    
906
        <copy todir="${temp-src-prep-test.dir}/eej/com/saxonica/testdriver">
907
            <fileset dir="${source-eej.dir}/com/saxonica/testdriver"/>
908

    
909
        </copy>
910
        <!--<preprocess source="${source-eej.dir}/com/saxonica/testdriver"
911
            destination="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver" verbose="true">
912
            <global name="EE" value="false"/>
913
            <global name="PE" value="false"/>
914
            <global name="OPT" value="false"/>
915
            <global name="DOTNET" value="false"/>
916
        </preprocess>
917
        <replaceregexp match="import com\.saxonica\.config\.EnterpriseConfiguration(.*)" replace=""
918
            flags="g">
919
            <fileset dir="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver"
920
                includes="**/*.java"/>
921
        </replaceregexp>
922
        <replaceregexp match="import com\.saxonica(.*)" replace="" flags="g">
923
            <fileset file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/Environment.java"
924
                includes="**/*.java"/>
925
        </replaceregexp>
926
        <replaceregexp match="import net\.sf\.saxon\.option(.*)" replace="" flags="g" byline="true">
927
            <fileset dir="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver"
928
                includes="**/*.java"/>
929
        </replaceregexp>
930
        <replaceregexp match="import com\.saxonica\.config\.ProfessionalConfiguration(.*)"
931
            replace="" flags="g">
932
            <fileset dir="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver"
933
                includes="**/*.java"/>
934
        </replaceregexp>
935
        <replaceregexp match="import com\.saxonica\.config\.EnterpriseTransformerFactory(.*)"
936
            replace="" flags="g">
937
            <fileset dir="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver"
938
                includes="**/*.java"/>
939
        </replaceregexp>-->
940
        <delete
941
            file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/SchemaTestSuiteDriver.java"/>
942
        <delete
943
            file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/UpdateTestSuiteDriver.java"/>
944
        <delete
945
            file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/XQueryTestSuiteDriver.java"/>
946
        <delete
947
            file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/XsltTestSuiteDriver.java"/>
948
        <delete file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/XMarkBenchmark.java"/>
949
        <echo>Preprocessing test-driver-hej complete!</echo>
950

    
951
        <!--<preprocess source="${source-eej.dir}/com/saxonica/testdriver"
952
            destination="${temp-src-prep-test.dir}/pej/com/saxonica/testdriver" verbose="true">
953
            <global name="EE" value="false"/>
954
            <global name="PE" value="true"/>
955
            <global name="OPT" value="true"/>
956
            <global name="DOTNET" value="false"/>
957
        </preprocess>
958
        <replaceregexp match="import com\.saxonica\.config\.EnterpriseConfiguration(.*)" replace=""
959
            flags="g">
960
            <fileset dir="${temp-src-prep-test.dir}/pej/com/saxonica/testdriver"
961
                includes="**/*.java"/>
962
        </replaceregexp>
963
        <replaceregexp match="import com\.saxonica\.config\.EnterpriseTransformerFactory(.*)"
964
            replace="" flags="g">
965
            <fileset dir="${temp-src-prep-test.dir}/pej/com/saxonica/testdriver"
966
                includes="**/*.java"/>
967
        </replaceregexp>-->
968
        <delete
969
            file="${temp-src-prep-test.dir}/pej/com/saxonica/testdriver/SchemaTestSuiteDriver.java"/>
970
        <delete
971
            file="${temp-src-prep-test.dir}/pej/com/saxonica/testdriver/UpdateTestSuiteDriver.java"/>
972
        <delete
973
            file="${temp-src-prep-test.dir}/pej/com/saxonica/testdriver/XQueryTestSuiteDriver.java"/>
974
        <!--<delete file="${temp-src-prep-test.dir}/pej/XQueryTestSuiteDriver.java" />-->
975
        <echo>Preprocessing test-driver-pej complete!</echo>
976

    
977
        <!--<preprocess source="${source-eej.dir}/com/saxonica/testdriver"
978
            destination="${temp-src-prep-test.dir}/eej/com/saxonica/testdriver" verbose="true">
979
            <global name="EE" value="true"/>
980
            <global name="PE" value="true"/>
981
            <global name="OPT" value="true"/>
982
            <global name="DOTNET" value="false"/>
983
        </preprocess>-->
984
        <echo>Preprocessing test-driver-eej complete!</echo>
985
    </target>
986

    
987
    <target name="testdrivers-j" description="Copy Java Test Drivers">
988
        <mkdir dir="${product.dir}/resources/drivers/java"/>
989

    
990
        <copy todir="${product.dir}/resources/drivers/java">
991
            <fileset dir="${source-eej.dir}">
992
                <include name="com/saxonica/testdriver/ee/*.java"/>
993
                <include name="com/saxonica/testdriver/gui/**"/>
994
                <include name="com/saxonica/testdriver/QT3TestDriverPE.java"/>
995
                <include name="com/saxonica/testdriver/XMarkBenchmark.java"/>
996
                <include name="com/saxonica/testdriver/Xslt30TestSuiteDriver.java"/>
997
                <include name="com/saxonica/testdriver/Xslt30TestSuiteDriverPE.java"/>
998
         <!-- jwL -->     <!--  <include name="com/saxonica/testdriver/TestDriverShell.java"/> -->
999
                <!-- jwL -->       <include name="com/saxonica/testdriver/Licensor.java"/>
1000

    
1001
            </fileset>
1002
            <fileset dir="${source-hej.dir}">
1003
                  <include name="net/sf/saxon/testdriver/*.java"/>
1004
            </fileset>
1005
        </copy>
1006

    
1007
    </target>
1008

    
1009
    <!-- Builds the HTML javadoc in resources/doc/javadoc dir -->
1010
    <target name="product-javadoc" description="Generate Javadoc"
1011
        depends="copysource-development-j">
1012
        <javadoc bottom="Copyright (c) 2004-2017 Saxonica Limited. All rights reserved."
1013
            destdir="${javadoc.dir}" doctitle="Saxon9 Java API Documentation" noindex="false"
1014
            notree="false" access="protected" maxmemory="512M" source="1.5">
1015
            <packageset dir="${temp-src-j.dir}/eej">
1016
                <include name="net/**"/>
1017
                <include name="com/**"/>
1018
                <include name="javax/xml/query/**"/>
1019
                <exclude name="com/saxonica/testdriver/**"/>
1020
                <exclude name="net/sf/saxon/testdriver/**"/>
1021
                <exclude name="**/dotnet/**"/>
1022
                <exclude name="**/DotNetVerifier.java"/>
1023
            </packageset>
1024
            <packageset dir="${repository}/lib/xqj-final/ri/src"/>
1025
            <classpath>
1026
                <path refid="classpath-j"/>
1027
            </classpath>
1028

    
1029
            <link href="http://download.oracle.com/javase/6/docs/api/"/>
1030
            <link href="http://www.xom.nu/apidocs/"/>
1031

    
1032
            <group title="s9api Interface" packages="net.sf.saxon.s9api"/>
1033
            <group title="Other Interfaces">
1034
                <package name="net.sf.saxon"/>
1035
                <package name="net.sf.saxon.lib"/>
1036
                <package name="net.sf.saxon.om"/>
1037
                <package name="net.sf.saxon.query"/>
1038
                <package name="net.sf.saxon.sxpath"/>
1039
                <package name="net.sf.saxon.value"/>
1040
                <package name="net.sf.saxon.type"/>
1041
                <package name="net.sf.saxon.xpath"/>
1042
                <package name="net.sf.saxon.xqj"/>
1043
                <package name="com.saxonica.config"/>
1044
                <package name="com.saxonica.jaxp"/>
1045
                <package name="com.saxonica.schema"/>
1046

    
1047
            </group>
1048
            <group title="External Interfaces">
1049
                <package name="javax.xml.xquery"/>
1050
            </group>
1051
        </javadoc>
1052
        <copy file="${userdoc.dir}/saxon9/fixed/javadoc/stylesheet.css"
1053
            tofile="${javadoc.dir}/stylesheet.css" overwrite="true"/>
1054
    </target>
1055

    
1056

    
1057

    
1058

    
1059

    
1060
    <target name="signjars" depends="jar-j, copy-notices, maven, private-signjars, private-maven-signjars"
1061
        description="Sign all JAR files">
1062
        <!-- If the private-signjars task is not available, simply delete the dependency -->
1063
    </target>
1064

    
1065

    
1066
    <target name="j" depends="signjars"
1067
        description="Generate Saxon (all three editions) for the Java platform"/>
1068

    
1069
    <target name="release-j" description="Create .ZIP files for release" depends="j">
1070
        <!-- , test-j -->
1071
        <mkdir dir="${issue.dir}"/>
1072
        <zip zipfile="${issue.dir}/SaxonHE${versionh}J.zip">
1073
            <fileset dir="${product.dir}/hej"/>
1074
        </zip>
1075
        <zip zipfile="${issue.dir}/SaxonPE${versionh}J.zip">
1076
            <fileset dir="${product.dir}/pej"/>
1077
        </zip>
1078
        <zip zipfile="${issue.dir}/SaxonEE${versionh}J.zip">
1079
            <fileset dir="${product.dir}/eej"/>
1080
        </zip>
1081
    </target>
1082

    
1083

    
1084
</project>
(2-2/5)