Project

Profile

Help

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

he / build-n.gradle @ 00082f6f

1
// To support the documentation builds, we need to be able to run
2
// the CSharp compiler under Mono. This is not used for releases.
3
def mono = null
4
["${System.getenv("SAXON_MONO_FRAMEWORK")}/bin/mono",
5
 "${monoFramework}/bin/mono",
6
 "z:/some/other/mono/path"].each { path ->
7
  if (mono == null && new File(path).exists()) {
8
    mono = path
9
  }
10
}
11

    
12
// Find C# compiler: the first path that exists in this list
13
// will be used as the C# compiler.
14
//
15
def csharpCompiler = null
16
["C:/Windows/Microsoft.net/Framework/${dotNetFrameworkVersion}/csc.exe",
17
 "z:/some/other/compiler/path"].each { csc ->
18
  // This only makes sense on Windows, so always using file:/// is ok
19
  if (csharpCompiler == null && pathExists(csc)) {
20
    csharpCompiler = [ csc ]
21
  }
22
}
23

    
24
def ikvmExecutable = ["${ikvmDir}/ikvm-${ikvmVersion}/bin/ikvmc.exe"]
25
if (mono != null) {
26
  ikvmExecutable = [mono, "${ikvmDir}/ikvm-${ikvmVersion}/bin/ikvmc.exe"]
27
  csharpCompiler = [mono, "${monoFramework}/lib/mono/4.5/csc.exe"]
28
}
29

    
30
def additionalIkvmOptions = []
31
if (hasProperty("ikvmDebug")) {
32
  additionalIkvmOptions += ["-debug"]
33
}
34

    
35
task hen_featureKeys(
36
  type: JavaExec,
37
  description: "Construct the feature keys for HE"
38
) {
39
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
40
  outputs.file "${projectDir}/src/main/csharp/api/Saxon.Api/Feature.cs"
41
  outputs.file "${projectDir}/src/main/csharp/api/Saxon.Api/FeatureKeys.cs"
42
  classpath = configurations.preprocessor
43
  main = "net.sf.saxon.Transform"
44
  args "${projectDir}/tools/featureKeys/FeatureKeys.xml",
45
    "-xsl:${projectDir}/tools/featureKeys/FeatureKeysToCSharp.xsl",
46
    "-o:${projectDir}/src/main/csharp/api/Saxon.Api/establish-an-output-base-uri"
47
}
48

    
49
task hen_setupPreprocess(
50
  type: Copy,
51
  dependsOn: ["hen_featureKeys"],
52
  description: "Copy HE sources for preprocessing HE"
53
) {
54
  from "${projectDir}/src/main/java"
55
  into "${buildDir}/filtered/hen"
56
  include "net/sf/saxon/**/*.java"
57
  include "net/sf/saxon/data/**"
58
  exclude "net/sf/saxon/option/cpp/**"
59
  exclude "net/sf/saxon/jetonnet/**"
60
  exclude "net/sf/saxon/Gizmo.java"
61
  exclude "**/TransformerFactoryImpl.java"
62
  exclude "net/sf/saxon/BasicTransformerFactory.java"
63
  exclude "**/ant/**"
64
  exclude "**/dom/**"
65
  exclude "**/dom4j/**"
66
  exclude "**/java/**"
67
  exclude "**/testdriver/**"
68
  exclude "net/sf/saxon/testdriver/**/*.java"
69
  exclude "**/jaxp/**"
70
  exclude "**/jdom/**"
71
  exclude "**/jdom2/**"
72
  exclude "**/axiom/**"
73
  exclude "**/s9api/DOMDestination.java"
74
  exclude "**/sql/**"
75
  exclude "**/xom/**"
76
  exclude "**/xpath/**"
77
  exclude "**/xqj/**"
78
  exclude "**/stax/**"
79
}
80

    
81
task pen_setupPreprocess(
82
  type: Copy,
83
  dependsOn: ["hen_featureKeys"],
84
  description: "Copy PE sources for preprocessing PE"
85
) {
86
  from "${projectDir}/src/main/java"
87
  into "${buildDir}/filtered/pen"
88
  include "net/sf/saxon/**/*.java"
89
  include "net/sf/saxon/data/**"
90
  exclude "net/sf/saxon/option/cpp/**"
91
  exclude "net/sf/saxon/jetonnet/**"
92
  exclude "net/sf/saxon/Gizmo.java"
93
  exclude "**/TransformerFactoryImpl.java"
94
  exclude "net/sf/saxon/BasicTransformerFactory.java"
95
  exclude "**/testdriver/**"
96
  exclude "**/ant/**"
97
  exclude "**/dom/**"
98
  exclude "**/dom4j/**"
99
  exclude "**/java/**"
100
  exclude "**/jaxp/**"
101
  exclude "**/jdom/**"
102
  exclude "**/jdom2/**"
103
  exclude "**/axiom/**"
104
  exclude "**/s9api/DOMDestination.java"
105
  exclude "**/sql/**"
106
  exclude "**/xom/**"
107
  exclude "**/xpath/**"
108
  exclude "**/xqj/**"
109
  exclude "**/stax/**"
110
  include "com/saxonica/**/*.java"
111
  exclude "com/saxonica/ee/**/*.java"
112
  exclude "com/saxonica/functions/extfn/cpp/*.java"
113
  exclude "com/saxonica/testdriver/**/*.java"
114
  exclude "net/sf/saxon/testdriver/**/*.java"
115
  exclude "com/saxonica/jaxp/*.java"
116
  exclude "com/saxonica/js/**"
117
  exclude "com/saxonica/config/ProfessionalXPathFactory.java" 
118
  exclude "com/saxonica/config/EnterpriseConfiguration.java" 
119
  exclude "com/saxonica/config/JavaPlatformPE.java" 
120
  exclude "com/saxonica/config/JavaPlatformEE.java" 
121
  exclude "com/saxonica/config/JavaPlatformC.java"
122
  exclude "com/saxonica/config/ee/**" 
123
  exclude "com/saxonica/stream/**" 
124
  exclude "com/saxonica/schema/**" 
125
  exclude "com/saxonica/bytecode/**" 
126
  exclude "com/saxonica/expr/ee/**" 
127
  exclude "com/saxonica/update/**/*.java"
128
  exclude "com/saxonica/validate/**/*.java"
129
  exclude "com/saxonica/expr/CastToUnion.java"
130
  exclude "com/saxonica/expr/CastableToUnion.java"
131
  exclude "com/saxonica/expr/CastableToUnion.java"
132
  exclude "com/saxonica/Validate.java"
133
  exclude "com/saxonica/config/ProfessionalTransformerFactory.java"
134
  exclude "com/saxonica/config/ProfessionalXPathFactory.java"
135
  exclude "com/saxonica/config/EnterpriseTransformerFactory.java"
136
  exclude "com/saxonica/config/StreamingTransformerFactory.java"
137
  exclude "com/saxonica/config/EnterpriseXPathFactory.java"
138
  exclude "com/saxonica/config/DynamicLoaderEE.java"
139
  exclude "com/saxonica/config/StandardSchemaResolver.java"
140
  exclude "com/saxonica/functions/extfn/NativeCall.java"
141
  exclude "**/xqj/**"
142
}
143

    
144
task een_setupPreprocess(
145
  type: Copy,
146
  dependsOn: ["hen_featureKeys"],
147
  description: "Copy EE sources for preprocessing EE"
148
) {
149
  from "${projectDir}/src/main/java"
150
  into "${buildDir}/filtered/een"
151
  include "net/sf/saxon/**/*.java"
152
  include "net/sf/saxon/data/**"
153
  exclude "net/sf/saxon/TransformerFactoryImpl.java"
154
  exclude "net/sf/saxon/BasicTransformerFactory.java"
155
  exclude "net/sf/saxon/option/cpp/**"
156
  exclude "net/sf/saxon/jetonnet/**"
157
  exclude "net/sf/saxon/Gizmo.java"
158
  exclude "**/ant/**"
159
  exclude "**/dom/**"
160
  exclude "**/dom4j/**"
161
  exclude "**/java/**"
162
  exclude "**/jaxp/**"
163
  exclude "**/jdom/**"
164
  exclude "**/jdom2/**"
165
  exclude "**/axiom/**"
166
  exclude "**/s9api/DOMDestination.java"
167
  exclude "**/sql/**"
168
  exclude "**/xom/**"
169
  exclude "**/xpath/**"
170
  exclude "**/xqj/**"
171
  exclude "**/stax/**"
172
  include "com/saxonica/**/*.java"
173
  exclude "com/saxonica/functions/extfn/cpp/*.java"
174
  exclude "com/saxonica/testdriver/**/*.java"
175
  exclude "net/sf/saxon/testdriver/**/*.java"
176
  exclude "com/saxonica/ee/jaxp/*.java"
177
  exclude "com/saxonica/js/**"
178
  exclude "com/saxonica/ee/domino/**/*.java"
179
  exclude "com/saxonica/config/JavaPlatformPE.java"
180
  exclude "com/saxonica/config/JavaPlatformEE.java"
181
  exclude "com/saxonica/config/JavaPlatformC.java"
182
  exclude "com/saxonica/config/ProfessionalXPathFactory.java"
183
  exclude "com/saxonica/config/EnterpriseXPathFactory.java"
184
  exclude "com/saxonica/config/ProfessionalTransformerFactory.java"
185
  exclude "com/saxonica/config/EnterpriseTransformerFactory.java"
186
  exclude "com/saxonica/config/StreamingTransformerFactory.java"
187
  exclude "com/saxonica/config/NativePlatformPE.java"
188
  exclude "**/xqj/**"
189
}
190

    
191
task hen_preprocess(
192
  type: JavaExec,
193
  dependsOn: ["hen_setupPreprocess"],
194
  description: "Preprocess HE sources"
195
) {
196
  inputs.files fileTree(dir: "${buildDir}/filtered/hen")
197
  outputs.files fileTree(dir: "${buildDir}/preprocess/hen")
198
  classpath = configurations.preprocessor
199
  main = "com.igormaznitsa.jcp.JcpPreprocessor"
200
  args "/c",
201
    "/i:${buildDir}/filtered/hen", "/o:${buildDir}/preprocess/hen",
202
    "/p:EE=false", "/p:PE=false", "/p:DOTNET=true",
203
    "/p:SAXONC=false", "/p:BYTECODE=false"
204
  doFirst {
205
    mkdir "${buildDir}/preprocess/hen"
206
  }
207
}
208

    
209
task pen_preprocess(
210
  type: JavaExec,
211
  dependsOn: ["pen_setupPreprocess"],
212
  description: "Preprocess PE sources"
213
) {
214
  inputs.files fileTree(dir: "${buildDir}/filtered/pen")
215
  outputs.files fileTree(dir: "${buildDir}/preprocess/pen")
216
  classpath = configurations.preprocessor
217
  main = "com.igormaznitsa.jcp.JcpPreprocessor"
218
  args "/c",
219
    "/i:${buildDir}/filtered/pen", "/o:${buildDir}/preprocess/pen",
220
    "/p:EE=false", "/p:PE=true", "/p:DOTNET=true",
221
    "/p:SAXONC=false", "/p:BYTECODE=false", "/p:HOF=true"
222
  doFirst {
223
    mkdir "${buildDir}/preprocess/pen"
224
  }
225
}
226

    
227
task een_preprocess(
228
  type: JavaExec,
229
  dependsOn: ["een_setupPreprocess"],
230
  description: "Preprocess EE sources"
231
) {
232
  inputs.files fileTree(dir: "${buildDir}/filtered/een")
233
  outputs.files fileTree(dir: "${buildDir}/preprocess/een")
234
  classpath = configurations.preprocessor
235
  main = "com.igormaznitsa.jcp.JcpPreprocessor"
236
  args "/c",
237
    "/i:${buildDir}/filtered/een", "/o:${buildDir}/preprocess/een",
238
    "/p:EE=true", "/p:PE=false", "/p:DOTNET=true",
239
    "/p:SAXONC=false", "/p:BYTECODE=true", "/p:HOF=true",
240
    "/p:STREAM=true", "/p:SCHEMA=true"
241
  doFirst {
242
    mkdir "${buildDir}/preprocess/een"
243
  }
244
}
245

    
246
task hen_sources(
247
  type: Copy,
248
  dependsOn: ["hen_preprocess"],
249
  description: "Collect the preprocessed HE sources for compilation"
250
) {
251
  from "${buildDir}/preprocess/hen"
252
  into "${buildDir}/src/hen"
253
  filter { line ->
254
    if (line.contains("import com.saxonica")
255
        || line.contains("import net.sf.saxon.stax")
256
        || line.contains("import net.sf.saxon.jaxp")
257
        || line.contains("net.sf.saxon.xpath.JAXPXPathStaticContext")) {
258
      null
259
    } else {
260
      line
261
    }
262
  }
263
}
264

    
265
task pen_sources(
266
  type: Copy,
267
  dependsOn: ["pen_preprocess"],
268
  description: "Collect the preprocessed PE sources for compilation"
269
) {
270
  from "${buildDir}/preprocess/pen"
271
  into "${buildDir}/src/pen"
272
  filter { line ->
273
    if (line.contains("import com.saxonica.ee")
274
        || line.contains("import com.saxonica.config.ee")
275
        || line.contains("net.sf.saxon.xpath.JAXPXPathStaticContext")
276
        || line.contains("import net.sf.saxon.stax")
277
        || line.contains("import net.sf.saxon.jaxp")) {
278
      null
279
    } else {
280
      line
281
    }
282
  }
283
}
284

    
285
task een_sources(
286
  type: Copy,
287
  dependsOn: ["een_preprocess"],
288
  description: "Collect the preprocessed EE sources for compilation"
289
) {
290
  from "${buildDir}/preprocess/een"
291
  into "${buildDir}/src/een"
292
  filter { line ->
293
    if (line.contains("net.sf.saxon.xpath.JAXPXPathStaticContext")
294
        || line.contains("import com.saxonica.ee.jaxp.SchemaFactoryImpl")
295
        || line.contains("import net.sf.saxon.stax")
296
        || line.contains("import net.sf.saxon.jaxp")) {
297
      null
298
    } else {
299
      line
300
    }
301
  }
302
}
303

    
304
// ============================================================
305

    
306
Task chsa = task hen_copySaxonApi(
307
  type: Copy,
308
  description: "Copy the Saxon.API C# files"
309
) {
310
  from "${projectDir}/src/main/csharp/api/Saxon.Api"
311
  into "${buildDir}/n/csharp/api/Saxon.Api"
312
  include "*.cs"
313
}
314

    
315
task hen_ApiAssemblyInfo(
316
  description: "Create the AssemblyInfo.cs file for the Saxon.Api"
317
) {
318
  outputs.file("${buildDir}/n/csharp/api/Saxon.Api/Properties/AssemblyInfo.cs")
319
  doLast {
320
    new File("${buildDir}/n/csharp/api/Saxon.Api/Properties/AssemblyInfo.cs")
321
      .withWriter("utf-8") { writer ->
322
        writer.writeLine("          using System.Reflection;")
323
        writer.writeLine("          using System.Runtime.CompilerServices;")
324
        writer.writeLine("          using System.Runtime.InteropServices;")
325
        writer.writeLine("          [assembly: AssemblyTitle(\"Saxon.Api\")]")
326
        writer.writeLine("          [assembly: AssemblyDescription(\"\")]")
327
        writer.writeLine("          [assembly: AssemblyConfiguration(\"\")]")
328
        writer.writeLine("          [assembly: AssemblyCompany(\"Saxonica\")]")
329
        writer.writeLine("          [assembly: AssemblyProduct(\"Saxon.Api\")]")
330
        writer.writeLine("          [assembly: AssemblyCopyright(\"Copyright © Saxonica 2020\")]")
331
        writer.writeLine("          [assembly: AssemblyTrademark(\"\")]")
332
        writer.writeLine("          [assembly: AssemblyCulture(\"\")]")
333
        writer.writeLine("          [assembly: ComVisible(false)]")
334
        writer.writeLine("          [assembly: Guid(\"8cf9aad8-da5f-47f0-9251-1fbcbdcfe477\")]")
335
        writer.writeLine("          [assembly: AssemblyVersion(\"${saxonVersion}\")]")
336
        writer.writeLine("          [assembly: AssemblyFileVersion(\"${saxonVersion}\")]")
337
      }
338
  }
339
  doFirst {
340
    mkdir "${buildDir}/n/csharp/api/Saxon.Api/Properties"
341
  }
342
}
343

    
344
task hen_copySaxonCmd(
345
  type: Copy,
346
  description: "Copy the cmd C# files"
347
) {
348
  from "${projectDir}/src/main/csharp/cmd"
349
  into "${buildDir}/n/csharp/cmd"
350
  include "**/Transform.cs"
351
  include "**/Query.cs"
352
  include "**/Validate.cs"
353
}
354

    
355
task hen_copySamples(
356
  type: Copy,
357
  description: "Copy the HE sample C# files"
358
) {
359
  from "${projectDir}/src/samples/cs"
360
  into "${buildDir}/n/csharp/samples"
361
  include "ExamplesEE.cs"
362
  include "ExamplesHE.cs"
363
  include "ExamplesPE.cs"
364
  include "SampleExtensions.cs"
365
  include "XPathExample.cs"
366
}
367

    
368
task hen_copyDevelopmentSources(
369
  dependsOn: ["hen_copySaxonApi", "hen_ApiAssemblyInfo",
370
              "hen_copySaxonCmd", "hen_copySamples"],
371
  description: "Setup the C# build environment"
372
) {
373
    // Just a task to hang dependencies on
374
}
375

    
376
task henCompile(
377
  type: JavaCompile,
378
  dependsOn: ["hen_sources", "hen_copyDevelopmentSources"],
379
  description: "Compile HE for .NET"
380
) {
381
  classpath = configurations.compileClasspath + configurations.compileDotNet
382
  source = "${buildDir}/src/hen"
383
  destinationDirectory = new File("${buildDir}/classes/hen")
384
}
385

    
386
task penCompile(
387
  type: JavaCompile,
388
  dependsOn: ["pen_sources", "hen_copyDevelopmentSources"],
389
  description: "Compile PE for .NET"
390
) {
391
  classpath = configurations.compileClasspath + configurations.compileDotNet
392
  source = "${buildDir}/src/pen"
393
  destinationDirectory = new File("${buildDir}/classes/pen")
394
}
395

    
396
task eenCompile(
397
  type: JavaCompile,
398
  dependsOn: ["een_sources", "hen_copyDevelopmentSources"],
399
  description: "Compile EE for .NET"
400
) {
401
  classpath = configurations.compileClasspath + configurations.asmDotNet
402
  source = "${buildDir}/src/een"
403
  destinationDirectory = new File("${buildDir}/classes/een")
404
}
405

    
406
task hen_jar(
407
  type: Jar,
408
  dependsOn: ["henCompile"],
409
  description: "Build the HE jar file for Saxon .NET"
410
) {
411
  archiveBaseName = "saxon10he"
412
  destinationDirectory = file("${buildDir}/n/jar")
413
  from ("build/classes/hen") {
414
    include "net/**/*.class"
415
    exclude "net/sf/saxon/option/**/*.class"
416
  }
417
  from ("build/src/hen") {
418
    include "**"
419
  }
420
  doFirst {
421
    mkdir "build/n/jar"
422
  }
423
}
424

    
425
task pen_jar(
426
  type: Jar,
427
  dependsOn: ["penCompile"],
428
  description: "Build the PE jar file for Saxon .NET"
429
) {
430
  archiveBaseName = "saxon10pe"
431
  destinationDirectory = file("${buildDir}/n/jar")
432
  from ("build/classes/pen") {
433
    include "net/**/*.class"
434
    exclude "net/sf/saxon/ant/*.class"
435
    exclude "**/sql/**/*.class"
436
    include "com/saxonica/**/*.class"
437
    exclude "com/saxonica/bytecode/**/*.class"
438
    exclude "com/saxonica/jaxp/**/**/*.class"
439
    exclude "com/saxonica/schema/**/*.class"
440
    exclude "com/saxonica/stream/**/*.class"
441
    exclude "com/saxonica/testdriver/**/*.class"
442
    exclude "net/sf/saxon/testdriver/**/*.class"
443
    exclude "com/saxonica/update/**/*.class"
444
    exclude "com/saxonica/validate/**/*.class"
445
    exclude "com/saxonica/expr/CastToUnion.class"
446
    exclude "com/saxonica/expr/CastableToUnion.class"
447
    exclude "com/saxonica/expr/CastableToList.class"
448
    exclude "com/saxonica/Validate.class"
449
    exclude "com/saxonica/config/EnterpriseConfiguration.class"
450
    exclude "com/saxonica/config/EnterpriseConfiguration\$SurrogateSchema.class"
451
    exclude "com/saxonica/config/EnterpriseConfiguration\$1.class"
452
    exclude "com/saxonica/config/ProfessionalTransformerFactory.class"
453
    exclude "com/saxonica/config/ProfessionalXPathFactory.class"
454
    exclude "com/saxonica/config/EnterpriseTransformerFactory.class"
455
    exclude "com/saxonica/config/StreamingTransformerFactory.class"
456
    exclude "com/saxonica/config/EnterpriseXPathFactory.class"
457
    exclude "com/saxonica/config/DynamicLoaderEE.class"
458
    exclude "com/saxonica/config/StandardSchemaResolver.class"
459
    exclude "com/saxonica/expr/ee/*.class"
460
  }
461
  from ("src/main/java") {
462
    include "net/sf/saxon/data/**"
463
  }
464
  doFirst {
465
    mkdir "build/n/jar"
466
  }
467
}
468

    
469
task een_jar(
470
  type: Jar,
471
  dependsOn: ["eenCompile"],
472
  description: "Build the EE jar file for Saxon .NET"
473
) {
474
  archiveBaseName = "saxon10ee"
475
  destinationDirectory = file("${buildDir}/n/jar")
476
  from ("build/classes/een") {
477
    include "net/**/*.class"
478
    include "com/saxonica/**/*.class"
479
    include "org/objectweb/**/*.class"
480
    exclude "com/saxonica/config/EnterpriseTransformerFactory.class"
481
    exclude "com/saxonica/config/EnterpriseXPathFactory.class"
482
  }
483
  from ("src/main/java") {
484
    include "net/sf/saxon/data/**"
485
  }
486
  doFirst {
487
    mkdir "build/n/jar"
488
  }
489
}
490

    
491
task ikvm_prepareJarAsm(
492
  type: Copy,
493
  description: "Copy the ASM jars for IKVM"
494
) {
495
  from "lib/asm-${asmVersion}"
496
  into "${buildDir}/n/jar/asm-${asmVersion}"
497
  include "*.jar"
498
}
499

    
500
task ikvm_prepareJar(
501
  type: Copy,
502
  dependsOn: ["ikvm_prepareJarAsm", "rejar_Xerces"],
503
  description: "Copy the ICU4J, TagSoup, Mail, and Xerces jars for IKVM"
504
) {
505
  from "${icu4jJar}"
506
  into "${buildDir}/n/jar"
507
  from "${tagsoupJar}"
508
  into "${buildDir}/n/jar"
509
  from "${mailJar}"
510
  into "${buildDir}/n/jar"
511
  from "${buildDir}/xerces/xerces.jar"
512
  into "${buildDir}/n/jar"
513
}
514

    
515
task "n_notices"(
516
  type: Copy,
517
  description: "Copy the notices into the staging directory"
518
) {
519
  from "src/docs/notices"
520
  into "${buildDir}/n/notices"
521
}
522

    
523
["h", "p", "e"].each { initial ->
524
  def release = initial + "e"
525
  def RELEASE = release.toUpperCase()
526
  task "${release}n_setupDll"(
527
    type: Copy,
528
    dependsOn: ["${release}n_jar", "ikvm_prepareJar"],
529
    description: "Setup the IKVM environment for ${RELEASE}"
530
) {
531
    from "${ikvmDir}/ikvm-${ikvmVersion}/bin"
532
    into "${buildDir}/n/bin/${release}"
533
    include "IKVM.OpenJDK.Core.dll"
534
    include "IKVM.OpenJDK.Charsets.dll"
535
    include "IKVM.OpenJDK.Text.dll"
536
    include "IKVM.OpenJDK.Util.dll"
537
    include "IKVM.OpenJDK.XML.API.dll"
538
    include "IKVM.OpenJDK.Security.dll"
539
    //include "xercesImpl.dll"
540
    include "IKVM.Runtime.dll"
541
  }
542

    
543
  task "${release}n_iss"(
544
    type: Copy,
545
    description: "Create the ${release}.iss file for the .net installer"
546
  ) {
547
    inputs.file("${projectDir}/src/dotnet/${release}.iss")
548
    outputs.file("${buildDir}/n/${release}.iss")
549

    
550
    from "${projectDir}/src/dotnet/${release}.iss"
551
    into "${buildDir}/n"
552
    filter { line ->
553
      line \
554
        .replace("@@SOURCE_DIR@@", "bin\\${release}") \
555
        .replace("@@OUTPUT_DIR@@", "..\\..\\..\\distributions") \
556
        .replace("@@VERSION@@", saxonVersion) \
557
        .replace("@@VERSION_H@@", version_h) \
558
        .replace("@@IKVM_STRONGNAME@@", ikvmStrongname) \
559
        .replace("@@MAJOR_VERSION@@", saxonMajorVersion) \
560
        .replace("@@MINOR_VERSION@@", saxonMinorVersion) \
561
        .replace("@@COPYRIGHT_YEAR@@", "2020")
562
    }
563
  }
564

    
565
  task "${release}nInstaller"(
566
    type: Exec,
567
    dependsOn: ["${release}nProduct", "${release}n_iss", "n_notices"],
568
    description: "Build the ${RELEASE} installer for .NET"
569
  ) {
570
    commandLine "${dotNetInstaller}",
571
      "/cc", "${buildDir}/n/${release}.iss"
572
  }
573

    
574
  task "${release}nSigner"(
575
    type: Exec,
576
    dependsOn: ["${release}nInstaller"]
577
  ) {
578
    commandLine "signtool",
579
      "sign", "/a",
580
      "/tr", "http://rfc3161timestamp.globalsign.com/advanced",
581
      "/td", "SHA256",
582
      "${buildDir}/distributions/Saxon${RELEASE}${saxonMajorVersion}-${saxonMinorVersion}N-setup.exe"
583
  }
584
}
585

    
586
task henDll(
587
  type: Exec,
588
  dependsOn: ["hen_setupDll"],
589
  description: "Build HE .dll with IKVM"
590
) {
591
  inputs.files("${buildDir}/n/bin/jar")
592
  inputs.file("${buildDir}/xerces/xerces.jar")
593
  inputs.file("${ikvmDir}/saxondotnet.snk")
594
  outputs.file("build/n/bin/he/saxon-he-${saxonMajorVersion}.${saxonMinorVersion}.dll")
595

    
596
  def ikvmCommand = ikvmExecutable \
597
  + additionalIkvmOptions \
598
  + ["-out:${buildDir}/n/bin/he/saxon-he-${saxonMajorVersion}.${saxonMinorVersion}.dll",
599
     "-assembly:saxon-he-${saxonMajorVersion}.${saxonMinorVersion}",
600
     "-target:library",
601
     "-keyfile:${ikvmDir}/saxondotnet.snk",
602
     "-version:${saxonVersion}",
603
     "-srcpath:${buildDir}/preprocess/hen",
604
     "-reference:mscorlib.dll",
605
     "-reference:System.Xml.dll",
606
     "-reference:System.dll",
607
     "-reference:${buildDir}/n/bin/he/IKVM.OpenJDK.Core.dll",
608
     "${buildDir}/n/jar/saxon10he.jar",
609
     "${buildDir}/n/jar/xerces.jar"]
610

    
611
  commandLine ikvmCommand
612
  doFirst {
613
    mkdir "${buildDir}/n/bin/he"
614
  }
615
}
616

    
617
task penDll(
618
  type: Exec,
619
  dependsOn: ["pen_setupDll"],
620
  description: "Build PE .dll with IKVM"
621
) {
622
  inputs.files("${buildDir}/n/bin/jar")
623
  inputs.file("${buildDir}/xerces/xerces.jar")
624
  inputs.file("${ikvmDir}/saxondotnet.snk")
625
  outputs.file("build/n/bin/pe/saxon-pe-${saxonMajorVersion}.${saxonMinorVersion}.dll")
626

    
627
  def ikvmCommand = ikvmExecutable \
628
  + additionalIkvmOptions \
629
  + ["-out:${buildDir}/n/bin/pe/saxon-pe-${saxonMajorVersion}.${saxonMinorVersion}.dll",
630
     "-assembly:saxon-pe-${saxonMajorVersion}.${saxonMinorVersion}",
631
     "-target:library",
632
     "-keyfile:${ikvmDir}/saxondotnet.snk",
633
     "-version:${saxonVersion}",
634
     "-srcpath:${buildDir}/preprocess/pen",
635
     "-reference:mscorlib.dll",
636
     "-reference:System.Xml.dll",
637
     "-reference:System.dll",
638
     "-reference:${buildDir}/n/bin/pe/IKVM.OpenJDK.Core.dll",
639
     "-reference:System.Security.dll",
640
     "${buildDir}/n/jar/saxon10pe.jar",
641
     "${buildDir}/n/jar/xerces.jar",
642
     "${buildDir}/n/jar/tagsoup-${tagsoupVersion}.jar",
643
     "${buildDir}/n/jar/javax.mail-${mailVersion}.jar",
644
     "${buildDir}/n/jar/icu4j-${icu4jVersion}.jar"]
645

    
646
  commandLine ikvmCommand
647
  doFirst {
648
    mkdir "${buildDir}/n/bin/pe"
649
  }
650
}
651

    
652
task eenDll(
653
  type: Exec,
654
  dependsOn: ["een_setupDll"],
655
  description: "Build EE .dll with IKVM"
656
) {
657
  inputs.files("${buildDir}/n/bin/jar")
658
  inputs.file("${buildDir}/xerces/xerces.jar")
659
  inputs.file("${ikvmDir}/saxondotnet.snk")
660
  outputs.file("${buildDir}/n/bin/ee/saxon-ee-${saxonMajorVersion}.${saxonMinorVersion}.dll")
661

    
662
  def ikvmCommand = ikvmExecutable \
663
  + additionalIkvmOptions \
664
  + ["-out:${buildDir}/n/bin/ee/saxon-ee-${saxonMajorVersion}.${saxonMinorVersion}.dll",
665
     "-assembly:saxon-ee-${saxonMajorVersion}.${saxonMinorVersion}",
666
     "-target:library",
667
     "-keyfile:${ikvmDir}/saxondotnet.snk",
668
     "-version:${saxonVersion}",
669
     "-srcpath:${buildDir}/preprocess/een",
670
     "-reference:mscorlib.dll",
671
     "-reference:System.Xml.dll",
672
     "-reference:System.dll",
673
     "-reference:${buildDir}/n/bin/ee/IKVM.OpenJDK.Core.dll",
674
     "-reference:System.Security.dll",
675
     "${buildDir}/n/jar/saxon10ee.jar",
676
     "${buildDir}/n/jar/xerces.jar",
677
     "${buildDir}/n/jar/asm-${asmVersion}/asm-${asmVersion}.jar",
678
     "${buildDir}/n/jar/asm-${asmVersion}/asm-analysis-${asmVersion}.jar",
679
     "${buildDir}/n/jar/asm-${asmVersion}/asm-commons-${asmVersion}.jar",
680
     "${buildDir}/n/jar/asm-${asmVersion}/asm-tree-${asmVersion}.jar",
681
     "${buildDir}/n/jar/asm-${asmVersion}/asm-util-${asmVersion}.jar",
682
     "${buildDir}/n/jar/tagsoup-${tagsoupVersion}.jar",
683
     "${buildDir}/n/jar/javax.mail-${mailVersion}.jar",
684
     "${buildDir}/n/jar/icu4j-${icu4jVersion}.jar"]
685

    
686
  commandLine ikvmCommand
687
  doFirst {
688
    mkdir "${buildDir}/n/bin/ee"
689
  }
690
}
691

    
692
task productDlls(
693
  dependsOn: ["henDll", "penDll", "eenDll"],
694
  description: "Build all the product .dll files with IKVM"
695
) {
696
  doLast {
697
    println("Built DLLs")
698
  }
699
}
700

    
701
// ============================================================
702
// Tasks to rejar Xerces and Resolver for .NET
703

    
704
task unjar_XercesImpl(
705
  type: Copy,
706
  description: "Unjar XercesImple for .NET build"
707
) {
708
  inputs.file("lib/xercesImpl.jar")
709
  outputs.files(fileTree("${buildDir}/xerces/org/apache/xerces"))
710
  from zipTree(file("lib/xercesImpl.jar"))
711
  into "${buildDir}/xerces"
712
}
713

    
714
task unjar_Resolver(
715
  type: Copy,
716
  description: "Unjar Resolver for .NET build"
717
) {
718
  from zipTree(file(resolverJar))
719
  into "${buildDir}/xerces"
720
}
721
// This task is always out of date because
722
// .../build/xerces/META-INF/MANIFEST.MF has changed.
723
// Skip this if it doesn't seem to be necessary
724
unjar_Resolver.onlyIf {
725
  !file("${buildDir}/xerces/org/apache/xml/resolver/Catalog.class").exists()
726
}
727

    
728
task rejar_Xerces(
729
  type: Jar,
730
  dependsOn: ["unjar_XercesImpl", "unjar_Resolver"],
731
  description: "Unjar Xerces and Resolver for .NET build"
732
) {
733
  inputs.files fileTree("${buildDir}/xerces/org")
734
  outputs.file "${buildDir}/xerces/xerces.jar"
735
  archiveBaseName = "xerces"
736
  destinationDirectory = file("${buildDir}/xerces")
737
  from ("${buildDir}/xerces") {
738
    include "**/*.class"
739
    include "**/*.properties"
740
    exclude "org.w3c.dom.html.HTMLDOMImplementation.class"
741
    exclude "META-INF/MANIFEST.MF"
742
  }
743
}
744

    
745
task hen_cmdAssemblyInfo(
746
  description: "Create the AssemblyInfo.cs file for the Saxon commands"
747
) {
748
  outputs.file("${buildDir}/n/csharp/cmd/AssemblyInfo.cs")
749
  doLast {
750
    new File("${buildDir}/n/csharp/cmd/AssemblyInfo.cs")
751
      .withWriter("utf-8") { writer ->
752
        writer.writeLine("          using System.Reflection;")
753
        writer.writeLine("          using System.Runtime.CompilerServices;")
754
        writer.writeLine("          using System.Runtime.InteropServices;")
755
        writer.writeLine("          [assembly: AssemblyCompany(\"Saxonica\")]")
756
        writer.writeLine("          [assembly: AssemblyProduct(\"Saxon.HE\")]")
757
        writer.writeLine("          [assembly: AssemblyCopyright(\"Copyright © Saxonica 2020\")]")
758
        writer.writeLine("          [assembly: AssemblyVersion(\"${saxonVersion}\")]")
759
        writer.writeLine("          [assembly: AssemblyFileVersion(\"${saxonVersion}\")]")
760
      }
761
  }
762
  doFirst {
763
    mkdir "${buildDir}/n/csharp/cmd"
764
  }
765
}
766

    
767
// If we didn't find a C# compiler, abort all the C# compile steps
768
if (csharpCompiler == null) {
769
  ["h", "p", "e"].each { initial ->
770
    def release = initial + "e"
771
    def Release = initial.toUpperCase() + "e"
772
    def RELEASE = release.toUpperCase()
773
    def product = "${release}n"
774
    ["csharpApi", "csharpTransform", "csharpQuery"].each { step ->
775
      def desc = "Compile Saxon.Api for ${RELEASE}"
776
      if (step == "csharpTransform") {
777
        desc = "Compile Tranform.exe for ${RELEASE}"
778
      } else if (step == "csharpQuery") {
779
        desc = "Compile Query.exe for ${RELEASE}"
780
      }
781
      desc = desc + " (Fails on this platform)"
782
      task "${product}_${step}"(
783
        description: desc
784
      ) {
785
        doLast {
786
          throw new GradleException("Cannot build .NET; no C# compiler.")
787
        }
788
      }
789
    }
790
  }
791
  task een_csharpValidate(
792
    description: "Compile Validate.exe for EE (Fails on this platform)"
793
  ) {
794
    doLast {
795
      throw new GradleException("Cannot build .NET; no C# compiler.")
796
    }
797
  } 
798
} else {
799
  task hen_csharpApi(
800
    dependsOn: ["henDll"],
801
    description: "Compile Saxon.Api for HE"
802
  ) {
803
    inputs.files("${buildDir}/n/build/dll/he")
804
    inputs.files("${buildDir}/n/csharp/api")
805
    outputs.file("${buildDir}/n/bin/he/saxon-he-api-${saxonMajorVersion}.${saxonMinorVersion}.dll")
806

    
807
    doLast {
808
      def args = csharpCompiler \
809
      + ["-out:${buildDir}/n/bin/he/saxon-he-api-${saxonMajorVersion}.${saxonMinorVersion}.dll",
810
         "-target:library",
811
         "-doc:${buildDir}/n/saxon-he-api-${saxonMajorVersion}.${saxonMinorVersion}.xml",
812
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
813
      fileTree(dir: "${buildDir}/n/bin/he",
814
               include: "*.dll").each { dll ->
815
        args += ["-reference:${dll}"]
816
      }
817
      fileTree(dir: "${buildDir}/n/csharp/api/Saxon.Api",
818
               include: "**/*.cs").each { cs ->
819
        args += [cs]
820
      }
821

    
822
      exec {
823
        commandLine args
824
      }
825
    }
826
  }
827

    
828
  task hen_csharpTransform(
829
    dependsOn: ["henDll", "hen_csharpApi", "hen_cmdAssemblyInfo"],
830
    description: "Compile Transform.exe for HE"
831
  ) {
832
    inputs.files("${buildDir}/n/build/dll/he")
833
    inputs.files("${buildDir}/n/csharp/cmd")
834
    outputs.file("${buildDir}/n/bin/he/Transform.exe")
835

    
836
    doLast {
837
      def args = csharpCompiler \
838
      + ["-out:${buildDir}/n/bin/he/Transform.exe",
839
         "-target:exe",
840
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
841
      fileTree(dir: "${buildDir}/n/bin/he",
842
               include: "*.dll").each { dll ->
843
        args += ["-reference:${dll}"]
844
      }
845
      // This only runs on Windows, so make sure you use "\"
846
      args += ["${buildDir}\\n\\csharp\\cmd\\Transform.cs",
847
               "${buildDir}\\n\\csharp\\cmd\\AssemblyInfo.cs"]
848

    
849
      exec {
850
        commandLine args
851
      }
852
    }
853
  }
854

    
855
  task hen_csharpQuery(
856
    dependsOn: ["henDll", "hen_csharpApi", "hen_cmdAssemblyInfo"],
857
    description: "Compile Query.exe for HE"
858
  ) {
859
    inputs.files("${buildDir}/n/build/dll/he")
860
    inputs.files("${buildDir}/n/csharp/cmd")
861
    outputs.file("${buildDir}/n/bin/he/Query.exe")
862

    
863
    doLast {
864
      def args = csharpCompiler \
865
      + ["-out:${buildDir}/n/bin/he/Query.exe",
866
         "-target:exe",
867
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
868
      fileTree(dir: "${buildDir}/n/bin/he",
869
               include: "*.dll").each { dll ->
870
        args += ["-reference:${dll}"]
871
      }
872
      // This only runs on Windows, so make sure you use "\"
873
      args += ["${buildDir}\\n\\csharp\\cmd\\Query.cs",
874
               "${buildDir}\\n\\csharp\\cmd\\AssemblyInfo.cs"]
875

    
876
      exec {
877
        commandLine args
878
      }
879
    }
880
  }
881

    
882
  task pen_csharpApi(
883
    dependsOn: ["penDll"],
884
    description: "Compile Saxon.Api for PE"
885
  ) {
886
    inputs.files("${buildDir}/n/build/dll/pe")
887
    inputs.files("${buildDir}/n/csharp/api")
888
    outputs.file("${buildDir}/n/bin/pe/saxon-pe-api-${saxonMajorVersion}.${saxonMinorVersion}.dll")
889

    
890
    doLast {
891
      def args = csharpCompiler \
892
      + ["-out:${buildDir}/n/bin/pe/saxon-pe-api-${saxonMajorVersion}.${saxonMinorVersion}.dll",
893
         "-target:library",
894
         "-doc:${buildDir}/n/saxon-pe-api-${saxonMajorVersion}.${saxonMinorVersion}.xml",
895
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
896
      fileTree(dir: "${buildDir}/n/bin/pe",
897
               include: "*.dll").each { dll ->
898
        args += ["-reference:${dll}"]
899
      }
900
      fileTree(dir: "${buildDir}/n/csharp/api/Saxon.Api",
901
               include: "**/*.cs").each { cs ->
902
        args += [cs]
903
      }
904

    
905
      exec {
906
        commandLine args
907
      }
908
    }
909
  }
910

    
911
  task pen_csharpTransform(
912
    dependsOn: ["penDll", "pen_csharpApi", "hen_cmdAssemblyInfo"],
913
    description: "Compile Transform.exe for PE"
914
  ) {
915
    inputs.files("${buildDir}/n/build/dll/pe")
916
    inputs.files("${buildDir}/n/csharp/cmd")
917
    outputs.file("${buildDir}/n/bin/pe/Transform.exe")
918

    
919
    doLast {
920
      def args = csharpCompiler \
921
      + ["-out:${buildDir}/n/bin/pe/Transform.exe",
922
         "-target:exe",
923
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
924
      fileTree(dir: "${buildDir}/n/bin/pe",
925
               include: "*.dll").each { dll ->
926
        args += ["-reference:${dll}"]
927
      }
928
      // This only runs on Windows, so make sure you use "\"
929
      args += ["${buildDir}\\n\\csharp\\cmd\\Transform.cs",
930
               "${buildDir}\\n\\csharp\\cmd\\AssemblyInfo.cs"]
931

    
932
      exec {
933
        commandLine args
934
      }
935
    }
936
  }
937

    
938
  task pen_csharpQuery(
939
    dependsOn: ["penDll", "pen_csharpApi", "hen_cmdAssemblyInfo"],
940
    description: "Compile Query.exe for PE"
941
  ) {
942
    inputs.files("${buildDir}/n/build/dll/pe")
943
    inputs.files("${buildDir}/n/csharp/cmd")
944
    outputs.file("${buildDir}/n/bin/pe/Query.exe")
945

    
946
    doLast {
947
      def args = csharpCompiler \
948
      + ["-out:${buildDir}/n/bin/pe/Query.exe",
949
         "-target:exe",
950
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
951
      fileTree(dir: "${buildDir}/n/bin/pe",
952
               include: "*.dll").each { dll ->
953
        args += ["-reference:${dll}"]
954
      }
955
      // This only runs on Windows, so make sure you use "\"
956
      args += ["${buildDir}\\n\\csharp\\cmd\\Query.cs",
957
               "${buildDir}\\n\\csharp\\cmd\\AssemblyInfo.cs"]
958

    
959
      exec {
960
        commandLine args
961
      }
962
    }
963
  }
964

    
965
  task een_csharpApi(
966
    dependsOn: ["eenDll"],
967
    description: "Compile Saxon.Api for EE"
968
  ) {
969
    inputs.files("${buildDir}/n/build/dll/ee")
970
    inputs.files("${buildDir}/n/csharp/api")
971
    outputs.file("${buildDir}/n/bin/ee/saxon-ee-api-${saxonMajorVersion}.${saxonMinorVersion}.dll")
972

    
973
    doLast {
974
      def args = csharpCompiler \
975
      + ["-out:${buildDir}/n/bin/ee/saxon-ee-api-${saxonMajorVersion}.${saxonMinorVersion}.dll",
976
         "-target:library",
977
         "-doc:${buildDir}/n/saxon-ee-api-${saxonMajorVersion}.${saxonMinorVersion}.xml",
978
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
979
      fileTree(dir: "${buildDir}/n/bin/ee",
980
               include: "*.dll").each { dll ->
981
        args += ["-reference:${dll}"]
982
      }
983
      fileTree(dir: "${buildDir}/n/csharp/api/Saxon.Api",
984
               include: "**/*.cs").each { cs ->
985
        args += [cs]
986
      }
987

    
988
      exec {
989
        commandLine args
990
      }
991
    }
992
  }
993

    
994
  task een_csharpTransform(
995
    dependsOn: ["eenDll", "een_csharpApi", "hen_cmdAssemblyInfo"],
996
    description: "Compile Transform.exe for EE"
997
  ) {
998
    inputs.files("${buildDir}/n/build/dll/ee")
999
    inputs.files("${buildDir}/n/csharp/cmd")
1000
    outputs.file("${buildDir}/n/bin/ee/Transform.exe")
1001

    
1002
    doLast {
1003
      def args = csharpCompiler \
1004
      + ["-out:${buildDir}/n/bin/ee/Transform.exe",
1005
         "-target:exe",
1006
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
1007
      fileTree(dir: "${buildDir}/n/bin/ee",
1008
               include: "*.dll").each { dll ->
1009
        args += ["-reference:${dll}"]
1010
      }
1011
      // This only runs on Windows, so make sure you use "\"
1012
      args += ["${buildDir}\\n\\csharp\\cmd\\Transform.cs",
1013
               "${buildDir}\\n\\csharp\\cmd\\AssemblyInfo.cs"]
1014

    
1015
      exec {
1016
        commandLine args
1017
      }
1018
    }
1019
  }
1020

    
1021
  task een_csharpQuery(
1022
    dependsOn: ["eenDll", "een_csharpApi", "hen_cmdAssemblyInfo"],
1023
    description: "Compile Query.exe for EE"
1024
  ) {
1025
    inputs.files("${buildDir}/n/build/dll/ee")
1026
    inputs.files("${buildDir}/n/csharp/cmd")
1027
    outputs.file("${buildDir}/n/bin/ee/Query.exe")
1028

    
1029
    doLast {
1030
      def args = csharpCompiler \
1031
      + ["-out:${buildDir}/n/bin/ee/Query.exe",
1032
         "-target:exe",
1033
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
1034
      fileTree(dir: "${buildDir}/n/bin/ee",
1035
               include: "*.dll").each { dll ->
1036
        args += ["-reference:${dll}"]
1037
      }
1038
      // This only runs on Windows, so make sure you use "\"
1039
      args += ["${buildDir}\\n\\csharp\\cmd\\Query.cs",
1040
               "${buildDir}\\n\\csharp\\cmd\\AssemblyInfo.cs"]
1041

    
1042
      exec {
1043
        commandLine args
1044
      }
1045
    }
1046
  }
1047

    
1048
  task een_csharpValidate(
1049
    dependsOn: ["eenDll", "een_csharpApi", "hen_cmdAssemblyInfo"],
1050
    description: "Compile Validate.exe for EE"
1051
  ) {
1052
    inputs.files("${buildDir}/n/build/dll/ee")
1053
    inputs.files("${buildDir}/n/csharp/cmd")
1054
    outputs.file("${buildDir}/n/bin/ee/Validate.exe")
1055

    
1056
    doLast {
1057
      def args = csharpCompiler \
1058
      + ["-out:${buildDir}/n/bin/ee/Validate.exe",
1059
         "-target:exe",
1060
         "-keyfile:${ikvmDir}/saxondotnet.snk"]
1061
      fileTree(dir: "${buildDir}/n/bin/ee",
1062
               include: "*.dll").each { dll ->
1063
        args += ["-reference:${dll}"]
1064
      }
1065
      // This only runs on Windows, so make sure you use "\"
1066
      args += ["${buildDir}\\n\\csharp\\cmd\\Validate.cs",
1067
               "${buildDir}\\n\\csharp\\cmd\\AssemblyInfo.cs"]
1068

    
1069
      exec {
1070
        commandLine args
1071
      }
1072
    }
1073
  }
1074
}
1075

    
1076
task henProduct(
1077
  type: Copy,
1078
  dependsOn: ["hen_csharpApi", "hen_csharpTransform", "hen_csharpQuery"],
1079
  description: "Build Saxon HE for .NET"
1080
) {
1081
  from "${buildDir}/n/saxon-he-api-${saxonMajorVersion}.${saxonMinorVersion}.xml"
1082
  into "${buildDir}/n/bin/he"
1083
}
1084

    
1085
task penProduct(
1086
  type: Copy,
1087
  dependsOn: ["pen_csharpApi", "pen_csharpTransform", "pen_csharpQuery"],
1088
  description: "Build Saxon PE for .NET"
1089
) {
1090
  from "${buildDir}/n/saxon-pe-api-${saxonMajorVersion}.${saxonMinorVersion}.xml"
1091
  into "${buildDir}/n/bin/pe"
1092
}
1093

    
1094
task eenProduct(
1095
  type: Copy,
1096
  dependsOn: ["een_csharpApi", "een_csharpTransform", "een_csharpQuery", "een_csharpValidate"],
1097
  description: "Build Saxon EE for .NET"
1098
) {
1099
  from "${buildDir}/n/saxon-ee-api-${saxonMajorVersion}.${saxonMinorVersion}.xml"
1100
  into "${buildDir}/n/bin/ee"
1101
}
1102

    
1103
if (file("${projectDir}/src/main/java/com").exists()) {
1104
  task dotNetProducts(
1105
    dependsOn: ["henProduct", "penProduct", "eenProduct"],
1106
    description: "Builds all of the .NET products"
1107
  ) {
1108
    // nop
1109
  }
1110

    
1111
  task dotNetInstallers(
1112
    dependsOn: ["henInstaller", "penInstaller", "eenInstaller"],
1113
    description: "Builds all of the .NET installers"
1114
  ) {
1115
    // nop
1116
  }
1117
} else {
1118
  // Ignore the EEJ and PEJ releases if the sources aren't available
1119
  task dotNetProducts(
1120
    dependsOn: ["henProduct"],
1121
    description: "Builds all of the .NET products"
1122
  ) {
1123
    // nop
1124
  }
1125

    
1126
  task dotNetInstallers(
1127
    dependsOn: ["henInstaller"],
1128
    description: "Builds all of the .NET installers"
1129
  ) {
1130
    // nop
1131
  }
1132
}
1133

    
1134

    
(7-7/13)