Project

Profile

Help

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

he / build-doc.gradle @ 72fe1f30

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_css(
149
  type: Copy,
150
  description: "Copies the CSS for dotnet docs"
151
) {
152
  into "${buildDir}/dotnetdoc-html"
153
  from "${projectDir}/tools/dotnet/saxon-dotnetdoc.css"
154
}
155

    
156
task dotnet_doc_html(
157
  type: JavaExec,
158
  dependsOn: ["dotnet_doc_merge", "dotnet_doc_css"],
159
  description: "Create HTML output for dotnet docs"
160
) {
161
  inputs.file "${buildDir}/dotnetdoc/merged.xml"
162
  inputs.file "${projectDir}/tools/dotnet/tohtml.xsl"
163
  outputs.file "${buildDir}/dotnetdoc-html/index.html"
164
  classpath = configurations.documentation
165
  main = "com.saxonica.Transform"
166
  args "-s:${buildDir}/dotnetdoc/merged.xml",
167
    "-xsl:${projectDir}/tools/dotnet/tohtml.xsl",
168
    "-o:${buildDir}/dotnetdoc-html/index.html"
169
}
170

    
171
task dotnet_doc_jel(
172
  type: JavaExec,
173
  dependsOn: ["dotnet_doc_merge"],
174
  description: "Create HTML output for dotnet docs"
175
) {
176
  inputs.file "${buildDir}/dotnetdoc/merged.xml"
177
  inputs.file "${projectDir}/tools/dotnet/convert-to-jel-package.xsl"
178
  outputs.file "${buildDir}/dotnetdoc-xml/packages/Saxon.Api.xml"
179
  classpath = configurations.documentation
180
  main = "com.saxonica.Transform"
181
  args "-s:${buildDir}/dotnetdoc/merged.xml",
182
    "-xsl:${projectDir}/tools/dotnet/convert-to-jel-package.xsl",
183
    "-o:${buildDir}/dotnetdoc-xml/packages/Saxon.Api.xml"
184
}
185

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

    
195
task app_dotnetdoc(
196
  type: Copy,
197
  dependsOn: ["product_xsljavadoc"],
198
  description: "Copy the XML javadoc docs to the viewer app"
199
) {
200
  into "${buildDir}/userdoc/viewer_appJS/javadoc-xml"
201
  from "${buildDir}/javadoc-xml"
202
}
203

    
204
task resources_dotnetdoc(
205
  dependsOn: ["resources_dotnetdoc_css", "resources_dotnetdoc_apidoc"],
206
  description: "Copy dotnet files into the resources folder"
207
) {
208
  // nop
209
}
210

    
211
task resources_dotnetdoc_css(
212
  type: Copy,
213
  dependsOn: ["dotnet_doc_jel"],
214
  description: "Copy the dotnet CSS into the resources folder"
215
) {
216
  into "${buildDir}/resources/doc/dotnetdoc"
217
  from ("${projectDir}/tools/dotnet") {
218
    include "saxon-dotnetdoc.css"
219
  }
220
}
221

    
222
task resources_dotnetdoc_apidoc(
223
  type: Copy,
224
  dependsOn: ["dotnet_doc_jel"],
225
  description: "Copy the dotnet API docs into the resources folder"
226
) {
227
  into "${buildDir}/resources/doc/dotnetdoc"
228
  from ("${buildDir}/n") {
229
    include "saxon-ee-api-${saxonVersion}.xml"
230
    rename("saxon-ee-api-${saxonVersion}.xml", "apidoc.xml")
231
  }
232
}
233

    
234
// ============================================================
235

    
236
task gen_doc(
237
  dependsOn: ["gen_doc_icu_uca", "gen_xslt_element_reference",
238
              "gen_xslt_element_reference", "element_doc", "expath_doc",
239
              "doc_FeatureKeysDoc", "doc_ConfigFileDoc"],
240
  description: "Collects up, generates and copies the documentation source into the canonical location"
241
) {
242
  // Just a place to hang dependencies
243
}  
244

    
245
task copy_userdoc_sources(
246
  type: Copy,
247
  dependsOn: ["copy_userdoc_implement"],
248
  description: "Copy the 'real', unpreprocessed sources"
249
) {
250
  into "${buildDir}/userdoc/src"
251
  from ("${projectDir}/src/userdoc") {
252
    // Excluded files are transformed by other tasks into "src" for the docbuild
253
    exclude "extensions/**"
254
  }
255
}
256

    
257
task copy_userdoc_implement(
258
  type: Copy,
259
  description: "Copy the app implement file"
260
) {
261
  from "${projectDir}/src/viewer_appJS/doc"
262
  into "${buildDir}/userdoc/src"
263
}
264

    
265
task doc_FeatureKeysDoc(
266
  type: JavaExec,
267
  dependsOn: ["copy_userdoc_sources"],
268
  description: "Construct the documentation for feature keys"
269
) {
270
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
271
  outputs.file "${buildDir}/userdoc/src/featureKeys/FeatureKeysDoc.xml"
272
  classpath = configurations.preprocessor
273
  main = "net.sf.saxon.Transform"
274
  args "${projectDir}/tools/featureKeys/FeatureKeys.xml",
275
    "-xsl:${projectDir}/tools/featureKeys/FeatureKeysToDoc.xsl",
276
    "-o:${buildDir}/userdoc/src/featureKeys/FeatureKeysDoc.xml"
277
}
278

    
279
task doc_ConfigFileDoc(
280
  type: JavaExec,
281
  dependsOn: ["copy_userdoc_sources", "doc_FeatureKeysDoc"],
282
  description: "Construct the documentation for the configuration file"
283
) {
284
  inputs.files fileTree(dir: "${projectDir}/tools/featureKeys")
285
  outputs.files fileTree(dir: "${buildDir}/userdoc/src/featureKeys")
286
  classpath = configurations.preprocessor
287
  main = "net.sf.saxon.Transform"
288
  args "${projectDir}/tools/featureKeys/AdditionalFeatures.xml",
289
    "-xsl:${projectDir}/tools/featureKeys/ToConfigFileDoc.xsl",
290
    "-o:${buildDir}/userdoc/src/featureKeys/ConfigFileDoc.xml"
291
}
292

    
293
task gen_doc_icu_uca(
294
  type: JavaExec,
295
  dependsOn: ["copy_userdoc_sources"],
296
  description: "Generate the ICU/UCA documentation"
297
) {
298
  inputs.files fileTree(dir: "${projectDir}/src/userdoc")
299
  inputs.files fileTree(dir: "${projectDir}/tools")
300
  outputs.files fileTree(dir: "${buildDir}/userdoc/src/extensibility")
301
  classpath = configurations.documentation
302
  main = "com.saxonica.Transform"
303
  args "-it:go",
304
    "-s:${projectDir}/src/userdoc/catalog.xml",
305
    "-xsl:${projectDir}/tools/document-ICU.xsl",
306
    "output=${buildDir}/userdoc/src/extensibility/"
307
}
308

    
309
task gen_xslt_element_reference_preprocess(
310
  type: JavaExec,
311
  dependsOn: ["copy_userdoc_sources"],
312
  description: "Preprocess input for the XSLT Element reference documentation"
313
) {
314
  inputs.files fileTree(dir: "${projectDir}/src/userdoc/elements")
315
  inputs.files fileTree(dir: "${projectDir}/tools")
316
  outputs.file "${buildDir}/userdoc/tmp/xsl-elements-expanded.xml"
317
  classpath = configurations.documentation
318
  main = "com.saxonica.Transform"
319
  args "-s:${projectDir}/src/userdoc/elements/xsl-elements.xml",
320
    "-o:${buildDir}/userdoc/tmp/xsl-elements-expanded.xml",
321
    "-xsl:tools/genElementDoc.xsl"
322
}
323

    
324
task gen_xslt_element_reference(
325
  type: JavaExec,
326
  dependsOn: ["gen_xslt_element_reference_preprocess"],
327
  description: "Generate the XSLT Element reference documentation"
328
) {
329
  inputs.file "${buildDir}/userdoc/tmp/xsl-elements-expanded.xml" 
330
  inputs.files fileTree(dir: "${projectDir}/tools")
331
  outputs.file "${buildDir}/userdoc/src/xsl-elements.xml"
332
  classpath = configurations.documentation
333
  main = "com.saxonica.Transform"
334
  args "-s:${buildDir}/userdoc/tmp/xsl-elements-expanded.xml",
335
    "-xsl:${projectDir}/tools/elements-body.xsl",
336
    "-o:${buildDir}/userdoc/src/xsl-elements.xml"
337
}
338

    
339
task element_doc() {
340
  // Just a place to hang dependencies
341
}
342

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

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

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

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

    
418
task copy_changes_dir(
419
  type: Copy,
420
  description: "Copy the change logs to build hierarchy"
421
) {
422
  into "${buildDir}/userdoc/src/changes"
423
  from "${projectDir}/src/userdoc/changes"
424
  doFirst {
425
    mkdir "${buildDir}/userdoc/src/changes"
426
  }
427
}
428

    
429
task userdoc_changes(
430
  type: JavaExec,
431
  dependsOn: ["gen_expand_doc_sections_for_app"],
432
  description: "Preprocess the changes.xml file to turn it into a standard article"
433
) {
434
  inputs.file "${buildDir}/userdoc/expanded/changes.xml"
435
  inputs.files fileTree(dir: "${projectDir}/tools/to-static")
436
  outputs.file "${buildDir}/userdoc/expanded/changes-article.xml"
437
  classpath = configurations.documentation
438
  main = "com.saxonica.Transform"
439
  args "-s:${buildDir}/userdoc/expanded/changes.xml",
440
    "-xsl:${projectDir}/tools/to-static/c-changes.xsl",
441
    "-o:${buildDir}/userdoc/expanded/changes-article.xml"
442
}
443

    
444
task userdoc_functions(
445
  type: JavaExec,
446
  dependsOn: ["gen_expand_doc_sections_for_app"],
447
  description: "Preprocess the functions.xml file to turn it into a standard article"
448
) {
449
  inputs.file "${buildDir}/userdoc/expanded/functions.xml"
450
  inputs.files fileTree(dir: "${projectDir}/tools/to-static")
451
  outputs.file "${buildDir}/userdoc/expanded/functions-article.xml"
452
  classpath = configurations.documentation
453
  main = "com.saxonica.Transform"
454
  args "-s:${buildDir}/userdoc/expanded/functions.xml",
455
    "-xsl:${projectDir}/tools/to-static/c-functions.xsl",
456
    "-o:${buildDir}/userdoc/expanded/functions-article.xml"
457
}
458

    
459
// ============================================================
460

    
461
task viewer_app_sef(
462
  type: JavaExec,
463
  description: "Compile the viewer_app"
464
) {
465
  inputs.files fileTree(dir: "${projectDir}/src/viewer_appJS/xsl")
466
  outputs.file "${buildDir}/viewer_app/xsl/viewer_app.sef.json"
467
  classpath = configurations.documentation
468
  main = "com.saxonica.Transform"
469
  args "-xsl:${projectDir}/src/viewer_appJS/xsl/viewer_app.xsl",
470
    "-export:${buildDir}/viewer_app/xsl/viewer_app.sef.json",
471
    "-target:JS", "-nogo", "-relocate:on", "-ns:##html5",
472
    "--generateByteCode:off",
473
    "SEFbuildDate=${DSTAMP}"
474
}
475

    
476
// ============================================================
477

    
478
task userdoc_html(
479
  dependsOn: ["userdoc_articles"],
480
  description: "Creates the static HTML version of the user documentation"
481
) {
482
  // Just a place to hang dependencies
483
}
484

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

    
504
task userdoc_publish_viewer_appJS(
505
  type: Copy,
506
  description: "Copy viewer_appJS to build"
507
) {
508
  into "${buildDir}/userdoc/viewer_appJS"
509
  from ("${projectDir}/src/viewer_appJS") {
510
    exclude "readme.txt"
511
  }
512
}
513

    
514
task userdoc_viewer_appJS(
515
  type: Copy,
516
  dependsOn: ["userdoc_articles", "userdoc_publish_viewer_appJS"],
517
  description: "Copy transformed articles to app docs"
518
) {
519
  into "${buildDir}/userdoc/viewer_appJS/doc"
520
  from ("build/userdoc/expanded") {
521
    include "*.xml"
522
    exclude "functions-article.xml"
523
    exclude "changes-article.xml"
524
  }
525
}
526

    
527
task userdoc_publish_javadoc_html(
528
  type: Copy,
529
  dependsOn: ["userdoc_html", "product_javadoc"],
530
  description: "Copy dotnet docs into HTML output"
531
) {
532
  into "${buildDir}/userdoc/html/javadoc"
533
  from "build/javadoc"
534
  doFirst {
535
    mkdir "${buildDir}/userdoc/html/javadoc"
536
  }
537
}
538

    
539
task userdoc_publish_html_images(
540
  type: Copy,
541
  description: "Copy viewer_appJS images to the html output directory"
542
) {
543
  into "${buildDir}/userdoc/html/image"
544
  from "${projectDir}/src/viewer_appJS/image"
545
}
546

    
547
task userdoc_publish_html_style(
548
  type: Copy,
549
  description: "Copy viewer_appJS CSS to the html output directory"
550
) {
551
  into "${buildDir}/userdoc/html"
552
  from ("${projectDir}/src/viewer_appJS") {
553
    include "viewer_app.css"
554
  }
555
}
556

    
557
task userdoc_publish_html(
558
  type: Copy,
559
  dependsOn: ["userdoc_publish_javadoc_html", "dotnet_doc_html",
560
              "userdoc_publish_html_style", "userdoc_publish_html_images"],
561
  description: "Publish the HTML documentation"
562
) {
563
  into "${buildDir}/userdoc/html/dotnetdoc"
564
  from "build/dotnetdoc-html"
565
  doFirst {
566
    mkdir "${buildDir}/userdoc/html/dotnetdoc"
567
  }
568
}
569

    
570
// ============================================================
571

    
572
task update_documentation(
573
  dependsOn: ["copy_xml_documentation", "copy_html_documentation"],
574
  description: "Update documentation from viewer app"
575
) {
576
  // Just a place to hang dependencies
577
}
578

    
579
task copy_xml_documentation(
580
  type: Copy,
581
  dependsOn: ["userdoc_viewer_appJS"],
582
  description: "Update XML version of documentation from viewer app"
583
) {
584
  into "${buildDir}/website/documentation"
585
  from "${buildDir}/userdoc/viewer_appJS"
586
}
587

    
588
task copy_html_documentation(
589
  type: Copy,
590
  dependsOn: ["userdoc_publish_html"],
591
  description: "Update HTML version of user documentation"
592
) {
593
  into "${buildDir}/website/html/documentation"
594
  from "${buildDir}/userdoc/html"
595
}
596

    
597
task gen_contents_ref(
598
  type: JavaExec,
599
  dependsOn: ["copy_xml_documentation"],
600
  description: "Creates the contents reference file for the user documentation"
601
) {
602
  inputs.file "${buildDir}/website/documentation/doc/catalog.xml"
603
  inputs.file "${projectDir}/tools/contents-builder.xsl"
604
  outputs.file "${buildDir}/website/documentation/contents.xml"
605
  classpath = configurations.documentation
606
  main = "com.saxonica.Transform"
607
  args "${buildDir}/website/documentation/doc/catalog.xml",
608
    "-xsl:${projectDir}/tools/contents-builder.xsl",
609
    "-o:${buildDir}/website/documentation/contents.xml",
610
    "version-number=${saxonMajorVersion}"
611
}
612

    
613
task gen_contents_page(
614
  type: JavaExec,
615
  dependsOn: ["gen_contents_ref"],
616
  description: "Builds the contents pages"
617
) {
618
  inputs.file "${buildDir}/website/documentation/contents.xml"
619
  inputs.file "${projectDir}/tools/contentsDoc.xsl"
620
  outputs.file "${buildDir}/website/documentation/contents-page.xml"
621
  classpath = configurations.documentation
622
  main = "com.saxonica.Transform"
623
  args "${buildDir}/website/documentation/contents.xml",
624
    "-xsl:${projectDir}/tools/contentsDoc.xsl",
625
    "-o:${buildDir}/website/documentation/contents-page.xml",
626
    "base-uri=${buildDir}/website/documentation/",
627
    "version-number=${saxonMajorVersion}",
628
    "major-version=${saxonMajorVersion}"
629
}
630

    
631
task gen_contents_page_static(
632
  type: JavaExec,
633
  dependsOn: ["gen_contents_page"],
634
  description: "Builds the static contents page"
635
) {
636
  inputs.file "${buildDir}/contents-page-static.html"
637
  inputs.file "${projectDir}/tools/make-menu_change-links.xsl"
638
  outputs.file "${buildDir}/website/html/documentation/contents-page.html"
639
  classpath = configurations.documentation
640
  main = "com.saxonica.Transform"
641
  args "${buildDir}/contents-page-static.html",
642
    "-xsl:${projectDir}/tools/make-menu_change-links.xsl",
643
    "-o:${buildDir}/website/html/documentation/contents-page.html"
644
}
645

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

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

    
684
task gen_documentation_main_html(
685
  type: JavaExec,
686
  dependsOn: ["gen_documentation_main_static"],
687
  description: "Build the HTML documentation main pages for the current release"
688
) {
689
  inputs.file "${buildDir}/static-doc/documentation.xml"
690
  inputs.file "${projectDir}/tools/make-menu_change-links.xsl"
691
  outputs.file "${buildDir}/website/html/documentation/documentation.html"
692
  classpath = configurations.documentation
693
  main = "com.saxonica.Transform"
694
  args "${buildDir}/static-doc/documentation.xml",
695
    "-xsl:${projectDir}/tools/make-menu_change-links.xsl",
696
    "-o:${buildDir}/website/html/documentation/documentation.html"
697
}
(6-6/13)