diff --git a/build.gradle b/build.gradle index cf6a416d8f..93103d18c7 100644 --- a/build.gradle +++ b/build.gradle @@ -531,6 +531,12 @@ tasks.register('webManual', Sync) { } } +providers.exec { + ignoreExitValue = true + commandLine ["doc_src/detect_build_method"] +} +def docMethod = exe.result.get() == 0 ? exe.standardOutput.asText.get().trim() : '' + ext.manualIndexXmls = fileTree(dir: 'doc_src', include: '**/OmegaTUsersManual_xinclude full.xml') manualIndexXmls.each { xml -> def lang = xml.parentFile.name @@ -539,10 +545,7 @@ manualIndexXmls.each { xml -> inputs.files fileTree(dir: "doc_src/${lang}", includes: ['**/*.xml', 'images/*.png'], excludes: ['xhtml5/*', 'index.xml']) outputs.files layout.buildDirectory.file("docs/pdfs/OmegaT_documentation_${lang}.PDF") - onlyIf { - conditions([exePresent('docker') || exePresent('nerdctl'), 'Docker or nerdctl is not installed'], - [!project.hasProperty('forceSkipDocumentBuild'), 'Specified forceSkipDocumentBuild property']) - } + onlyIf {project.hasProperty('publish') || !project.hasProperty('forceSkipDocumentBuild')} workingDir = 'doc_src' commandLine './docgen', "-Dlanguage=${lang}", "-Dtarget=../build/docs/pdfs", 'pdf' doLast { diff --git a/doc_src/build.xml b/doc_src/build.xml index 5908b8228d..d46e9fdf5f 100644 --- a/doc_src/build.xml +++ b/doc_src/build.xml @@ -27,6 +27,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc_src/detect_build_method b/doc_src/detect_build_method new file mode 100755 index 0000000000..eead6d9943 --- /dev/null +++ b/doc_src/detect_build_method @@ -0,0 +1,21 @@ +#!/usr/bin/bash + +## RESULT +METHOD="container" + +## Detect container runtime and cli +CMD="$(type -p docker)" && $CMD info >/dev/null 2>&1 || CMD="$(type -p nerdctl)" +if [ "$CMD" == "" ]; then + METHOD="ant" +else + $CMD info > /dev/null 2>&1 || METHOD="ant" +fi + +## Detect ant, and dependencies +if [ "$METHOD" == "ant" ]; then + CMD="$(type -p ant)" + if [ "$CMD" != "" ]; then + $CMD check-dependencies >> /dev/null 2>&1 || METHOD="" + fi +fi +echo $METHOD \ No newline at end of file