Project

Profile

Help

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

he / latest9.3 / build / build-j.xml @ master

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">
5
    
6
    <!-- Build file for Saxon on the Java platform. This build file is designed to be imported
7
         from build.xml -->
8
    
9
        <import file="build-constants.xml"/>                           
10
    
11
        <!-- Import of private Saxonica build file for signing the issued JARs (task private-signjars). -->
12
        <!-- This can be replaced by a reference to different signing tool -->
13
        
14
        <import file="c:/MyJava/build/build-j-signer.xml"/>                           
15
    
16
    
17
    <!-- directory holding Java test drivers -->
18
    <property name="drivers-j.dir" value="c:/MyJava/testcode/test"/>                    
19
                    
20

    
21
    
22
    <!-- following locations are relative to the build file -->
23
        
24
    <property name="services.dir" value="services"/>
25
    <property name="temp-src-j.dir" value="${temp.dir}/j/source"/>
26
    <property name="classes-j.dir" value="${temp.dir}/j/classes"/>
27
    
28
    <property name="jar-signer-certificate" value="codesigner.p12"/> 
29

    
30
    <!-- following locations are relative to the destination directory -->
31
                
32
    <property name="build-hej.dir" value="${product.dir}/hej"/> 
33
    <property name="build-pej.dir" value="${product.dir}/pej"/>  
34
    <property name="build-eej.dir" value="${product.dir}/eej"/> 
35

    
36
    <property name="javadoc.dir" value="${build-resources.dir}/doc/javadoc"/>   
37
    
38
    
39
    <path id="classpath-j">
40
        <fileset dir="${lib.dir}">
41
            <include name="*.jar"/>
42
        </fileset>
43
    </path>
44
        
45
     
46
    <path id="classpath-samples">
47
        <fileset dir="${lib.dir}">
48
            <include name="*.jar"/>
49
        </fileset>
50
        <fileset dir="${build-eej.dir}">
51
            <include name="*.jar"/>
52
        </fileset>
53
        <!-- Substitute build-hej.dir if there is no requirement to compile the sample applications
54
             that depend on Saxon-EE -->
55
    </path> 
56

    
57

    
58
    <target name="create-meta-inf" description="Create contents of META-INF/services files">    
59
        
60
        <!-- given the Ant 1.7.0 bug, create the services files here for copying into the JARS -->
61
        <mkdir dir="${services.dir}/saxon9he/META-INF/services"/>
62
        <echo file="${services.dir}/saxon9he/META-INF/services/javax.xml.transform.TransformerFactory"
63
              message="net.sf.saxon.TransformerFactoryImpl"/>
64
        <mkdir dir="${services.dir}/saxon9he/META-INF/services"/>
65
        <!-- The peculiar format of these files is due to the bug described at
66
             http://markmail.org/message/obgfqbnrkuhzl6wl. The correct format is
67
             just to use the first line: this works for JDK 1.6. But JDK 1.5 incorrectly
68
             expects a properties file, in the form of the subsequent line. The combination
69
             works with both Java releases -->
70
        <echo file="${services.dir}/saxon9he/META-INF/services/javax.xml.xpath.XPathFactory"
71
>net.sf.saxon.xpath.XPathFactoryImpl
72
http\://java.sun.com/jaxp/xpath/dom:    net.sf.saxon.xpath.XPathFactoryImpl
73
http\://saxon.sf.net/jaxp/xpath/om:     net.sf.saxon.xpath.XPathFactoryImpl
74
</echo>
75

    
76
        <mkdir dir="${services.dir}/saxon9pe/META-INF/services"/>
77
        <echo file="${services.dir}/saxon9pe/META-INF/services/javax.xml.transform.TransformerFactory"
78
              message="com.saxonica.config.ProfessionalTransformerFactory"/> 
79
        <echo file="${services.dir}/saxon9pe/META-INF/services/javax.xml.xpath.XPathFactory"
80
>com.saxonica.config.ProfessionalXPathFactory
81
http\://java.sun.com/jaxp/xpath/dom:    com.saxonica.config.ProfessionalXPathFactory
82
http\://saxon.sf.net/jaxp/xpath/om:     com.saxonica.config.ProfessionalXPathFactory
83
http\://www.xom.nu/jaxp/xpath/xom:      com.saxonica.config.ProfessionalXPathFactory
84
http\://jdom.org/jaxp/xpath/jdom:       com.saxonica.config.ProfessionalXPathFactory
85
http\://www.dom4j.org/jaxp/xpath/dom4j: com.saxonica.config.ProfessionalXPathFactory
86
</echo>
87

    
88
               
