Skip to content

Commit 0a94abb

Browse files
jyjeanneJeremy Jeanne
andauthored
Bump jyjeanne/dita-ot-gradle from 2.3.2 to 2.8.2 (#660)
- Update dita-ot-gradle plugin from v2.3.2 to v2.8.2 - Enable Configuration Cache for faster incremental builds Co-authored-by: Jeremy Jeanne <jeremy.jeanne@4dconcept.fr> Signed-off-by: Jeremy Jeanne <jeremy.jeanne@4dconcept.fr>
1 parent 070c86b commit 0a94abb

2 files changed

Lines changed: 14 additions & 25 deletions

File tree

build.gradle

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
plugins {
11-
id 'io.github.jyjeanne.dita-ot-gradle' version '2.3.2'
11+
id 'io.github.jyjeanne.dita-ot-gradle' version '2.8.2'
1212
// Removed: 'com.github.eerohele.saxon-gradle' - not Configuration Cache compatible
1313
// Replaced with: inline XsltTransformTask class below
1414
}
@@ -187,14 +187,12 @@ task autoGenerate(dependsOn: [messages, params, extensionPoints, generatePlatfor
187187
task pdf(type: DitaOtTask, dependsOn: autoGenerate) {
188188
group = 'documentation'
189189
description = 'Build PDF documentation.'
190-
// Set DITA-OT directory: pass as parameter -PditaHome or fall back to parent when run in core repo.
191190
ditaOt file(findProperty('ditaHome') ?: ditaHome)
192191
input "${projectDirPath}/userguide-book.ditamap"
193192
output outputDir
194193
transtype 'pdf'
195194
filter "${projectDirPath}/resources/pdf.ditaval"
196195

197-
// Use ditaProperties MapProperty directly for v2.3.0 compatibility
198196
ditaProperties.put('args.chapter.layout', 'BASIC')
199197
ditaProperties.put('args.gen.task.lbl', 'YES')
200198
ditaProperties.put('include.rellinks', '#default external')
@@ -205,14 +203,12 @@ task pdf(type: DitaOtTask, dependsOn: autoGenerate) {
205203
task html(type: DitaOtTask, dependsOn: autoGenerate) {
206204
group = 'documentation'
207205
description = 'Build HTML5 documentation.'
208-
// Set DITA-OT directory: pass as parameter -PditaHome or fall back to parent when run in core repo.
209206
ditaOt file(findProperty('ditaHome') ?: ditaHome)
210207
input "${projectDirPath}/userguide.ditamap"
211208
output outputDir
212209
transtype 'html5'
213210
filter "${projectDirPath}/resources/html.ditaval"
214211

215-
// Use ditaProperties MapProperty directly for v2.3.0 compatibility
216212
ditaProperties.put('args.copycss', 'yes')
217213
ditaProperties.put('args.css', 'dita-ot-doc.css')
218214
ditaProperties.put('args.csspath', 'css')
@@ -227,14 +223,12 @@ task html(type: DitaOtTask, dependsOn: autoGenerate) {
227223
task htmlhelp(type: DitaOtTask, dependsOn: autoGenerate) {
228224
group = 'documentation'
229225
description = 'Build HTML Help (.chm) documentation.'
230-
// Set DITA-OT directory: pass as parameter -PditaHome or fall back to parent when run in core repo.
231226
ditaOt file(findProperty('ditaHome') ?: ditaHome)
232227
input "${projectDirPath}/userguide.ditamap"
233228
output outputDir
234229
transtype 'htmlhelp'
235230
filter ditavalFile
236231

237-
// Use ditaProperties MapProperty directly for v2.3.0 compatibility
238232
ditaProperties.put('args.copycss', 'yes')
239233
ditaProperties.put('args.css', 'dita-ot-doc.css')
240234
ditaProperties.put('args.csspath', 'css')
@@ -256,16 +250,13 @@ task htmlhelp(type: DitaOtTask, dependsOn: autoGenerate) {
256250
}
257251
}
258252

259-
task cleanOutput {
253+
task cleanOutput(type: Delete) {
260254
group = 'build'
261255
description = 'Delete the output directory.'
262-
doLast {
263-
delete outputDir
264-
}
256+
delete file(outputDir)
265257
}
266258

267259
// Get git commit hash using Gradle 9 compatible Provider API
268-
// Uses providers.exec() instead of deprecated project.exec()
269260
def gitCommitHash = providers.exec {
270261
commandLine 'git', 'rev-parse', 'HEAD'
271262
ignoreExitValue = true
@@ -274,40 +265,41 @@ def gitCommitHash = providers.exec {
274265
task gitMetadata {
275266
group = 'build'
276267
description = 'Log git commit metadata.'
277-
// This task just logs the git commit for reference
278268
doLast {
279269
logger.lifecycle("Git commit: ${gitCommitHash}")
280270
}
281-
282-
// Mark outputs to help with up-to-date checking
283-
outputs.upToDateWhen { false } // Always run since git commit changes frequently
271+
outputs.upToDateWhen { false }
284272
}
285273

286274
task site(type: DitaOtTask) {
287275
group = 'documentation'
288276
description = 'Build website documentation.'
289277
dependsOn 'messages', 'params', 'extensionPoints', 'gitMetadata'
290278

291-
// Set DITA-OT directory: pass as parameter -PditaHome or fall back to parent when run in core repo.
292279
ditaOt file(findProperty('ditaHome') ?: ditaHome)
293280
input file("${projectDirPath}/site.ditamap")
294281
output getPropertyOrDefault('outputDir', layout.buildDirectory.dir("site").get().asFile.path)
295282
filter "${projectDirPath}/resources/site.ditaval"
296-
297283
transtype 'org.dita-ot.html'
298284

299285
// Evaluate the noCommitMeta flag at configuration time
300286
def includeCommitMeta = !providers.gradleProperty('noCommitMeta').map { Boolean.parseBoolean(it) }.getOrElse(false)
301287

302-
// Use ditaProperties MapProperty directly for v2.3.0 compatibility
303288
ditaProperties.put('args.gen.task.lbl', 'YES')
304289
ditaProperties.put('args.rellinks', 'noparent')
305290
if (includeCommitMeta) {
306-
// Use the git commit hash obtained at configuration time
307291
ditaProperties.put('commit', gitCommitHash)
308292
}
309293
}
310294

295+
// =============================================================================
296+
// Verification Tasks (v2.8.1 features)
297+
// =============================================================================
298+
299+
// =============================================================================
300+
// Aggregate Tasks
301+
// =============================================================================
302+
311303
task all(dependsOn: [pdf, html, htmlhelp]) {
312304
group = 'documentation'
313305
description = 'Build all documentation formats (PDF, HTML, HTMLHelp).'

gradle.properties

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Fix Java memory errors with Gradle 5.2
22
org.gradle.jvmargs = -Xmx1024m
33

4-
# Gradle 8 features for better performance and caching
5-
# ↓ Not supported by eerohele/dita-ot-gradle ↓
6-
# org.gradle.configuration-cache=true
7-
# org.gradle.configuration-cache.problems=warn
8-
# ↑ Not supported by eerohele/dita-ot-gradle ↑
4+
# Gradle 9 features for better performance and caching
5+
org.gradle.configuration-cache=true
96
org.gradle.parallel=true
107
org.gradle.caching=true

0 commit comments

Comments
 (0)