Project

Profile

Help

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

he / build-doc.gradle @ 6af44631

1
task clone_expath_cg(
2
  type: Exec,
3
  description: "Clones the expath-cg github repository for doc builds"
4
) {
5
  commandLine "git",
6
    "clone",
7
    "https://github.com/expath/expath-cg.git",
8
    "${buildDir}/expath-cg"
9
}
10
clone_expath_cg.onlyIf {
11
  !file("${buildDir}/expath-cg").exists()
12
}
13

    
14
// ============================================================
15

    
16
task documentation(
17
  dependsOn: ["update_documentation",
18
              "gen_contents_page", "gen_contents_page_static", 
19
              "gen_documentation_main",
20
              "gen_documentation_main_html"],
21
  description: "Build the website"
22
) {
23
  // Just a place to hang dependencies
24
}
25

    
26
// ============================================================
27

    
28
task product_javadoc(
29
  type: Javadoc,
30
  dependsOn: ["eej_sources"],
31
  description: "Generate Javadoc HTML files"
32
) {
33
  inputs.files fileTree(dir: "${projectDir}/src/eej")
34
  outputs.files fileTree(dir: "${buildDir}/javadoc")
35

    
36
  source = new File("${buildDir}/src/eej")
37
  destinationDir= new File("${buildDir}/javadoc")
38
  // noindex="false" notree="false"
39
  // maxmemory="512M" source="1.8"
40
  // -includeNamespace
41
  options.addStringOption("Xdoclint:none", "-quiet")
42
  include "net/**"
43
  include "com/**"
44
  include "javax/**"
45
  exclude "com/saxonica/testdriver/**"
46
  exclude "net/sf/saxon/testdriver/**"
47
  exclude "**/dotnet/**"
48
  exclude "**/DotNetVerifier.java"
49
  exclude "**/*.html"
50
}
51

    
52
task product_jeljavadoc(
53
  type: Javadoc,
54
  dependsOn: ["eej_sources"],
55
  description: "Generate Javadoc XML files"
56
) {
57
  inputs.files fileTree(dir: "${projectDir}/src/eej")
58
  inputs.file "${projectDir}/lib/jeldoc.jar"
59
  outputs.files fileTree(dir: "${buildDir}/jeljavadoc")
60

    
61
  source = new File("${buildDir}/src/eej")
62
  destinationDir= new File("${buildDir}/jeljavadoc")
63
  options.doclet = "com.jeldoclet.JELDoclet"
64
  options.docletpath = configurations.jeldoclet.files.asType(List)
65
  // noindex="false" notree="false"
66
  // maxmemory="512M" source="1.8"
67
  options.addStringOption("access", "package")
68
  options.addStringOption("filename", "jeldoclet-out.xml")
69
  options.addStringOption("outputEncoding", "utf-8")
70
  // -includeNamespace
71
  include "net/**"
72
  include "com/**"
73
  include "javax/**"
74
  exclude "com/saxonica/testdriver/**"
75
  exclude "net/sf/saxon/testdriver/**"
76
  exclude "**/dotnet/**"
77
  exclude "**/DotNetVerifier.java"
78
  exclude "**/*.html"
79
}
80

    
81
task product_xsljavadoc(
82
  type: JavaExec,
83
  dependsOn: ["product_jeljavadoc"],
84
  description: "Convert javadoc XML into format for documentation"
85
) {
86
  inputs.files fileTree(dir: "${buildDir}/jeljavadoc")
87
  inputs.file "${projectDir}/tools/chunk-javadoc.xsl"
88
  outputs.files fileTree(dir: "${buildDir}/javadoc-xml")
89
  classpath = configurations.documentation
90
  main = "com.saxonica.Transform"
91
  args "-s:${buildDir}/jeljavadoc/jeldoclet-out.xml",
92
    "-xsl:${projectDir}/tools/chunk-javadoc.xsl",
93
    "-o:${buildDir}/javadoc-xml/out",
94
    "base-output=${buildDir}/javadoc-xml/"
95
}
96

    
97
task javadoc_linkchecker(
98
  type: JavaExec,
99
  dependsOn: ["product_xsljavadoc"],
100
  description: "Generate report of links"
101
) {
102
  inputs.files fileTree(dir: "${buildDir}/javadoc-xml")
103
  inputs.file "${projectDir}/tools/check-tag-links.xsl"
104
  outputs.file "${buildDir}/javadoc-tag-check.xml"
105
  classpath = configurations.documentation
106
  main = "com.saxonica.Transform"
107
  args "-s:${buildDir}/javadoc-xml/javadoc-types.xml",
108
    "-xsl:${projectDir}/tools/check-tag-links.xsl",
109
    "-o:${buildDir}/javadoc-tag-check.xml"
110
}
111

    
112
task dotnet_doc_parsecs(
113
  type: JavaExec,
114
  dependsOn: ["een_csharpApi"],
115
  description: "Parse dotnet cs files for docs"
116
) {
117
  inputs.files fileTree(dir: "${buildDir}/n/csharp/api/Saxon.Api")
118
  inputs.file "${projectDir}/tools/dotnet/parsecs.xsl"
119
  outputs.file "${buildDir}/dotnetdoc/names.xml"
120
  classpath = configurations.documentation
121
  main = "com.saxonica.Transform"
122
  args "-it:main",
123
    "-s:${projectDir}/tools/dotnet/parsecs.xsl",
124
    "-xsl:${projectDir}/tools/dotnet/parsecs.xsl",
125
    "-o:${buildDir}/dotnetdoc/names.xml",
126
    "inputdir=${buildDir}/n/csharp/api/Saxon.Api"
127
}
128

    
129
task dotnet_doc_merge(
130
  type: JavaExec,
131
  dependsOn: ["dotnet_doc_parsecs"],
132
  description: "Merge API docs for dotnet"
133
) {
134
  inputs.file "${buildDir}/dotnetdoc/names.xml"
135
  inputs.file "${buildDir}/n/saxon-ee-api-${saxonVersion}.xml"
136
  inputs.file "${projectDir}/tools/dotnet/merge.xsl"
137
  outputs.file "${buildDir}/dotnetdoc/merged.xml"
138
  classpath = configurations.documentation
139
  main = "com.saxonica.Transform"
140
  args "-it:main",
141
    "-s:${buildDir}/dotnetdoc/names.xml",
142
    "-xsl:${projectDir}/tools/dotnet/merge.xsl",
143
    "-o:${buildDir}/dotnetdoc/merged.xml",
144
    "names-file=${buildDir}/dotnetdoc/names.xml",
145
    "api-doc-file=${buildDir}/n/saxon-ee-api-${saxonVersion}.xml"
146
}
147

    
148
task dotnet_doc_html(
149
  type: JavaExec,
150
  dependsOn: ["dotnet_doc_merge"],
151
  description: "Create HTML output for dotnet docs"
152
) {
153
  inputs.file "${buildDir}/dotnetdoc/merged.xml"
154
  inputs.file "${projectDir}/tools/dotnet/tohtml.xsl"
155
  outputs.file "${buildDir}/dotnetdoc-html/index.html"
156
  classpath = configurations.documentation
157
  main = "com.saxonica.Transform"
158
  args "-s:${buildDir}/dotnetdoc/merged.xml",
159
    "-xsl:${projectDir}/tools/dotnet/tohtml.xsl",
160
    "-o:${buildDir}/dotnetdoc-html/index.html"
161
}
162

    
163
task dotnet_doc_jel(
164
  type: JavaExec,
165
  dependsOn: ["dotnet_doc_merge"],
166
  description: "Create HTML output for dotnet docs"
167
) {
168
  inputs.file "${buildDir}/dotnetdoc/merged.xml"
169
  inputs.file "${projectDir}/tools/dotnet/convert-to-jel-package.xsl"
170
  outputs.file "${buildDir}/dotnetdoc-xml/packages/Saxon.Api.xml"
171
  classpath = configurations.documentation
172
  main = "com.saxonica.Transform"
173
  args "-s:${buildDir}/dotnetdoc/merged.xml",
174
    "-xsl:${projectDir}/tools/dotnet/convert-to-jel-package.xsl",
175
    "-o:${buildDir}/dotnetdoc-xml/packages/Saxon.Api.xml"
176
}
177

    
178
task app_javadoc(
179
  type: Copy,
180
  dependsOn: ["dotnet_doc_jel"],
181
  description: "Copy the XML dotnet docs to the viewer app"
182
) {
183
  into "${buildDir}/userdoc/viewer_appJS/dotnetdoc-xml"
184
  from "${buildDir}/dotnetdoc-xml"
185
}
186

    
187
task app_dotnetdoc(
188
  type: Copy,
189
  dependsOn: ["product_xsljavadoc"],
190
  description: "Copy the XML javadoc docs to the viewer app"
191
) {
192
  into "${buildDir}/userdoc/viewer_appJS/javadoc-xml"
193
  from "${buildDir}/javadoc-xml"
194
}
195

    
196
task resources_dotnetdoc(
197
  dependsOn: ["resources_dotnetdoc_css", "resources_dotnetdoc_apidoc"],
198
  description: "Copy dotnet files into the resources folder"
199
) {
200
  // nop
201
}
202

    
203
task resources_dotnetdoc_css(
204
  type: Copy,
205
  dependsOn: ["dotnet_doc_jel"],
206
  description: "Copy the dotnet CSS into the resources folder"
207
) {
208
  into "${buildDir}/resources/doc/dotnetdoc"
209
  from ("${projectDir}/tools/dotnet") {
210
    include "saxon-dotnetdoc.css"
211
  }
212
}
213

    
214
task resources_dotnetdoc_apidoc(
215
  type: Copy,
216
  dependsOn: ["dotnet_doc_jel"],
217
  description: "Copy the dotnet API docs into the resources folder"
218
) {
219
  into "${buildDir}/resources/doc/dotnetdoc"
220
  from ("${buildDir}/n") {
221
    include "saxon-ee-api-${saxonVersion}.xml"
222
    rename("saxon-ee-api-${saxonVersion}.xml", "apidoc.xml")
223
  }
224
}
225

    
226
// ============================================================
227

    
228
task gen_doc(
229
  dependsOn: ["gen_doc_icu_uca", "gen_xslt_element_reference",
230
              "gen_xslt_element_reference", "element_doc", "expath_doc",
231
              "doc_FeatureKeysDoc", "doc_ConfigFileDoc"],
232
  description: "Collects up, generates and copies the documentation source into the canonical location"
233
) {
234
  // Just a place to hang dependencies
235
}  
236

    
237
task copy_userdoc_sources(
238
  type: Copy,
239
  dependsOn: ["copy_userdoc_implement"],
240
  description: "Copy the 'real', unpreprocessed sources"
241
) {
242
  into "${buildDir}/userdoc/src"
243
  from ("${projectDir}/src/userdoc") {
244
    // Excluded files are transformed by other tasks into "src" for the docbuild
245
    exclude "extensions/**"
246
  }
247
}
248

    
249
task copy_userdoc_implement(
250
  type: Copy,
251
  description: "Copy the app implement file"
252
) {
253
  from "${projectDir}/src/viewer_appJS/doc"
254
  into "${buildDir}/userdoc/src"
255
}
256

    
257
task doc_FeatureKeysDoc(
258
  type: JavaExec,
259
  dependsOn: ["copy_userdoc_sources"],
260
  description: "Construct the documentation for feature keys"
261
) {
262
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
263
  outputs.file "${buildDir}/userdoc/src/featureKeys/FeatureKeysDoc.xml"
264
  classpath = configurations.preprocessor
265
  main = "net.sf.saxon.Transform"
266
  args "${projectDir}/tools/featureKeys/FeatureKeys.xml",
267
    "-xsl:${projectDir}/tools/featureKeys/FeatureKeysToDoc.xsl",
268
    "-o:${buildDir}/userdoc/src/featureKeys/FeatureKeysDoc.xml"
269
}
270

    
271
task doc_ConfigFileDoc(
272
  type: JavaExec,
273
  dependsOn: ["copy_userdoc_sources", "doc_FeatureKeysDoc"],
274
  description: "Construct the documentation for the configuration file"
275
) {
276
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
277
  outputs.files fileTree(dir: "${buildDir}/userdoc/src/featureKeys")
278
  classpath = configurations.preprocessor
279
  main = "net.sf.saxon.Transform"
280
  args "${projectDir}/tools/featureKeys/AdditionalFeatures.xml",
281
    "-xsl:${projectDir}/tools/featureKeys/ToConfigFileDoc.xsl",
282
    "-o:${buildDir}/userdoc/src/featureKeys/ConfigFileDoc.xml"
283
}
284

    
285
task gen_doc_icu_uca(
286
  type: JavaExec,
287
  dependsOn: ["copy_userdoc_sources"],
288
  description: "Generate the ICU/UCA documentation"
289
) {
290
  inputs.files fileTree(dir: "${projectDir}/src/userdoc")
291
  inputs.files fileTree(dir: "${projectDir}/tools")
292
  outputs.files fileTree(dir: "${buildDir}/userdoc/src/extensibility")
293
  classpath = configurations.documentation
294
  main = "com.saxonica.Transform"
295
  args "-it:go",
296
    "-s:${projectDir}/src/userdoc/catalog.xml",
297
    "-xsl:${projectDir}/tools/document-ICU.xsl",
298
    "output=${buildDir}/userdoc/src/extensibility/"
299
}
300

    
301
task gen_xslt_element_reference_preprocess(
302
  type: JavaExec,
303
  dependsOn: ["copy_userdoc_sources"],
304
  description: "Preprocess input for the XSLT Element reference documentation"
305
) {
306
  inputs.files fileTree(dir: "${projectDir}/src/userdoc/elements")
307
  inputs.files fileTree(dir: "${projectDir}/tools")
308
  outputs.file "${buildDir}/userdoc/tmp/xsl-elements-expanded.xml"
309
  classpath = configurations.documentation
310
  main = "com.saxonica.Transform"
311
  args "-s:${projectDir}/src/userdoc/elements/xsl-elements.xml",
312
    "-o:${buildDir}/userdoc/tmp/xsl-elements-expanded.xml",
313
    "-xsl:tools/genElementDoc.xsl"
314
}
315

    
316
task gen_xslt_element_reference(
317
  type: JavaExec,
318
  dependsOn: ["gen_xslt_element_reference_preprocess"],
319
  description: "Generate the XSLT Element reference documentation"
320
) {
321
  inputs.file "${buildDir}/userdoc/tmp/xsl-elements-expanded.xml" 
322
  inputs.files fileTree(dir: "${projectDir}/tools")
323
  outputs.file "${buildDir}/userdoc/src/xsl-elements.xml"
324
  classpath = configurations.documentation
325
  main = "com.saxonica.Transform"
326
  args "-s:${buildDir}/userdoc/tmp/xsl-elements-expanded.xml",
327
    "-xsl:${projectDir}/tools/elements-body.xsl",
328
    "-o:${buildDir}/userdoc/src/xsl-elements.xml"
329
}
330

    
331
task element_doc() {
332
  // Just a place to hang dependencies
333
}
334

    
335
["instructions", "serialization-params"].each { target ->
336
  Task t = task "gen_element_doc_${target}"(
337
    type: JavaExec,
338
    description: "Expand element documentation for ${target}"
339
  ) {
340
    inputs.file "${projectDir}/src/userdoc/extensions/${target}.xml"
341
    inputs.files fileTree(dir: "${projectDir}/tools")
342
    outputs.file file("${buildDir}/userdoc/src/extensions/${target}.xml")
343
    classpath = configurations.documentation
344
    main = "com.saxonica.Transform"
345
    args "-s:${projectDir}/src/userdoc/extensions/${target}.xml",
346
      "-xsl:tools/elements-body.xsl",
347
      "-o:${buildDir}/userdoc/src/extensions/${target}.xml"
348
  }
349
  element_doc.dependsOn t
350
}  
351

    
352
// Different from preceding because it doesn't go in extensions ¯\_(ツ)_/¯
353
["sql-extension"].each { target ->
354
  Task t = task "gen_element_doc_${target}"(
355
    type: JavaExec,
356
    description: "Expand element documentation for ${target}"
357
  ) {
358
    inputs.file "${projectDir}/src/userdoc/extensions/${target}.xml"
359
    inputs.files fileTree(dir: "${projectDir}/tools")
360
    outputs.file "${buildDir}/userdoc/src/${target}.xml"
361
    classpath = configurations.documentation
362
    main = "com.saxonica.Transform"
363
    args "-s:${projectDir}/src/userdoc/extensions/${target}.xml",
364
      "-xsl:tools/elements-body.xsl",
365
      "-o:${buildDir}/userdoc/src/${target}.xml"
366
  }
367
  element_doc.dependsOn t
368
}  
369

    
370
task expath_doc() {
371
  // Just a place to hang dependencies
372
}
373
["binary", "archive", "file"].each { target ->
374
  Task t = task "expath_doc_${target}"(
375
    type: JavaExec,
376
    dependsOn: ["clone_expath_cg"],
377
    description: "Expand EXPath documentation for ${target}"
378
  ) {
379
    inputs.file "${projectDir}/src/userdoc/functions/EXPath/functions-${target}.xml"
380
    inputs.files fileTree(dir: "${projectDir}/tools")
381
    outputs.file "${buildDir}/userdoc/src/functions/EXPath/functions-${target}.xml"
382
    classpath = configurations.documentation
383
    main = "com.saxonica.Transform"
384
    args "-xi:on",
385
      "-s:${projectDir}/src/userdoc/functions/EXPath/functions-${target}.xml",
386
      "-xsl:${projectDir}/tools/genFunctionDoc.xsl",
387
      "-o:${buildDir}/userdoc/src/functions/EXPath/functions-${target}.xml",
388
      "GitHub=${projectDir}/build"
389
  }
390
  expath_doc.dependsOn t
391
}
392

    
393
task gen_expand_doc_sections_for_app(
394
  type: JavaExec,
395
  dependsOn: ["gen_doc", "copy_changes_dir"],
396
  description: "Expand documentation sections from inclusions for app"
397
) {
398
  inputs.file "${buildDir}/userdoc/src/catalog.xml"
399
  inputs.files fileTree(dir: "${projectDir}/tools")
400
  outputs.file "${buildDir}/userdoc/expanded/catalog.xml"
401
  classpath = configurations.documentation
402
  main = "com.saxonica.Transform"
403
  args "-xi:on",
404
    "-s:${buildDir}/userdoc/src/catalog.xml",
405
    "-xsl:${projectDir}/tools/doc-include.xsl",
406
    "-o:${buildDir}/userdoc/expanded/catalog.xml",
407
    "output-uri=${buildDir}/userdoc/expanded/"
408
}
409

    
410
task copy_changes_dir(
411
  type: Copy,
412
  description: "Copy the change logs to build hierarchy"
413
) {
414
  into "${buildDir}/userdoc/src/changes"
415
  from "${projectDir}/src/userdoc/changes"
416
  doFirst {
417
    mkdir "${buildDir}/userdoc/src/changes"
418
  }
419
}
420

    
421
task userdoc_changes(
422
  type: JavaExec,
423
  dependsOn: ["gen_expand_doc_sections_for_app"],
424
  description: "Preprocess the changes.xml file to turn it into a standard article"
425
) {
426
  inputs.file "${buildDir}/userdoc/expanded/changes.xml"
427
  inputs.files fileTree(dir: "${projectDir}/tools/to-static")
428
  outputs.file "${buildDir}/userdoc/expanded/changes-article.xml"
429
  classpath = configurations.documentation
430
  main = "com.saxonica.Transform"
431
  args "-s:${buildDir}/userdoc/expanded/changes.xml",
432
    "-xsl:${projectDir}/tools/to-static/c-changes.xsl",
433
    "-o:${buildDir}/userdoc/expanded/changes-article.xml"
434
}
435

    
436
task userdoc_functions(
437
  type: JavaExec,
438
  dependsOn: ["gen_expand_doc_sections_for_app"],
439
  description: "Preprocess the functions.xml file to turn it into a standard article"
440
) {
441
  inputs.file "${buildDir}/userdoc/expanded/functions.xml"
442
  inputs.files fileTree(dir: "${projectDir}/tools/to-static")
443
  outputs.file "${buildDir}/userdoc/expanded/functions-article.xml"
444
  classpath = configurations.documentation
445
  main = "com.saxonica.Transform"
446
  args "-s:${buildDir}/userdoc/expanded/functions.xml",
447
    "-xsl:${projectDir}/tools/to-static/c-functions.xsl",
448
    "-o:${buildDir}/userdoc/expanded/functions-article.xml"
449
}
450

    
451
// ============================================================
452

    
453
task viewer_app_sef(
454
  type: JavaExec,
455
  description: "Compile the viewer_app"
456
) {
457
  inputs.files fileTree(dir: "${projectDir}/src/viewer_appJS/xsl")
458
  outputs.file "${buildDir}/viewer_app/xsl/viewer_app.sef.json"
459
  classpath = configurations.documentation
460
  main = "com.saxonica.Transform"
461
  args "-xsl:${projectDir}/src/viewer_appJS/xsl/viewer_app.xsl",
462
    "-export:${buildDir}/viewer_app/xsl/viewer_app.sef.json",
463
    "-target:JS", "-nogo", "-relocate:on", "-ns:##html5",
464
    "--generateByteCode:off",
465
    "SEFbuildDate=${DSTAMP}"
466
}
467

    
468
// ============================================================
469

    
470
task userdoc_html(
471
  dependsOn: ["userdoc_articles"],
472
  description: "Creates the static HTML version of the user documentation"
473
) {
474
  // Just a place to hang dependencies
475
}
476

    
477
task userdoc_articles(
478
  type: JavaExec,
479
  dependsOn: ["gen_expand_doc_sections_for_app", "app_javadoc", "app_dotnetdoc",
480
              "userdoc_changes", "userdoc_functions"],
481
  description: "Process all the articles"
482
) {
483
  inputs.files fileTree(dir: "${buildDir}/userdoc/expanded")
484
  inputs.files fileTree(dir: "${projectDir}/tools/to-static")
485
  outputs.files fileTree(dir: "${buildDir}/userdoc/html")
486
  classpath = configurations.documentation
487
  main = "com.saxonica.Transform"
488
  args "-s:${buildDir}/userdoc/expanded/catalog.xml",
489
    "-xsl:${projectDir}/tools/to-static/s-viewer_app.xsl",
490
    "-o:${buildDir}/userdoc/html/dummy.xml",
491
    "changes-article=${buildDir}/userdoc/expanded/changes-article.xml",
492
    "functions-article=${buildDir}/userdoc/expanded/functions-article.xml",
493
    "base-uri=${buildDir}/userdoc/html/"
494
}
495

    
496
task userdoc_publish_viewer_appJS(
497
  type: Copy,
498
  description: "Copy viewer_appJS to build"
499
) {
500
  into "${buildDir}/userdoc/viewer_appJS"
501
  from ("${projectDir}/src/viewer_appJS") {
502
    exclude "readme.txt"
503
  }
504
}
505

    
506
task userdoc_viewer_appJS(
507
  type: Copy,
508
  dependsOn: ["userdoc_articles", "userdoc_publish_viewer_appJS"],
509
  description: "Copy transformed articles to app docs"
510
) {
511
  into "${buildDir}/userdoc/viewer_appJS/doc"
512
  from ("build/userdoc/expanded") {
513
    include "*.xml"
514
    exclude "functions-article.xml"
515
    exclude "changes-article.xml"
516
  }
517
}
518

    
519
task userdoc_publish_javadoc_html(
520
  type: Copy,
521
  dependsOn: ["userdoc_html", "product_javadoc"],
522
  description: "Copy dotnet docs into HTML output"
523
) {
524
  into "${buildDir}/userdoc/html/javadoc"
525
  from "build/javadoc"
526
  doFirst {
527
    mkdir "${buildDir}/userdoc/html/javadoc"
528
  }
529
}
530

    
531
task userdoc_publish_html_images(
532
  type: Copy,
533
  description: "Copy viewer_appJS images to the html output directory"
534
) {
535
  into "${buildDir}/userdoc/html/image"
536
  from "${projectDir}/src/viewer_appJS/image"
537
}
538

    
539
task userdoc_publish_html_style(
540
  type: Copy,
541
  description: "Copy viewer_appJS CSS to the html output directory"
542
) {
543
  into "${buildDir}/userdoc/html"
544
  from ("${projectDir}/src/viewer_appJS") {
545
    include "viewer_app.css"
546
  }
547
}
548

    
549
task userdoc_publish_html(
550
  type: Copy,
551
  dependsOn: ["userdoc_publish_javadoc_html", "dotnet_doc_html",
552
              "userdoc_publish_html_style", "userdoc_publish_html_images"],
553
  description: "Publish the HTML documentation"
554
) {
555
  into "${buildDir}/userdoc/html/dotnetdoc"
556
  from "build/dotnetdoc-html"
557
  doFirst {
558
    mkdir "${buildDir}/userdoc/html/dotnetdoc"
559
  }
560
}
561

    
562
// ============================================================
563

    
564
task update_documentation(
565
  dependsOn: ["copy_xml_documentation", "copy_html_documentation"],
566
  description: "Update documentation from viewer app"
567
) {
568
  // Just a place to hang dependencies
569
}
570

    
571
task copy_xml_documentation(
572
  type: Copy,
573
  dependsOn: ["userdoc_viewer_appJS"],
574
  description: "Update XML version of documentation from viewer app"
575
) {
576
  into "${buildDir}/website/documentation"
577
  from "${buildDir}/userdoc/viewer_appJS"
578
}
579

    
580
task copy_html_documentation(
581
  type: Copy,
582
  dependsOn: ["userdoc_publish_html"],
583
  description: "Update HTML version of user documentation"
584
) {
585
  into "${buildDir}/website/html/documentation"
586
  from "${buildDir}/userdoc/html"
587
}
588

    
589
task gen_contents_ref(
590
  type: JavaExec,
591
  dependsOn: ["copy_xml_documentation"],
592
  description: "Creates the contents reference file for the user documentation"
593
) {
594
  inputs.file "${buildDir}/website/documentation/doc/catalog.xml"
595
  inputs.file "${projectDir}/tools/contents-builder.xsl"
596
  outputs.file "${buildDir}/website/documentation/contents.xml"
597
  classpath = configurations.documentation
598
  main = "com.saxonica.Transform"
599
  args "${buildDir}/website/documentation/doc/catalog.xml",
600
    "-xsl:${projectDir}/tools/contents-builder.xsl",
601
    "-o:${buildDir}/website/documentation/contents.xml",
602
    "version-number=${saxonMajorVersion}"
603
}
604

    
605
task gen_contents_page(
606
  type: JavaExec,
607
  dependsOn: ["gen_contents_ref"],
608
  description: "Builds the contents pages"
609
) {
610
  inputs.file "${buildDir}/website/documentation/contents.xml"
611
  inputs.file "${projectDir}/tools/contentsDoc.xsl"
612
  outputs.file "${buildDir}/website/documentation/contents-page.xml"
613
  classpath = configurations.documentation
614
  main = "com.saxonica.Transform"
615
  args "${buildDir}/website/documentation/contents.xml",
616
    "-xsl:${projectDir}/tools/contentsDoc.xsl",
617
    "-o:${buildDir}/website/documentation/contents-page.xml",
618
    "base-uri=${buildDir}/website/documentation/",
619
    "version-number=${saxonMajorVersion}",
620
    "major-version=${saxonMajorVersion}"
621
}
622

    
623
task gen_contents_page_static(
624
  type: JavaExec,
625
  dependsOn: ["gen_contents_page"],
626
  description: "Builds the static contents page"
627
) {
628
  inputs.file "${buildDir}/contents-page-static.html"
629
  inputs.file "${projectDir}/tools/make-menu_change-links.xsl"
630
  outputs.file "${buildDir}/website/html/documentation/contents-page.html"
631
  classpath = configurations.documentation
632
  main = "com.saxonica.Transform"
633
  args "${buildDir}/contents-page-static.html",
634
    "-xsl:${projectDir}/tools/make-menu_change-links.xsl",
635
    "-o:${buildDir}/website/html/documentation/contents-page.html"
636
}
637

    
638
task gen_documentation_main(
639
  type: JavaExec,
640
  dependsOn: ["gen_contents_ref"],
641
  description: "Build the documentation main pages for the current release"
642
) {
643
  inputs.file "${buildDir}/website/documentation/contents.xml"
644
  inputs.file "${projectDir}/src/userdoc/doc-ref.xml"
645
  inputs.files fileTree("${projectDir}/tools")
646
  outputs.file "${buildDir}/website/documentation/documentation.xml"
647
  classpath = configurations.documentation
648
  main = "com.saxonica.Transform"
649
  args "${projectDir}/src/userdoc/doc-ref.xml",
650
    "-xsl:${projectDir}/tools/doc-page.xsl",
651
    "-o:${buildDir}/website/documentation/documentation.xml",
652
    "method=dynamic",
653
    "version-number=${saxonMajorVersion}",
654
    "major-version=${saxonMajorVersion}"
655
}
656

    
657
task gen_documentation_main_static(
658
  type: JavaExec,
659
  dependsOn: ["gen_contents_ref"],
660
  description: "Build the documentation main pages for the current release"
661
) {
662
  inputs.file "${buildDir}/website/documentation/contents.xml"
663
  inputs.file "${projectDir}/src/userdoc/doc-ref.xml"
664
  inputs.files fileTree("${projectDir}/tools")
665
  outputs.file "${buildDir}/static-doc/documentation.xml"
666
  classpath = configurations.documentation
667
  main = "com.saxonica.Transform"
668
  args "${projectDir}/src/userdoc/doc-ref.xml",
669
    "-xsl:${projectDir}/tools/doc-page.xsl",
670
    "-o:${buildDir}/static-doc/documentation.xml",
671
    "method=static",
672
    "version-number=${saxonMajorVersion}",
673
    "major-version=${saxonMajorVersion}"
674
}
675

    
676
task gen_documentation_main_html(
677
  type: JavaExec,
678
  dependsOn: ["gen_documentation_main_static"],
679
  description: "Build the HTML documentation main pages for the current release"
680
) {
681
  inputs.file "${buildDir}/static-doc/documentation.xml"
682
  inputs.file "${projectDir}/tools/make-menu_change-links.xsl"
683
  outputs.file "${buildDir}/website/html/documentation/documentation.html"
684
  classpath = configurations.documentation
685
  main = "com.saxonica.Transform"
686
  args "${buildDir}/static-doc/documentation.xml",
687
    "-xsl:${projectDir}/tools/make-menu_change-links.xsl",
688
    "-o:${buildDir}/website/html/documentation/documentation.html"
689
}
(6-6/13)