Project

Profile

Help

Revision 2699858e

Added by Norman Tovey-Walsh 9 months ago

Deal with FeatureKeys

View differences:

build.gradle
20 20
  mavenLocal()
21 21
  mavenCentral()
22 22
  maven { url = "https://org.apache.maven" }
23
  maven { url "https://dev.saxonica.com/maven" }
23 24
}
24 25

  
25 26
configurations.all {
......
37 38
  asmDotNet.extendsFrom(implementation)
38 39
}
39 40

  
41
// Set saxonLicenseDir in gradle.properties, or from the
42
// command line if you have a license in some other place.
43
if (!hasProperty("saxonLicenseDir")) {
44
  if (System.getenv("SAXON_LICENSE_DIR") != null) {
45
    ext.saxonLicenseDir=System.getenv('SAXON_LICENSE_DIR')
46
  } else {
47
    ext.saxonLicenseDir=System.getenv('HOME') + "/java"
48
  }
49
}
50

  
40 51
dependencies {
41 52
  preprocessor (
42 53
    [group: 'com.igormaznitsa', name: 'jcp', version: '7.0.4'],
43
    [group: 'com.tonicsystems', name: 'jarjar', version: '0.6' ]
54
    [group: 'com.tonicsystems', name: 'jarjar', version: '0.6' ],
55
    [group: 'com.saxonica', name: 'Saxon-EE', version: '10.3' ],
56
    files(saxonLicenseDir)
44 57
  )
45 58
  implementation (
46
    //fileTree(dir: "lib", include: "System*.jar"),
47 59
    [group: 'org.apache.ws.commons.axiom', name: 'axiom-dom', version: '1.2.15'],
48 60
    [group: 'xom', name: 'xom', version: '1.3.5'],
49 61
    [group: 'org.jdom', name: 'jdom', version: '1.1.3'],
......
150 162

  
151 163
apply from: "build-n.gradle"
152 164
apply from: "build-c.gradle"
165
apply from: "build-doc.gradle"
153 166

  
154 167
def pathExists(pathname) {
155 168
  // Returns true iff pathame is an existing file or directory
......
281 294
    attributes "Project-Name": "Saxon-HE-TestDriver"
282 295
    attributes "Main-Class": "com.saxonica.testdriver.gui.TestDriverGui"
283 296
  }
284
  from ("build/classes/hej/testdrivers") {
297
  from ("${buildDir}/classes/hej/testdrivers") {
285 298
    include "net/sf/saxon/testdriver/**"
286 299
  }
287 300
}
......
296 309
    attributes "Project-Name": "Saxon-PE-TestDriver"
297 310
    attributes "Main-Class": "com.saxonica.testdriver.gui.TestDriverGui"
298 311
  }
299
  from ("build/classes/pej/testdrivers") {
312
  from ("${buildDir}/classes/pej/testdrivers") {
300 313
    include "net/sf/saxon/testdriver/**"
301 314
    include "com/saxonica/testdriver/**"
302 315
    exclude "com/saxonica/testdriver/ee/**"
......
313 326
    attributes "Project-Name": "Saxon-EE-TestDriver"
314 327
    attributes "Main-Class": "com.saxonica.testdriver.gui.TestDriverGui"
315 328
  }
316
  from ("build/classes/eej/testdrivers") {
329
  from ("${buildDir}/classes/eej/testdrivers") {
317 330
    include "net/sf/saxon/testdriver/**"
318 331
    include "com/saxonica/testdriver/**"
319 332
  }
......
321 334

  
322 335
// ============================================================
323 336

  
337
task hej_sampleConfig(
338
  type: JavaExec,
339
  description: "Construct the configuration file XSD"
340
) {
341
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
342
  inputs.files "${projectDir}/src/samples/config/config-raw.xsd"
343
  outputs.file "${projectDir}/src/samples/config/config.xsd"
344
  classpath = configurations.preprocessor
345
  main = "net.sf.saxon.Transform"
346
  args "${projectDir}/tools/featureKeys/FeatureKeys.xml",
347
    "-xsl:${projectDir}/tools/featureKeys/FeatureKeysToSchema.xsl",
348
    "-o:${projectDir}/src/samples/config/config.xsd",
349
    "FeatureKeys=FeatureKeys.xml",
350
    "AdditionalFeatures=AdditionalFeatures.xml",
351
    "ConfigSchema=${projectDir}/src/samples/config/config-raw.xsd"
352
}
353

  
354
// There's no real dependency here, but I'm not sure how the
355
// samples directory should be integrated into the build.
356
task hej_featureKeys(
357
  type: JavaExec,
358
  dependsOn: ["hej_sampleConfig"],
359
  description: "Construct the feature keys for HE"
360
) {
361
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
362
  outputs.file "${projectDir}/src/main/java/net/sf/saxon/lib/Feature.java"
363
  outputs.file "${projectDir}/src/main/java/net/sf/saxon/lib/FeatureCode.java"
364
  outputs.file "${projectDir}/src/main/java/net/sf/saxon/lib/FeatureKeys.java"
365
  classpath = configurations.preprocessor
366
  main = "net.sf.saxon.Transform"
367
  args "${projectDir}/tools/featureKeys/FeatureKeys.xml",
368
    "-xsl:${projectDir}/tools/featureKeys/FeatureKeysToJava.xsl",
369
    "-o:${projectDir}/src/main/java/net/sf/saxon/lib/establish-an-output-base-uri"
370
}
371

  
324 372
task hej_setupPreprocess(
325 373
  type: Copy,
374
  dependsOn: ["hej_featureKeys"],
326 375
  description: "Copy HE sources for preprocessing HE"
327 376
) {
328 377
  from "${projectDir}/src/main/java"
......
808 857
    attributes "Project-Name": "Saxon-HE"
809 858
    attributes "Main-Class": "net.sf.saxon.Transform"
810 859
  }
811
  from ("build/services/saxon-he") {
860
  from ("${buildDir}/services/saxon-he") {
812 861
    include "META-INF/**"
813 862
  }
814
  from ("build/classes/hej") {
863
  from ("${buildDir}/classes/hej") {
815 864
    include "net/**/*.class"
816 865
    exclude "net/sf/saxon/option/**"
817 866
  }
......
829 878
    description: "Build the XQJ jar file for HE"
830 879
  ) {
831 880
    archiveBaseName = "saxon-he-xqj-${saxonVersion}"
832
    from ("build/classes/eej") {
881
    from ("${buildDir}/classes/eej") {
833 882
      include "com/saxonica/xqj/**/*.class"
834 883
      include "javax/xml/xquery/**/*.class"
835 884
    }
......
854 903
    attributes "Project-Name": "Saxon-PE"
855 904
    attributes "Main-Class": "net.sf.saxon.Transform"
856 905
  }
857
  from ("build/services/saxon-pe") {
906
  from ("${buildDir}/services/saxon-pe") {
858 907
    include "META-INF/**"
859 908
  }
860
  from ("build/classes/pej") {
909
  from ("${buildDir}/classes/pej") {
861 910
    include "net/**/*.class"
862 911
    include "com/saxonica/**/*.class"
863 912
    include "javax/xml/xquery/*.class"
......
889 938
  description: "Build the SQL jar file for PE"
890 939
) {
891 940
  archiveBaseName = "saxon-pe-sql-${saxonVersion}"
892
  from ("build/classes/pej") {
941
  from ("${buildDir}/classes/pej") {
893 942
    include "net/sf/saxon/option/sql/*.class"
894 943
    include "com/saxonica/functions/sql/*.class"
895 944
  }
......
905 954
    attributes "Project-Name": "Saxon-EE"
906 955
    attributes "Main-Class": "net.sf.saxon.Transform"
907 956
  }
908
  from ("build/services/saxon-ee") {
957
  from ("${buildDir}/services/saxon-ee") {
909 958
    include "META-INF/**"
910 959
  }
911
  from ("build/classes/eej") {
960
  from ("${buildDir}/classes/eej") {
912 961
    include "net/**/*.class"
913 962
    include "com/saxonica/**/*.class"
914 963
    include "javax/xml/xquery/*.class"
......
929 978
  description: "Build the SQL jar file for EE"
930 979
) {
931 980
  archiveBaseName = "saxon-ee-sql-${saxonVersion}"
932
  from ("build/classes/eej") {
981
  from ("${buildDir}/classes/eej") {
933 982
    include "net/sf/saxon/option/sql/*.class"
934 983
    include "com/saxonica/functions/sql/*.class"
935 984
  }
......
1045 1094
  description: "Setup to build the builder container"
1046 1095
) {
1047 1096
  from "src/docker/builder"
1048
  into "build/docker/builder"
1097
  into "${buildDir}/docker/builder"
1049 1098
}
1050 1099

  
1051 1100
task docker_testJdk(
......
1064 1113
  description: "Setup the JDK for the builder container"
1065 1114
) {
1066 1115
  from dockerJdk
1067
  into "build/docker/builder"
1116
  into "${buildDir}/docker/builder"
1068 1117
}
1069 1118

  
1070 1119
task docker_testJet(
......
1083 1132
  description: "Setup the Jet archive for the builder container"
1084 1133
) {
1085 1134
  from dockerJet
1086
  into "build/docker/builder"
1135
  into "${buildDir}/docker/builder"
1087 1136
}
1088 1137

  
1089 1138
// ============================================================

Also available in: Unified diff