Skip to content

Commit a938e31

Browse files
committed
HHH-19827 Leverage the JAVA_EXEC execution mode for Asciidoc tasks
to help prevent the OOMs that usually occur locally, especially when building PDFs
1 parent afa75ee commit a938e31

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

documentation/documentation.gradle

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import java.util.function.Function
66

77
import org.asciidoctor.gradle.jvm.AsciidoctorTask
88
import org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfTask
9+
import org.ysb33r.grolifant.api.core.jvm.ExecutionMode
910

1011
buildscript {
1112
configurations.configureEach {
@@ -907,9 +908,16 @@ def buildDocsForPublishingTask = tasks.register( 'buildDocsForPublishing' ) { ta
907908
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
908909

909910
tasks.withType(AsciidoctorTask).configureEach {
910-
baseDirFollowsSourceDir()
911-
outputOptions {
912-
separateOutputDirs = false
913-
backends 'html5'
914-
}
911+
baseDirFollowsSourceDir()
912+
outputOptions {
913+
separateOutputDirs = false
914+
backends 'html5'
915+
}
916+
// See https://docs.asciidoctor.org/gradle-plugin/latest/common-task-configuration/#choosing-an-execution-mode-for-asciidoctorj
917+
executionMode = ExecutionMode.JAVA_EXEC
918+
}
919+
920+
tasks.withType(AsciidoctorPdfTask).configureEach {
921+
// See https://docs.asciidoctor.org/gradle-plugin/latest/common-task-configuration/#choosing-an-execution-mode-for-asciidoctorj
922+
executionMode = ExecutionMode.JAVA_EXEC
915923
}

0 commit comments

Comments
 (0)