Project

Profile

Help

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

he / tags / 9.2.0.5 / build / build-j.xml @ c74fd4aa

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="${root}/MyJava/build/build-j-signer.xml"/>                           
15
    
16
    
17
    <!-- directory holding Java test drivers -->
18
    <property name="drivers-j.dir" value="${root}/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.ProfessionalXPathFactory
95
http\://saxon.sf.net/jaxp/xpath/om:     com.saxonica.config.ProfessionalXPathFactory
96
http\://www.xom.nu/jaxp/xpath/xom:      com.saxonica.config.ProfessionalXPathFactory
97
http\://jdom.org/jaxp/xpath/jdom:       com.saxonica.config.ProfessionalXPathFactory
98
http\://www.dom4j.org/jaxp/xpath/dom4j: com.saxonica.config.ProfessionalXPathFactory
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/extra/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

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

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

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

    
237
        </jar>
238
        <jar basedir="${classes-j.dir}/pe" compress="${build.compress}" jarfile="${product.dir}/pej/saxon9pe.jar" update="true">
239
            <include name="edition.properties"/>
240
        </jar>
241
                
242

    
243
    </target>
244
    
245
    <target name="jar-eej" description="Create Saxon-EE jar files for Java" depends="compile-j">
246
        <mkdir dir="${product.dir}/eej"/>
247
        
248
        <copy todir="${product.dir}/eej">
249
          <fileset dir="${product.dir}/pej">
250
            <include name="saxon9-sql.jar"/>
251
          </fileset>
252
        </copy>          
253
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/eej/saxon9ee.jar">
254
            <include name="net/**/*.class"/>
255
            <exclude name="net/sf/saxon/ant/*.class"/>
256
            <exclude name="**/sql/**/*.class"/>
257
            <include name="com/saxonica/**/*.class"/>
258
            <exclude name="com/saxonica/codegen/*.class"/>
259
            <exclude name="com/saxonica/CompileQuery.class"/>
260
            <include name="javax/xml/xquery/*.class"/>
261
            <manifest>
262
                <attribute name="Project-Name" value="Saxon-EE"/>
263
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
264
            </manifest>
265
            <metainf dir="${services.dir}/saxon9ee/META-INF"/> 
266
        </jar>
267
        <jar basedir="${classes-j.dir}/ee" compress="${build.compress}" jarfile="${product.dir}/eej/saxon9ee.jar" update="true">
268
            <include name="edition.properties"/>
269
        </jar>
270
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/eej/saxon9ee-qc.jar">
271
            <include name="com/saxonica/codegen/*.class"/>
272
            <include name="com/saxonica/CompileQuery.class"/>
273
        </jar>
274
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/eej/saxon9-sql.jar">
275
            <include name="net/sf/saxon/option/sql/*.class"/>
276
        </jar>
277
        <!-- The Saxon-Ant task is delivered with Saxon-B but it won't compile without Saxon-SA present,
278
             unless modified 
279
        <jar basedir="${classes-j.dir}" compress="${build.compress}" jarfile="${product.dir}/bj/saxon9-ant.jar">
280
            <include name="net/sf/saxon/ant/*.class"/>
281
        </jar>-->
282
    </target>
283
    
284
    <target name="samples-j" description="Copy and Compile Java Samples"
285
                                    depends="jar-eej, samples-common">
286
      <mkdir dir="${product.dir}/resources/samples/java"/>
287
      <mkdir dir="${product.dir}/resources/samples/java/classes"/>
288
      <copy todir="${product.dir}/resources/samples/java">
289
        <fileset dir="${samples.dir}/java">
290
          <include name="ApplyXPathJAXP.java"/>
291
          <include name="ExampleContentHandler.java"/>
292
          <include name="JDOMExample.java"/>
293
          <include name="PullExamples.java"/>
294
          <include name="QueryAPIExamples.java"/>
295
          <include name="QuickValidator.java"/>
296
          <include name="S9APIExamples.java"/>
297
          <include name="SaxonServlet.java"/>
298
          <include name="SaxonSAServlet.java"/>
299
          <include name="SchemaValidatorExample.java"/>
300
          <include name="SchemaValidatorHandlerExample.java"/>
301
          <include name="TraxExamples.java"/>
302
          <include name="XMarkBenchmark.java"/>
303
          <include name="XPathExample.java"/>
304
          <include name="XPathExampleDOM.java"/>
305
          <include name="XPathExampleSA.java"/>
306
          <include name="XPathExampleServlet.java"/>
307
          <include name="XQJExamples.java"/>
308
        </fileset>
309
      </copy>
310
                        <javac debug="true" debuglevel="source, lines" 
311
                              destdir="${product.dir}/resources/samples/java/classes"
312
            srcdir="${product.dir}/resources/samples/java" 
313
            source="${build.compiler.source}"
314
            target="${build.compiler.target}">
315
        <include name="*.java"/>    
316
        <classpath>
317
            <path refid="classpath-samples"/>
318
        </classpath>
319
     </javac>            
320
    </target>
321
    
322
    <target name="testdrivers-j" description="Copy Java Test Drivers">
323
                        <mkdir dir="${product.dir}/resources/drivers/java/test"/>
324
                        <copy todir="${product.dir}/resources/drivers/java/test">
325
                          <fileset dir="${drivers-j.dir}">
326
                            <include name="XQueryTestSuiteDriver.java"/> 
327
                            <include name="XsltTestSuiteDriver.java"/> 
328
                            <include name="CanonicalXML.java"/> 
329
                            <include name="XQTSModuleURIResolver.java"/> 
330
                            <include name="XQTSCollectionURIResolver.java"/> 
331
                            <include name="SchemaTestSuiteDriver.java"/> 
332
        </fileset>
333
      </copy>
334
    </target>           
335
    
336
                  
337
    <target name="product-javadoc" description="Generate Javadoc." depends="copysource-development-j">
338
    <!-- Omit for maintenance builds
339
        <javadoc bottom="Copyright (c) Saxonica Limited. All rights reserved."
340
            destdir="${javadoc.dir}" doctitle="saxon9 Javadocs"
341
            noindex="true" notree="true" access="protected"
342
            maxmemory="512M" source="1.5">
343
            <packageset dir="${temp-src-j.dir}">
344
                <include name="net/**"/>
345
                <include name="com/**"/>
346
                <exclude name="**/dotnet/**"/>
347
                <exclude name="**/DotNetVerifier.java"/>
348
            </packageset>
349
            <classpath>
350
                <path refid="classpath-j"/>
351
            </classpath>
352
            
353
            <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
354
            <link href="http://www.xom.nu/apidocs/"/>
355
            
356
        </javadoc>
357
        <copy file="${userdoc.dir}/fixed/javadoc/stylesheet.css"
358
              tofile="${javadoc.dir}/stylesheet.css"
359
              overwrite="true"/>
360
    -->
361
    </target>
362

    
363

    
364
    <target name="signjars" depends="jar-hej, jar-pej, jar-eej, private-signjars" description="Sign all JAR files">
365
        <!-- If the private-signjars task is not available, simply delete the dependency -->
366
    </target>
367
        
368
                    
369
    <target name="j" depends="signjars"
370
        description="Generate Saxon (all three editions) for the Java platform"/>
371
       
372
    
373
</project>
(2-2/4)