@@ -8,7 +8,7 @@ buildscript {
88}
99
1010plugins {
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
187187task 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) {
205203task 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) {
227223task 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()
269260def gitCommitHash = providers. exec {
270261 commandLine ' git' , ' rev-parse' , ' HEAD'
271262 ignoreExitValue = true
@@ -274,40 +265,41 @@ def gitCommitHash = providers.exec {
274265task 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
286274task 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+
311303task all (dependsOn : [pdf, html, htmlhelp]) {
312304 group = ' documentation'
313305 description = ' Build all documentation formats (PDF, HTML, HTMLHelp).'
0 commit comments