89
        <mkdir dir="${services.dir}/saxon9ee/META-INF/services"/>
90
        <echo file="${services.dir}/saxon9ee/META-INF/services/javax.xml.transform.TransformerFactory"
91
              message="com.saxonica.config.EnterpriseTransformerFactory"/>
92
        <echo file="${services.dir}/saxon9ee/META-INF/services/javax.xml.xpath.XPathFactory"
93
>com.saxonica.config.EnterpriseXPathFactory
94
http\://java.sun.com/jaxp/xpath/dom:    com.saxonica.config.EnterpriseXPathFactory
95
http\://saxon.sf.net/jaxp/xpath/om:     com.saxonica.config.EnterpriseXPathFactory
96
http\://www.xom.nu/jaxp/xpath/xom:      com.saxonica.config.EnterpriseXPathFactory
97
http\://jdom.org/jaxp/xpath/jdom:       com.saxonica.config.EnterpriseXPathFactory
98
http\://www.dom4j.org/jaxp/xpath/dom4j: com.saxonica.config.EnterpriseXPathFactory
99
</echo>     
100
        <echo file="${services.dir}/saxon9ee/META-INF/services/javax.xml.validation.SchemaFactory"
101
>com.saxonica.jaxp.SchemaFactoryImpl
102
http\://www.w3.org/2001/XMLSchema: com.saxonica.jaxp.SchemaFactoryImpl
103
</echo>         
104
                                      
105

    
106
    </target>
107
    
108
    <target name="create-edition-properties-j" description="Create the edition.properties files for the three editions of Saxon on Java">
109
        <mkdir dir="${classes-j.dir}"/>
110
        <mkdir dir="${classes-j.dir}/he"/>
111
        <mkdir dir="${classes-j.dir}/pe"/>
112
        <mkdir dir="${classes-j.dir}/ee"/>
113
        <echo file="${classes-j.dir}/he/edition.properties"
114
>config=net.sf.saxon.Configuration
115
platform=net.sf.saxon.java.JavaPlatform
116
</echo>
117
        <echo file="${classes-j.dir}/pe/edition.properties"
118
>config=com.saxonica.config.ProfessionalConfiguration
119
platform=com.saxonica.config.JavaPlatformPE
120
</echo>
121
        <echo file="${classes-j.dir}/ee/edition.properties"
122
>config=com.saxonica.config.EnterpriseConfiguration
123
platform=com.saxonica.config.JavaPlatformPE
124
</echo>   
125
    </target> 
126
    
127
    <target name="prepare-j" depends="create-meta-inf, create-edition-properties-j"/> 
128
    
129
       
130

    
131
    <target name="copysource-development-j" description="Copy relevant source files from development directory">
132
        <copy todir="${temp-src-j.dir}">
133
          <fileset dir="${source-hej.dir}">
134
            <include name="net/sf/saxon/**/*.java"/>
135
            <include name="javax/xml/xquery/*.java"/>
136
            <exclude name="**/dotnet/**"/>
137
            <include name="net/sf/saxon/**/package.html"/>
138
          </fileset>
139
          <fileset dir="${source-eej.dir}">
140
            <include name="com/saxonica/**/*.java"/>
141
            <!--<exclude name="com/saxonica/config/DotNetVerifier.java"/>-->
142
            <exclude name="com/saxonica/config/DotNetExtensionFunctionFactory.java"/>
143
            <exclude name="com/saxonica/config/DotNetExtensionLibrary.java"/>
144
            <exclude name="com/saxonica/config/DotNetPlatformPE.java"/>
145
            <exclude name="com/saxonica/expr/DotNetExtensionFunctionCall.java"/>
146
            <include name="com/saxonica/**/package.html"/>
147
          </fileset>          
148
        </copy>            
149
    </target>    
150
        
151
    <target name="compile-j" description="Compile Saxon classes for the Java product." 
152
            depends="copysource-development-j">
153
        <mkdir dir="${classes-j.dir}"/>
154

    
155
        <javac debug="${build.debug}" debuglevel="${build.debuglevel}" 
156
            deprecation="${build.deprecation}" destdir="${classes-j.dir}"
157
            optimize="${build.optimize}" srcdir="${temp-src-j.dir}" source="${build.compiler.source}"
158
            target="${build.compiler.target}"
