Project

Profile

Help

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

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

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

    
3
<project basedir="." default="release-j" 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

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

    
16
   
17
    <!--<import file="documentation.xml"/> -->
18

    
19

    
20

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

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

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

    
29
    <property name="services.dir" value="services"/>
30
    <property name="temp-src-j.dir" value="${temp.dir}/j/source"/>
31
    <property name="temp-src-prep0-hej.dir" value="${temp.dir}/preprocessed0/hej/source"/>
32
    <property name="temp-src-prep-test.dir" value="${temp.dir}/preprocessed/testdriver"/>
33
    <property name="classes-j.dir" value="${temp.dir}/j/classes"/>
34

    
35

    
36
    <!-- following locations are relative to the destination directory -->
37

    
38
    <property name="build-hej.dir" value="${product.dir}/hej"/>
39
    
40

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

    
43

    
44
    <path id="classpath-j">
45
        <fileset dir="${lib.dir}">
46
            <include name="*.jar"/>
47
        </fileset>
48
    </path>
49

    
50

    
51
    <path id="classpath-samples">
52
        <fileset dir="${lib.dir}">
53
            <include name="*.jar"/>
54
        </fileset>
55
        <fileset dir="${build-hej.dir}">
56
            <include name="*.jar"/>
57
        </fileset>
58
        <!-- Substitute build-hej.dir if there is no requirement to compile the sample applications
59
             that depend on Saxon-EE -->
60
    </path>
61

    
62

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

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

    
84
    </target>
85

    
86

    
87
    <target name="prepare-j" depends="create-meta-inf" />
88

    
89

    
90
    <target name="copysource-development-j"
91
        description="Copy relevant source files from development directory">
92
        <!--<copy todir="${temp-src-j.dir}">
93
            <fileset dir="${development-data.dir}">
94
                <include name="**/*.*"/>
95
            </fileset>
96
        </copy>-->
97
    </target>
98

    
99

    
100

    
101
    <target name="copysrc-hej">
102
        <mkdir dir="${temp-src-j.dir}/hej"/>
103
        <copy todir="${temp-src-j.dir}/hej">
104
            <fileset dir="${source-hej.dir}">
105
                <include name="net/sf/saxon/**/*.java"/>
106
                <exclude name="javax/xml/xquery/*.java"/>
107
                <exclude name="**/dotnet/**"/>
108
                <include name="net/sf/saxon/**/package.html"/>
109
                <exclude name="net/sf/saxon/testdriver/**"/>
110
                <exclude name="net/sf/saxon/option/sql/**"/>
111
                <include name="net/sf/saxon/data/**"/>
112
            </fileset>
113
            
114
            
115
        </copy>
116
       
117
        
118
    </target>
119

    
120

    
121

    
122
    <target name="preprocess-hej" depends="copysrc-hej">
123
        <preprocess source="${temp-src-j.dir}/hej" destination="${temp-src-prep0-hej.dir}"
124
            verbose="false">
125
            <global name="EE" value="false"/>
126
            <global name="PE" value="false"/>
127
            <global name="DOTNET" value="false"/>
128
            <global name="OPT" value="false"/>
129
            <global name="SAXONC" value="false"/>
130
        </preprocess>
131
        <echo>Preprocessing hej complete.</echo>
132
        <copy todir="${temp-src-prep-hej.dir}">
133
           <fileset dir="${temp-src-prep0-hej.dir}"/>
134
           <filterchain>
135
              <linecontains negate="true">
136
                 <contains value="import com.saxonica"/>
137
              </linecontains>
138
           </filterchain>
139
       </copy>
140
        <echo>Import filtering for hej complete!</echo>
141
    </target>
142

    
143
   
144

    
145
   
146

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

    
151
        <javac debug="${build.debug}" debuglevel="${build.debuglevel}"
152
            deprecation="${build.deprecation}" destdir="${classes-j.dir}/he"
153
            optimize="${build.optimize}" srcdir="${temp-src-prep-hej.dir}"
154
            source="${build.compiler.source}" target="${build.compiler.target}" fork="true"
155
            memoryinitialsize="256m" memorymaximumsize="256m">
156

    
157
            <include name="net/**"/>
158
            <exclude name="net/sf/saxon/option/**/*.java"/>
159
           
160
            <classpath>
161
                <path refid="classpath-j"/>
162
            </classpath>
163
        </javac>
164
    </target>
165

    
166
    <target name="jar-hej" description="Create Saxon-HE jar files for Java" depends="testdrivers-j, compile-hej">
167
        <mkdir dir="${product.dir}/hej"/>
