Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 38 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.eerohele.dita-ot-gradle' version '0.7.1'
id 'io.github.jyjeanne.dita-ot-gradle' version '2.3.0'
id 'com.github.eerohele.saxon-gradle' version '0.9.0-beta4'
}

Expand All @@ -18,7 +18,7 @@ dependencies {
saxon 'net.sf.saxon:Saxon-HE:10.6'
}

import com.github.eerohele.DitaOtTask
import com.github.jyjeanne.DitaOtTask
import com.github.eerohele.SaxonXsltTask
import org.gradle.process.ExecOperations

Expand All @@ -41,8 +41,6 @@ String toURI(String path) {
file(path).toURI().toString()
}

ditaOt.dir ditaHome

task messages(type: SaxonXsltTask) {
input "${configDir}/messages.xml"
output "${projectDirPath}/topics/error-messages.xml"
Expand Down Expand Up @@ -99,52 +97,55 @@ task autoGenerate(dependsOn: [messages, params, extensionPoints, generatePlatfor
}

task pdf(type: DitaOtTask, dependsOn: autoGenerate) {
// Set DITA-OT directory: pass as parameter -PditaHome or fall back to parent when run in core repo.
ditaOt file(findProperty('ditaHome') ?: ditaHome)
input "${projectDirPath}/userguide-book.ditamap"
output outputDir
transtype 'pdf'
filter "${projectDirPath}/resources/pdf.ditaval"

properties {
property(name: 'args.chapter.layout', value: 'BASIC')
property(name: 'args.gen.task.lbl', value: 'YES')
property(name: 'include.rellinks', value: '#default external')
property(name: 'outputFile.base', value: 'userguide')
property(name: 'theme', value: "${projectDirPath}/samples/themes/dita-ot-docs-theme.yaml")
}
// Use ditaProperties MapProperty directly for v2.3.0 compatibility
ditaProperties.put('args.chapter.layout', 'BASIC')
ditaProperties.put('args.gen.task.lbl', 'YES')
ditaProperties.put('include.rellinks', '#default external')
ditaProperties.put('outputFile.base', 'userguide')
ditaProperties.put('theme', "${projectDirPath}/samples/themes/dita-ot-docs-theme.yaml")
}

task html(type: DitaOtTask, dependsOn: autoGenerate) {
// Set DITA-OT directory: pass as parameter -PditaHome or fall back to parent when run in core repo.
ditaOt file(findProperty('ditaHome') ?: ditaHome)
input "${projectDirPath}/userguide.ditamap"
output outputDir
transtype 'html5'
filter "${projectDirPath}/resources/html.ditaval"

properties {
property(name: 'args.copycss', value: 'yes')
property(name: 'args.css', value: 'dita-ot-doc.css')
property(name: 'args.csspath', value: 'css')
property(name: 'args.cssroot', value: "${projectDirPath}/resources/")
property(name: 'args.gen.task.lbl', value: 'YES')
property(name: 'args.hdr', value: "${projectDirPath}/resources/header.xml")
property(name: 'args.rellinks', value: 'noparent')
property(name: 'html5.toc.generate', value: 'no')
property(name: 'nav-toc', value: 'partial')
}
// Use ditaProperties MapProperty directly for v2.3.0 compatibility
ditaProperties.put('args.copycss', 'yes')
ditaProperties.put('args.css', 'dita-ot-doc.css')
ditaProperties.put('args.csspath', 'css')
ditaProperties.put('args.cssroot', "${projectDirPath}/resources/")
ditaProperties.put('args.gen.task.lbl', 'YES')
ditaProperties.put('args.hdr', "${projectDirPath}/resources/header.xml")
ditaProperties.put('args.rellinks', 'noparent')
ditaProperties.put('html5.toc.generate', 'no')
ditaProperties.put('nav-toc', 'partial')
}

task htmlhelp(type: DitaOtTask, dependsOn: autoGenerate) {
// Set DITA-OT directory: pass as parameter -PditaHome or fall back to parent when run in core repo.
ditaOt file(findProperty('ditaHome') ?: ditaHome)
input "${projectDirPath}/userguide.ditamap"
output outputDir
transtype 'htmlhelp'
filter ditavalFile

properties {
property(name: 'args.copycss', value: 'yes')
property(name: 'args.css', value: 'dita-ot-doc.css')
property(name: 'args.csspath', value: 'css')
property(name: 'args.cssroot', value: "${projectDirPath}/resources/")
property(name: 'args.gen.task.lbl', value: 'YES')
}
// Use ditaProperties MapProperty directly for v2.3.0 compatibility
ditaProperties.put('args.copycss', 'yes')
ditaProperties.put('args.css', 'dita-ot-doc.css')
ditaProperties.put('args.csspath', 'css')
ditaProperties.put('args.cssroot', "${projectDirPath}/resources/")
ditaProperties.put('args.gen.task.lbl', 'YES')

doLast {
// Move .chm files using modern Gradle file operations
Expand Down Expand Up @@ -200,6 +201,8 @@ task gitMetadata {
task site(type: DitaOtTask) {
dependsOn 'messages', 'params', 'extensionPoints', 'gitMetadata'

// Set DITA-OT directory: pass as parameter -PditaHome or fall back to parent when run in core repo.
ditaOt file(findProperty('ditaHome') ?: ditaHome)
input file("${projectDirPath}/site.ditamap")
output getPropertyOrDefault('outputDir', "${buildDir}/site")
filter "${projectDirPath}/resources/site.ditaval"
Expand All @@ -209,13 +212,12 @@ task site(type: DitaOtTask) {
// Evaluate the noCommitMeta flag at configuration time
def includeCommitMeta = !providers.gradleProperty('noCommitMeta').map { Boolean.parseBoolean(it) }.getOrElse(false)

properties {
property(name: 'args.gen.task.lbl', value: 'YES')
property(name: 'args.rellinks', value: 'noparent')
if (includeCommitMeta) {
// Use the git commit hash obtained at configuration time
property(name: 'commit', value: gitCommitHash)
}
// Use ditaProperties MapProperty directly for v2.3.0 compatibility
ditaProperties.put('args.gen.task.lbl', 'YES')
ditaProperties.put('args.rellinks', 'noparent')
if (includeCommitMeta) {
// Use the git commit hash obtained at configuration time
ditaProperties.put('commit', gitCommitHash)
}
}

Expand Down