159
            fork="true"
160
            memoryinitialsize="256m"
161
            memorymaximumsize="256m">
162

    
163
            <include name="net/**"/>
164
            <include name="javax/xml/xquery/**"/>
165
            <include name="com/saxonica/**"/>
166
            <exclude name="**/ant/**"/>
167
            
168
            <!--<exclude name="**/dotnet/**"/>-->
169
            <!--<exclude name="com/saxonica/validate/DotNetVerifier.java"/>-->
170
            <classpath>
171
                <path refid="classpath-j"/>
172
            </classpath>
173
        </javac>
174
    </target>
175
          
176
    <target name="jar-hej" description="Create Saxon-HE jar files for Java" depends="compile-j">
177
        <mkdir dir="${product.dir}/hej"/>
178

    
179
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/hej/saxon9he.jar">
180
            <include name="net/**/*.class"/>
181
            <exclude name="net/sf/saxon/ant/*.class"/>
182
            <exclude name="net/sf/saxon/option/**/*.class"/>
183
            <!--<exclude name="**/javax/**/*.class"/>
184
            <exclude name="**/xpath/**/*.class"/>
185
            <exclude name="**/xqj/**/*.class"/>-->
186
            <include name="javax/xml/xquery/*.class"/>
187
            <include name="META-INF/**"/>
188
            <manifest>
189
                <attribute name="Project-Name" value="Saxon-HE"/>
190
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
191
            </manifest>
192
            <metainf dir="${services.dir}/saxon9he/META-INF"/>
193
            <!--<metainf dir="${services.dir}/saxon9-xpath/META-INF"/>-->
194
            <!--
195
            <service type="javax.xml.transform.TransformerFactory"
196
                provider="net.sf.saxon.TransformerFactoryImpl"/>
197
            -->    
198
        </jar>
199
        <jar basedir="${classes-j.dir}/he" compress="${build.compress}" jarfile="${product.dir}/hej/saxon9he.jar" update="true">
200
            <include name="edition.properties"/>
201
        </jar>
202

    
203
    </target>
204
    
205
    <target name="jar-pej" description="Create Saxon-PE jar files for Java" depends="compile-j">
206
        <mkdir dir="${product.dir}/pej"/>
207
              
208
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/pej/saxon9pe.jar">
209
            <include name="net/**/*.class"/>
210
            <exclude name="net/sf/saxon/ant/*.class"/>
211
            <exclude name="**/sql/**/*.class"/>
212
            <include name="com/saxonica/**/*.class"/>
213
            <exclude name="com/saxonica/codegen/**/*.class"/>
214
            <exclude name="com/saxonica/deploy/**/*.class"/>
215
            <exclude name="com/saxonica/fsa/**/*.class"/>
216
            <exclude name="com/saxonica/jaxp/**/**/*.class"/>
217
            <exclude name="com/saxonica/schema/**/*.class"/>
218
            <exclude name="com/saxonica/sdoc/**/*.class"/>
219
            <exclude name="com/saxonica/stream/**/*.class"/>
220
            <exclude name="com/saxonica/update/**/*.class"/>
221
            <exclude name="com/saxonica/validate/**/*.class"/>
222
            <exclude name="com/saxonica/Validate.class"/>
223
            <exclude name="com/saxonica/CompileQuery.class"/>
224
            <exclude name="com/saxonica/CompileStylesheet.class"/>
225
            <exclude name="com/saxonica/CompileStylesheet$TracingObjectOutputStream.class"/>
226
            <exclude name="com/saxonica/config/EnterpriseConfiguration.class"/>
227
            <exclude name="com/saxonica/config/EnterpriseConfiguration$SurrogateSchema.class"/>
228
            <exclude name="com/saxonica/config/EnterpriseTransformerFactory.class"/>
229
            <exclude name="com/saxonica/config/EnterpriseXPathFactory.class"/>
230
            <exclude name="com/saxonica/extra/StaticQueryContextEE.class"/>
231
            <exclude name="com/saxonica/extra/OptimizerEE.class"/>
232
            <exclude name="com/saxonica/extra/GeneralComparisonEE.class"/>
233
            <exclude name="com/saxonica/extra/MultithreadedContextMappingIterator.class"/>
234
            <exclude name="com/saxonica/extra/MultithreadedForEach.class"/>
235
            <include name="javax/xml/xquery/*.class"/>
236
            <manifest>
237
                <attribute name="Project-Name" value="Saxon-PE"/>
