From 802c5b973bc54f0db8dd79cdf5f228fc8c04683b Mon Sep 17 00:00:00 2001 From: Jarno Elovirta Date: Wed, 1 Jul 2020 19:19:48 +0300 Subject: [PATCH] Generate plug-in DITAVAL Signed-off-by: Jarno Elovirta --- .gitignore | 1 + build.gradle | 12 +++++++++++- resources/plugins-ditaval.xsl | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 resources/plugins-ditaval.xsl diff --git a/.gitignore b/.gitignore index f7bf61509..dc6882154 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ samples/properties/template.properties ## Autogenerated files created by the build process platform.ditaval +plugins.ditaval error-messages.xml extension-points/all-extension-points.dita extension-points/extension-points-in-*.dita diff --git a/build.gradle b/build.gradle index 8287c5958..9b67cffb3 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,7 @@ String ditaHome = getPropertyOrDefault('ditaHome', projectDir.getParent()) String ditaHomeSrc = getPropertyOrDefault('ditaHomeSrc', ditaHome) String configDir = "${ditaHomeSrc}/config" String ditavalFile = "${projectDir}/platform.ditaval" +String pluginsDitavalFile = "${projectDir}/plugins.ditaval" Boolean toolkitBuild = file("${projectDir}/../lib/dost.jar").exists() String samplesDir = toolkitBuild ? "${ditaHome}/docsrc/samples" : "${projectDir}/samples" String outputDir = getPropertyOrDefault('outputDir', toolkitBuild ? "${ditaHome}/doc" : "${projectDir}/out") @@ -67,13 +68,19 @@ task generatePlatformFilter { } } +task generatePluginDitaval(type: SaxonXsltTask) { + input "${configDir}/plugins.xml" + output pluginsDitavalFile + stylesheet "${projectDir}/resources/plugins-ditaval.xsl" +} + task generatePropertiesTemplate(type: SaxonXsltTask) { input "${configDir}/plugins.xml" output "${samplesDir}/properties/template.properties" stylesheet "${projectDir}/resources/properties-file.xsl" } -task autoGenerate(dependsOn: [messages, params, extensionPoints, generatePlatformFilter, generatePropertiesTemplate]) { +task autoGenerate(dependsOn: [messages, params, extensionPoints, generatePlatformFilter, generatePluginDitaval, generatePropertiesTemplate]) { description 'Run tasks that generate content from resource files and the build environment.' } @@ -92,6 +99,7 @@ task html(type: DitaOtTask, dependsOn: autoGenerate) { output outputDir transtype 'html5' filter "${projectDir}/resources/html.ditaval" + filter pluginsDitavalFile properties { property(file: "${projectDir}/samples/properties/docs-build-html5.properties") @@ -103,6 +111,7 @@ task htmlhelp(type: DitaOtTask, dependsOn: autoGenerate) { output outputDir transtype 'htmlhelp' filter ditavalFile + filter pluginsDitavalFile properties { property(file: "${projectDir}/samples/properties/docs-build-htmlhelp.properties") @@ -142,6 +151,7 @@ task site(type: DitaOtTask) { input file("${projectDir}/site.ditamap") output getPropertyOrDefault('outputDir', "${buildDir}/site") filter "${projectDir}/resources/site.ditaval" + // filter pluginsDitavalFile transtype 'org.dita-ot.html' diff --git a/resources/plugins-ditaval.xsl b/resources/plugins-ditaval.xsl new file mode 100644 index 000000000..a61097737 --- /dev/null +++ b/resources/plugins-ditaval.xsl @@ -0,0 +1,14 @@ + + + + + + + + + + + + +