168
        <mkdir dir="${classes-j.dir}/he"/>
169

    
170
        <jar basedir="${classes-j.dir}/he" compress="${build.compress}"
171
            jarfile="${product.dir}/hej/saxon9he.jar">
172
            <include name="net/**/*.class"/>
173
            <exclude name="net/sf/saxon/option/**/*.class"/>
174
            <include name="META-INF/**"/>
175
            <manifest>
176
                <attribute name="Project-Name" value="Saxon-HE"/>
177
                <attribute name="Main-Class" value="net.sf.saxon.Transform"/>
178
            </manifest>
179
            <metainf dir="${services.dir}/saxon9he/META-INF"/>
180
        </jar>
181

    
182
        <!-- add data files -->
183
        <jar basedir="${temp-src-j.dir}/hej" compress="${build.compress}"
184
            jarfile="${product.dir}/hej/saxon9he.jar" update="true">
185
            <include name="net/sf/saxon/data/**"/>
186
        </jar>
187

    
188
        <mkdir dir="${product.dir}/resources/drivers/java/classes"/>
189
        <javac debug="true" debuglevel="${build.debuglevel}"
190
               destdir="${product.dir}/resources/drivers/java/classes"
191
               srcdir="${product.dir}/resources/drivers/java" source="${build.compiler.source}"
192
               target="${build.compiler.target}">
193
            <include name="net/sf/saxon/testdriver/*.java"/>
194
            <classpath>
195
                <fileset dir="${lib.dir}">
196
                    <include name="*.jar"/>
197
                </fileset>
198
                <fileset dir="${build-hej.dir}">
199
                    <include name="*.jar"/>
200
                </fileset>
201
            </classpath>
202
        </javac>
203

    
204

    
205
        <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" />
206

    
207
        <!-- saxon9-test.jar -->
208
        <jar basedir="${product.dir}/resources/drivers/java/classes" compress="${build.compress}"
209
            jarfile="${product.dir}/hej/saxon9-test.jar">
210
            <include name="net/sf/saxon/testdriver/*.class"/>
211
            <!--<include name="com/saxonica/testdriver/gui/*.class"/>-->
212
            <manifest>
213
                <attribute name="Project-Name" value="Saxon-HE-TestDriver"/>
214
                <attribute name="Main-Class" value="com.saxonica.testdriver.gui.TestDriverGui"/>
215
            </manifest>
216
        </jar>
217

    
218
         <jar basedir="${classes-j.dir}/ee" compress="${build.compress}" jarfile="${product.dir}/hej/saxon9-xqj.jar">
219
            <include name="com/saxonica/xqj/**/*.class"/>
220
            <include name="javax/xml/xquery/**/*.class"/>
221
        </jar>
222

    
223
        <!--<jar basedir="${source-eej.dir}" compress="${build.compress}"
224
            jarfile="${product.dir}/hej/saxon9-test.jar" update="true">
225
            <include name="com/saxonica/testdriver/gui/images/**"/>
226
        </jar>-->
227

    
228
    </target>
229

    
230
   
231

    
232
   
233
   
234
    
235
    <target name="jar-j" depends="jar-hej"/>
236

    
237
   
238

    
239
    <target name="config-sample" description="Generate annotated configuration file schema in samples">
240
        <xslt in="${featureKeys.dir}/FeatureKeys.xml" out="${samples.dir}/config/annotatedConfig.xsd"
241
              style="${featureKeys.dir}/FeatureKeysToSchema.xsl" classpathref="saxon.class.path">
242
            <param name="FeatureKeys" expression="FeatureKeys.xml"/>
243
            <param name="AdditionalFeatures" expression="AdditionalFeatures.xml"/>
244
            <param name="ConfigSchema" expression="${samples.uri}/config/config.xsd"/>
245
            <factory name="com.saxonica.config.EnterpriseTransformerFactory">
246
                <attribute name="http://saxon.sf.net/feature/licenseFileLocation"
247
                           value="${saxon.license}"/>
248
                <attribute name="http://saxon.sf.net/feature/initialTemplate" value="main"/>
249
            </factory>
250
        </xslt>
251
        <!-- Touch to ensure that the annotatedConfig.xsd schema is always
252
         regenerated when running this target.
253
         (Otherwise a change in config.xsd only would not automatically be picked up.)-->
254
        <touch file="${featureKeys.dir}/FeatureKeys.xml"/>
255
    </target>
256

    
257
    <target name="preprocess-testdriver-j">
258
        <mkdir dir="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver"/>
259
       
260
        
261

    
262
       
263

    
264
       
265
        <delete