238
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
239
            </manifest>
240
            <metainf dir="${services.dir}/saxon9pe/META-INF"/>
241

    
242
        </jar>
243
        <jar basedir="${classes-j.dir}/pe" compress="${build.compress}" jarfile="${product.dir}/pej/saxon9pe.jar" update="true">
244
            <include name="edition.properties"/>
245
        </jar>
246
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/pej/saxon9-sql.jar">
247
            <include name="net/sf/saxon/option/sql/*.class"/>
248
        </jar>        
249

    
250
    </target>
251
    
252
    <target name="jar-eej" description="Create Saxon-EE jar files for Java" depends="compile-j">
253
        <mkdir dir="${product.dir}/eej"/>
254
        
255
        <copy todir="${product.dir}/eej">
256
          <fileset dir="${product.dir}/pej">
257
            <include name="saxon9-sql.jar"/>
258
          </fileset>
259
        </copy>          
260
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/eej/saxon9ee.jar">
261
            <include name="net/**/*.class"/>
262
            <exclude name="net/sf/saxon/ant/*.class"/>
263
            <exclude name="**/sql/**/*.class"/>
264
            <include name="com/saxonica/**/*.class"/>
265
            <exclude name="com/saxonica/codegen/*.class"/>
266
            <exclude name="com/saxonica/CompileQuery.class"/>
267
            <include name="javax/xml/xquery/*.class"/>
268
            <manifest>
269
                <attribute name="Project-Name" value="Saxon-EE"/>
270
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
271
            </manifest>
272
            <metainf dir="${services.dir}/saxon9ee/META-INF"/> 
273
        </jar>
274
        <jar basedir="${classes-j.dir}/ee" compress="${build.compress}" jarfile="${product.dir}/eej/saxon9ee.jar" update="true">
275
            <include name="edition.properties"/>
276
        </jar>
277
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/eej/saxon9ee-qc.jar">
278
            <include name="com/saxonica/codegen/*.class"/>
279
            <include name="com/saxonica/CompileQuery.class"/>
280
        </jar>
281
        
282
        <!-- The Saxon-Ant task is delivered with Saxon-B but it won't compile without Saxon-SA present,
283
             unless modified 
284
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon9-ant.jar">
285
            <include name="net/sf/saxon/ant/*.class"/>
286
        </jar>-->
287
    </target>
288
    
289
    <target name="samples-j" description="Copy and Compile Java Samples"
290
                                    depends="jar-eej, samples-common">
291
      <mkdir dir="${product.dir}/resources/samples/java"/>
292
      <mkdir dir="${product.dir}/resources/samples/java/classes"/>
293
      <copy todir="${product.dir}/resources/samples/java">
294
        <fileset dir="${samples.dir}/java">
295
          <include name="ApplyXPathJAXP.java"/>
296
          <include name="ExampleContentHandler.java"/>
297
          <include name="JDOMExample.java"/>
298
          <include name="PullExamples.java"/>
299
          <include name="QueryAPIExamples.java"/>
300
          <include name="QuickValidator.java"/>
301
          <include name="S9APIExamples.java"/>
302
          <include name="SaxonServlet.java"/>
303
          <include name="SaxonSAServlet.java"/>
304
          <include name="SchemaValidatorExample.java"/>
305
          <include name="SchemaValidatorHandlerExample.java"/>
306
          <include name="TraxExamples.java"/>
307
          <include name="XMarkBenchmark.java"/>
308
          <include name="XPathExample.java"/>
309
          <include name="XPathExampleDOM.java"/>
310
          <include name="XPathExampleSA.java"/>
311
          <include name="XPathExampleServlet.java"/>
312
          <include name="XQJExamples.java"/>
313
        </fileset>
314
      </copy>
315
          <javac debug="true" debuglevel="source, lines" 
316
                              destdir="${product.dir}/resources/samples/java/classes"
317
            srcdir="${product.dir}/resources/samples/java" 
318
            source="${build.compiler.source}"
319
            target="${build.compiler.target}">
320
        <include name="*.java"/>    
321
        <classpath>
322
            <path refid="classpath-samples"/>
323
        </classpath>
324
      </javac>            
325
    </target>
326
    
327
    <target name="testdrivers-j" description="Copy Java Test Drivers">
328
            <mkdir dir="${product.dir}/resources/drivers/java/test"/>
329
            <mkdir dir="${product.dir}/resources/drivers/java/test/classes"/>
