Project

Profile

Help

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

he / build-doc.gradle @ 10bc1344

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", "gen_contents_ref", "gen_feature_matrix"],
18
  description: "Build the documentation and pages for website"
19
) {
20
  // Just a place to hang dependencies
21
}
22

    
23
// ============================================================
24

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

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

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

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

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

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

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

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

    
147
task dotnet_doc_css(
148
  type: Copy,
149
  description: "Copies the CSS for dotnet docs"
150
) {
151
  into "${buildDir}/dotnetdoc-html"
152
  from "${projectDir}/tools/docs/dotnet/saxon-dotnetdoc.css"
153
}
154

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

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

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

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

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

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

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

    
233
// ============================================================
234

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

    
244
task copy_userdoc_sources(
245
  type: Copy,
246
  dependsOn: ["copy_userdoc_implement"],
247
  description: "Copy the 'real', unpreprocessed sources"
248
) {
249
  into "${buildDir}/userdoc/src"
250
  from ("${projectDir}/src/userdoc") {
251
    // Excluded files are transformed by other tasks into "src" for the docbuild
252
    exclude "extensions/**"
253
    exclude "elements/**"
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/docs/userdoc")
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/docs/userdoc/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/docs/userdoc")
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:${projectDir}/tools/docs/userdoc/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/docs/userdoc")
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/docs/userdoc/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/docs/userdoc")
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:${projectDir}/tools/docs/userdoc/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/docs/userdoc")
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:${projectDir}/tools/docs/userdoc/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/docs/userdoc")
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/docs/userdoc/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 expand_userdoc_sections(
402
  type: JavaExec,
403
  dependsOn: ["gen_doc"],
404
  description: "Expand documentation sections from inclusions for app"
405
) {
406
  inputs.file "${buildDir}/userdoc/src/catalog.xml"
407
  inputs.files fileTree(dir: "${buildDir}/userdoc/src")
408
  inputs.files fileTree(dir: "${projectDir}/tools/docs/userdoc")
409
  outputs.file "${buildDir}/userdoc/expanded/catalog.xml"
410
  classpath = configurations.documentation
411
  main = "com.saxonica.Transform"
412
  args "-xi:on",
413
    "-s:${buildDir}/userdoc/src/catalog.xml",
414
    "-xsl:${projectDir}/tools/docs/userdoc/doc-include.xsl",
415
    "-o:${buildDir}/userdoc/expanded/catalog.xml",
416
    "output-uri=${buildDir}/userdoc/expanded/"
417
}
418

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

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

    
449
// ============================================================
450

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

    
466
// ============================================================
467

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

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

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

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

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

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

    
537
task userdoc_publish_html_style(
538
  type: Copy,
539
  description: "Copy viewer_appJS CSS to the html output directory"
540
) {
541
  into "${buildDir}/userdoc/html"
542
  from "${projectDir}/src/viewer_appJS/viewer_app.css"
543
  filter { line ->
544
    line.contains("url('saxon-base.css')")
545
            ? line.replace("saxon-base.css", "../../saxon-base.css")
546
            : line
547
  }
548
}
549

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

    
563
// ============================================================
564

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

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

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

    
590
// ============================================================
591

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

    
608
task gen_feature_matrix(
609
        type: JavaExec,
610
        description: "Creates the base feature matrix file for the website"
611
) {
612
  inputs.file "${projectDir}/tools/docs/feature-matrix/feature-matrix.xml"
613
  inputs.file "${projectDir}/tools/docs/feature-matrix/feature-matrix-to-overview-chart.xsl"
614
  outputs.file "${buildDir}/website/products/feature-matrix-${saxonMajorVersion}.xml"
615
  classpath = configurations.documentation
616
  main = "com.saxonica.Transform"
617
  args "${projectDir}/tools/docs/feature-matrix/feature-matrix.xml",
618
          "-xsl:${projectDir}/tools/docs/feature-matrix/feature-matrix-to-overview-chart.xsl",
619
          "-o:${buildDir}/website/products/feature-matrix-${saxonMajorVersion}.xml"
620
}
621

    
622
task gen_prod_desc(
623
        type: JavaExec,
624
        description: "Creates the base product description file"
625
) {
626
  inputs.file "${projectDir}/tools/docs/feature-matrix/feature-matrix.xml"
627
  inputs.file "${projectDir}/tools/docs/feature-matrix/feature-matrix-to-prod-desc.xsl"
628
  outputs.file "${buildDir}/proddesc/prod-desc.xml"
629
  classpath = configurations.documentation
630
  main = "com.saxonica.Transform"
631
  args "${projectDir}/tools/docs/feature-matrix/feature-matrix.xml",
632
          "-xsl:${projectDir}/tools/docs/feature-matrix/feature-matrix-to-prod-desc.xsl",
633
          "-o:${buildDir}/proddesc/prod-desc.xml"
634
}
635

    
636
task gen_prod_desc_fo(
637
        type: JavaExec,
638
        dependsOn: ["gen_prod_desc"],
639
        description: "Creates the FO and HTML versions of the product descriptions"
640
) {
641
  inputs.file "${buildDir}/proddesc/prod-desc.xml"
642
  inputs.file "${projectDir}/tools/docs/feature-matrix/PD/prod-desc-to-fo.xsl"
643
  outputs.file "${buildDir}/proddesc/PD/dummy.xml"
644
  classpath = configurations.documentation
645
  main = "com.saxonica.Transform"
646
  args "${buildDir}/proddesc/prod-desc.xml",
647
          "-xsl:${projectDir}/tools/docs/feature-matrix/PD/prod-desc-to-fo.xsl",
648
          "-o:${buildDir}/proddesc/PD/dummy.xml"
649
}
650

    
651
// TODO Next step to generate the PDFs never worked in Ant, we had to do it manually.
652
// Open each build/proddesc/PD/fo/*.fo document in Oxygen and run from there:
653
// run Apply Configuration Scenario FO PDF (default)
654
// The generated PDFs should then be copied to build/website/products/PD${saxonMajorVersion}/
(6-6/14)