266
            file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/SchemaTestSuiteDriver.java"/>
267
        <delete
268
            file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/UpdateTestSuiteDriver.java"/>
269
        <delete
270
            file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/XQueryTestSuiteDriver.java"/>
271
        <delete
272
            file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/XsltTestSuiteDriver.java"/>
273
        <delete file="${temp-src-prep-test.dir}/hej/com/saxonica/testdriver/XMarkBenchmark.java"/>
274
        <echo>Preprocessing test-driver-hej complete!</echo>
275

    
276
     
277
      
278
    </target>
279

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

    
283
        <copy todir="${product.dir}/resources/drivers/java">
284
            <fileset dir="${source-eej.dir}">
285
                <include name="com/saxonica/testdriver/ee/*.java"/>
286
                <include name="com/saxonica/testdriver/gui/**"/>
287
                <include name="com/saxonica/testdriver/QT3TestDriverPE.java"/>
288
                <include name="com/saxonica/testdriver/XMarkBenchmark.java"/>
289
                <include name="com/saxonica/testdriver/Xslt30TestSuiteDriver.java"/>
290
                <include name="com/saxonica/testdriver/Xslt30TestSuiteDriverPE.java"/>
291
         <!-- jwL -->     <!--  <include name="com/saxonica/testdriver/TestDriverShell.java"/> -->
292
                <!-- jwL -->       <include name="com/saxonica/testdriver/Licensor.java"/>
293

    
294
            </fileset>
295
            <fileset dir="${source-hej.dir}">
296
                  <include name="net/sf/saxon/testdriver/*.java"/>
297
            </fileset>
298
        </copy>
299

    
300
    </target>
301

    
302
    <!-- Builds the HTML javadoc in resources/doc/javadoc dir -->
303
    <target name="product-javadoc" description="Generate Javadoc"
304
        depends="copysource-development-j">
305
        <javadoc bottom="Copyright (c) 2004-2017 Saxonica Limited. All rights reserved."
306
            destdir="${javadoc.dir}" doctitle="Saxon9 Java API Documentation" noindex="false"
307
            notree="false" access="protected" maxmemory="512M" source="1.5">
308
            <packageset dir="${temp-src-j.dir}/eej">
309
                <include name="net/**"/>
310
                <include name="com/**"/>
311
                <include name="javax/xml/query/**"/>
312
                <exclude name="com/saxonica/testdriver/**"/>
313
                <exclude name="net/sf/saxon/testdriver/**"/>
314
                <exclude name="**/dotnet/**"/>
315
                <exclude name="**/DotNetVerifier.java"/>
316
            </packageset>
317
            <packageset dir="${repository}/lib/xqj-final/ri/src"/>
318
            <classpath>
319
                <path refid="classpath-j"/>
320
            </classpath>
321

    
322
            <link href="http://download.oracle.com/javase/6/docs/api/"/>
323
            <link href="http://www.xom.nu/apidocs/"/>
324

    
325
            <group title="s9api Interface" packages="net.sf.saxon.s9api"/>
326
            <group title="Other Interfaces">
327
                <package name="net.sf.saxon"/>
328
                <package name="net.sf.saxon.lib"/>
329
                <package name="net.sf.saxon.om"/>
330
                <package name="net.sf.saxon.query"/>
331
                <package name="net.sf.saxon.sxpath"/>
332
                <package name="net.sf.saxon.value"/>
333
                <package name="net.sf.saxon.type"/>
334
                <package name="net.sf.saxon.xpath"/>
335
                <package name="net.sf.saxon.xqj"/>
336
                <package name="com.saxonica.config"/>
337
                <package name="com.saxonica.jaxp"/>
338
                <package name="com.saxonica.schema"/>
339

    
340
            </group>
341
            <group title="External Interfaces">
342
                <package name="javax.xml.xquery"/>
343
            </group>
344
        </javadoc>
345
        <copy file="${userdoc.dir}/saxon9/fixed/javadoc/stylesheet.css"
346
            tofile="${javadoc.dir}/stylesheet.css" overwrite="true"/>
347
    </target>
348

    
349

    
350
    <target name="j" depends="jar-j"
351
        description="Generate Saxon (all three editions) for the Java platform"/>
352

    
353
    <target name="release-j" description="Create .ZIP files for release" depends="j">
354
        <!-- , test-j -->
355
        <mkdir dir="${issue.dir}"/>
356
        <zip zipfile="${issue.dir}/SaxonHE${versionh}J.zip">
357
            <fileset dir="${product.dir}/hej"/>
358
        </zip>
359

    
360
    </target>
361

    
362

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