330
            <copy todir="${product.dir}/resources/drivers/java/test">
331
              <fileset dir="${drivers-j.dir}">
332
                <include name="XQueryTestSuiteDriver.java"/> 
333
                <include name="XsltTestSuiteDriver.java"/> 
334
                <include name="CanonicalXML.java"/> 
335
                <include name="XQTSModuleURIResolver.java"/> 
336
                <include name="XQTSCollectionURIResolver.java"/> 
337
                <include name="SchemaTestSuiteDriver.java"/> 
338
          </fileset>
339
        </copy>
340
        <javac debug="true" debuglevel="source, lines" 
341
                              destdir="${product.dir}/resources/drivers/java/test/classes"
342
            srcdir="${product.dir}/resources/drivers/java" 
343
            source="${build.compiler.source}"
344
            target="${build.compiler.target}">
345
          <include name="*.java"/>    
346
          <classpath>
347
            <path refid="classpath-samples"/>
348
          </classpath>
349
        </javac>
350
    </target>           
351
    
352
                  
353
    <target name="product-javadoc" description="Generate Javadoc." depends="copysource-development-j">
354
        <javadoc bottom="Copyright (c) 2004-2010 Saxonica Limited. All rights reserved."
355
            destdir="${javadoc.dir}" doctitle="Saxon9 Java API Documentation"
356
            noindex="false" notree="false" access="protected"
357
            maxmemory="512M" source="1.5">
358
            <packageset dir="${temp-src-j.dir}">
359
                <include name="net/**"/>
360
                <include name="com/**"/>
361
                <include name="javax/xml/query/**"/>
362
                <exclude name="com/saxonica/testdriver/**"/>
363
                <exclude name="**/dotnet/**"/>
364
                <exclude name="**/DotNetVerifier.java"/>
365
            </packageset>
366
            <packageset dir="e:/javalib/xqj-final/ri/src"/>
367
            <classpath>
368
                <path refid="classpath-j"/>
369
            </classpath>
370
            
371
            <link href="http://download.oracle.com/javase/6/docs/api/"/>
372
            <link href="http://www.xom.nu/apidocs/"/>
373
            
374
            <group title="s9api Interface" packages="net.sf.saxon.s9api"/>
375
            <group title="Other Interfaces">
376
                <package name="net.sf.saxon"/>              
377
                <package name="net.sf.saxon.lib"/>
378
                <package name="net.sf.saxon.om"/>
379
                <package name="net.sf.saxon.query"/>
380
                <package name="net.sf.saxon.sxpath"/>
381
                <package name="net.sf.saxon.value"/>
382
                <package name="net.sf.saxon.type"/>
383
                <package name="net.sf.saxon.xpath"/>
384
                <package name="net.sf.saxon.xqj"/>
385
                <package name="com.saxonica.config"/>
386
                <package name="com.saxonica.jaxp"/>
387
                <package name="com.saxonica.schema"/>
388
                
389
            </group>
390
            <group title="External Interfaces">
391
                <package name="javax.xml.xquery"/>
392
            </group>
393
 
394
            
395
        </javadoc>
396
        <copy file="${userdoc.dir}/fixed/javadoc/stylesheet.css"
397
              tofile="${javadoc.dir}/stylesheet.css"
398
              overwrite="true"/>
399
    </target>
400

    
401

    
402
    <target name="signjars" depends="jar-hej, jar-pej, jar-eej, private-signjars" description="Sign all JAR files">
403
        <!-- If the private-signjars task is not available, simply delete the dependency -->
404
    </target>
405
    
406
                    
407
    <target name="j" depends="signjars"
408
        description="Generate Saxon (all three editions) for the Java platform"/>
409
        
410
    <target name="release-j" description="Create .ZIP files for release"
411
        depends="j" 
412
        >  <!-- , test-j -->
413
      <mkdir dir="${issue.dir}"/> 
414
      <zip zipfile="${issue.dir}/saxonhe${versionh}j.zip">
415
        <fileset dir="${product.dir}/hej"/>
416
      </zip>
417
      <zip zipfile="${issue.dir}/saxonpe${versionh}j.zip">
418
        <fileset dir="${product.dir}/pej"/>
419
      </zip>                     
420
          <zip zipfile="${issue.dir}/saxonee${versionh}j.zip">
421
        <fileset dir="${product.dir}/eej"/>
422
      </zip>                     
423
     </target>    
424
       
425
    
426
</project>
(2-2/6)