Project

Profile

Help

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

he / test-suites.gradle @ b258012b

1
["h", "p", "e"].each { initial ->
2
  def release = initial + "e"
3
  def RELEASE = release.toUpperCase()
4

    
5
  task "${release}_samples_common"(
6
    type: Copy,
7
    dependsOn: ["${release}_samples", "${release}_samples_cs"]
8
  ) {
9
    into "${buildDir}/output/${release}/resources/use-cases"
10
    from "${projectDir}/src/use-cases"
11
  }
12

    
13
  task "${release}_samples"(
14
    type: Copy
15
  ) {
16
    into "${buildDir}/output/${release}/resources/samples"
17
    from ("${projectDir}/src/samples") {
18
      include "config/config.xml"
19
      include "config/config-HE.xml"
20
      include "config/config.xsd"
21
      include "config/saxon-attributes.xsd"
22
      include "data/books.xml"
23
      include "data/books-invalid.xml"
24
      include "data/more-books.xml"
25
      include "data/othello.xml"
26
      include "data/books.xsd"
27
      include "data/books.dtd"
28
      include "data/play.dtd"
29
      include "query/tour.xq"
30
      include "query/books.xq"
31
      include "query/books-to-html.xq"
32
      include "scm/scmschema.*"
33
      include "schemas/validation-reports.xsd"
34
      include "styles/add-ids.xsl"
35
      include "styles/bible.xsl"
36
      include "styles/books.xsl"
37
      include "styles/books.txt"
38
      include "styles/play.xsl"
39
      include "styles/identity.xsl"
40
      include "styles/books-csv.xsl"
41
      include "styles/books-sql.xsl"
42
      include "styles/rename-to-lowercase.xsl"
43
      include "styles/total.xsl"
44
      include "styles/tour.xsl"
45
      include "styles/summarize.xsl"
46
    }
47
  }
48

    
49
  // TODO reinstate to include CS samples when releasing for .NET
50
  task "${release}_samples_cs"(
51
    type: Copy
52
  ) {
53
    into "${buildDir}/output/{$release}/resources/samples/cs"
54
    from "${projectDir}/src/samples/cs"
55
  }
56
}
57

    
58
task config_sample(
59
  type: JavaExec,
60
  dependsOn: ["hej_featureKeys"],
61
  description: "Construct the configuration file XSD"
62
) {
63
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
64
  inputs.files "${projectDir}/src/samples/config/config-raw.xsd"
65
  outputs.file "${buildDir}/output/he/resources/samples/config/config.xsd"
66
  classpath = configurations.preprocessor
67
  main = "net.sf.saxon.Transform"
68
  args "${projectDir}/tools/featureKeys/FeatureKeys.xml",
69
    "-xsl:${projectDir}/tools/featureKeys/FeatureKeysToSchema.xsl",
70
    "-o:${buildDir}/output/he/resources/samples/config/config.xsd",
71
    "FeatureKeys=FeatureKeys.xml",
72
    "AdditionalFeatures=AdditionalFeatures.xml",
73
    "ConfigSchema=${projectDir}/src/samples/config/config-raw.xsd"
74
}
75

    
76
task hej_setup_samples(
77
  type: Copy,
78
  dependsOn: ["config_sample", "he_samples_common"]
79
) {
80
  into "${buildDir}/output/he/resources/samples/java/he"
81
  from ("${projectDir}/src/samples/java/he") {
82
    include "ApplyXPathJAXP.java"
83
    include "ExampleContentHandler.java"
84
    include "QueryAPIExamples.java"
85
    include "S9APIExamples.java"
86
    include "S9APIExamplesOM.java"
87
    include "SaxonServlet.java"
88
    include "JAXPExamples.java"
89
    include "XPathExample.java"
90
    include "XPathExampleDOM.java"
91
    include "XPathExampleServlet.java"
92
  }
93
}
94

    
95
task hej_samples(
96
  type: JavaCompile,
97
  dependsOn: ["hej_setup_samples", "hejCompile"]
98
) {
99
  classpath = configurations.samples + files("${buildDir}/classes/hej")
100
  source = "${buildDir}/output/he/resources/samples/java/he"
101
  destinationDirectory = new File("${buildDir}/output/he/resources/samples/java/classes")
102
  doFirst {
103
    mkdir "${buildDir}/output/he/resources/samples/java/classes"
104
  }
105
}
106

    
107
task eej_setup_samples(
108
  type: Copy,
109
  dependsOn: ["config_sample", "ee_samples_common"]
110
) {
111
  into "${buildDir}/output/he/resources/samples/java/ee"
112
  from ("${projectDir}/src/samples/java/ee") {
113
    include "JDOM2Example.java"
114
    include "PullExamples.java"
115
    include "QuickValidator.java"
116
    include "SaxonSAServlet.java"
117
    include "SchemaValidatorExample.java"
118
    include "SchemaValidatorHandlerExample.java"
119
    include "XMarkBenchmark.java"
120
    include "XPathExampleSA.java"
121
    include "XQJExamples.java"
122
  }
123
}
124

    
125
task eej_samples(
126
  type: JavaCompile,
127
  dependsOn: ["eej_setup_samples", "eejCompile", "hej_samples"]
128
) {
129
  classpath = configurations.samples + (files("${buildDir}/classes/eej")
130
              + files("${buildDir}/output/he/resources/samples/java/classes"))
131
  source = "${buildDir}/output/he/resources/samples/java/ee"
132
  destinationDirectory = new File("${buildDir}/output/ee/resources/samples/java/classes")
133
  doFirst {
134
    mkdir "${buildDir}/output/ee/resources/samples/java/classes"
135
  }
136
}
137

    
138
// ============================================================
139

    
140
task he_samples_JAXPExamples(
141
  type: JavaExec,
142
  description: "Run test of JAXPExamples for he"
143
) {
144
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
145
  inputs.files "${projectDir}/src/samples/config/config-raw.xsd"
146
  outputs.file "${buildDir}/output/he/resources/samples/config/config.xsd"
147
  classpath = configurations.preprocessor
148
  main = "net.sf.saxon.Transform"
149
  args "${projectDir}/tools/featureKeys/FeatureKeys.xml",
150
    "-xsl:${projectDir}/tools/featureKeys/FeatureKeysToSchema.xsl",
151
    "-o:${buildDir}/output/he/resources/samples/config/config.xsd",
152
    "FeatureKeys=FeatureKeys.xml",
153
    "AdditionalFeatures=AdditionalFeatures.xml",
154
    "ConfigSchema=${projectDir}/src/samples/config/config-raw.xsd"
155
}
156

    
157
/*
158

    
159
    <macrodef name="samples-JAXPExamples"
160
              description="Run test of JAXPExamples samples">
161
        <attribute name="version"/>
162
        <attribute name="target"/>
163
        <sequential>
164
            <exec executable="java"
165
                  dir="${build-resources.dir}/samples"
166
                  failonerror="true">
167
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-@{version}j.dir}/saxon-@{version}-${major.version}.jar${Z}${license.dir}"/>
168
                <arg line="he/JAXPExamples"/>
169
                <arg line="@{target}"/>
170
            </exec>
171
        </sequential>
172
    </macrodef>
173

    
174
    <target name="test-samples-JAXPExamples-j" depends="samples-j">
175
        <samples-JAXPExamples version="he" target="all"/>
176
        <samples-JAXPExamples version="pe" target="all"/>
177
        <samples-JAXPExamples version="ee" target="all"/>
178
    </target>
179

    
180

    
181
/*
182
}
183

    
184
    <!-- S9APIExamples sample tests -->
185
    <macrodef name="samples-s9api"
186
        description="Run test of s9api samples">
187
        <attribute name="version"
188
        <attribute name="target"
189
        <sequential>
190
            <exec executable="java"
191
                dir="${build-resources.dir}/samples"
192
                failonerror="true">
193
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-@{version}j.dir}/saxon-@{version}-${major.version}.jar${Z}${license.dir}"
194
                <arg line="he/S9APIExamples"
195
                <arg line="@{target}"
196
            </exec>
197
        </sequential>
198
    </macrodef>
199

    
200
        <samples-s9api version="he" target="QueryA"
201
*/
(14-14/14)