Apache Lucene open-source search software
LUCENE-9474: Make external tools configurable like in ant through those sysprops: perl.exe, python3.exe, python2.exe
Uwe Schindler494a8a8e04b8
diff --git a/build.gradle b/build.gradleindex 571ab303167..ec5fed0cb84 100644--- a/build.gradle+++ b/build.gradle@@ -89,6 +89,13 @@ ext {"jgit": "5.3.0.201903130848-r","flexmark": "0.61.24",]++ // read some external tool locations from system props+ externalToolExecutables = [+ "python3": propertyOrDefault('python3.exe', 'python3'),+ "python2": propertyOrDefault('python2.exe', 'python2'),+ "perl": propertyOrDefault('perl.exe', 'perl'),+ ]}// Include smaller chunks configuring dedicated build areas.diff --git a/gradle/documentation/changes-to-html.gradle b/gradle/documentation/changes-to-html.gradleindex 8d8c02eabb7..5f565322217 100644--- a/gradle/documentation/changes-to-html.gradle+++ b/gradle/documentation/changes-to-html.gradle@@ -54,7 +54,7 @@ class ChangesToHtmlTask extends DefaultTask {def toHtml(File versionsFile) {def output = new ByteArrayOutputStream()def result = project.exec {- executable "perl"+ executable project.externalToolExecutables["perl"]standardInput changesFile.newInputStream()standardOutput project.file("${targetDir.get().getAsFile()}/Changes.html").newOutputStream()errorOutput = outputdiff --git a/gradle/generation/jflex.gradle b/gradle/generation/jflex.gradleindex 9bdbc2c9e33..1f5feb2d1aa 100644--- a/gradle/generation/jflex.gradle+++ b/gradle/generation/jflex.gradle@@ -149,7 +149,7 @@ configure(project(":lucene:analysis:common")) {def target = file('src/java/org/apache/lucene/analysis/charfilter/HTMLCharacterEntities.jflex')target.withOutputStream { output ->project.exec {- executable = "python"+ executable = project.externalToolExecutables["python2"]workingDir = target.parentFilestandardOutput = outputargs += [diff --git a/gradle/generation/kuromoji.gradle b/gradle/generation/kuromoji.gradleindex 2f55c1a0265..c865a13eaed 100644--- a/gradle/generation/kuromoji.gradle+++ b/gradle/generation/kuromoji.gradle@@ -73,7 +73,7 @@ configure(project(":lucene:analysis:kuromoji")) {// Apply patch via local git.project.exec {workingDir = unpackedDir- executable "git"+ executable "git" // TODO: better use jgit to apply patch, this is not portable!!!args += ["apply",file("src/tools/patches/Noun.proper.csv.patch").absolutePathdiff --git a/gradle/generation/snowball.gradle b/gradle/generation/snowball.gradleindex 6f7049e5d43..b2b6882d67d 100644--- a/gradle/generation/snowball.gradle+++ b/gradle/generation/snowball.gradle@@ -100,7 +100,7 @@ configure(project(":lucene:analysis:common")) {doLast {project.exec {- executable "bash"+ executable "bash" // TODO: does not work with windows, use project.externalToolExecutables[] insteadargs = [snowballScript, snowballStemmerDir, snowballWebsiteDir, snowballDataDir, projectDir]}}diff --git a/gradle/generation/util.gradle b/gradle/generation/util.gradleindex 597b60af540..d1a3c240069 100644--- a/gradle/generation/util.gradle+++ b/gradle/generation/util.gradle@@ -57,7 +57,7 @@ configure(project(":lucene:core")) {logger.lifecycle("Executing: ${prog} in ${targetDir}")project.exec {workingDir targetDir- executable "python3"+ executable project.externalToolExecutables["python3"]args = ['-B', "${prog}"]}}@@ -82,7 +82,7 @@ configure(project(":lucene:core")) {['True', 'False'].each { transpose ->project.exec {workingDir targetDir- executable "python3"+ executable project.externalToolExecutables["python3"]args = ['-B', 'createLevAutomata.py', num, transpose, "${momanDir}/finenight/python"]}}diff --git a/gradle/validation/check-broken-links.gradle b/gradle/validation/check-broken-links.gradleindex bebfe4550b5..28104750372 100644--- a/gradle/validation/check-broken-links.gradle+++ b/gradle/validation/check-broken-links.gradle@@ -52,7 +52,7 @@ class CheckBrokenLinksTask extends DefaultTask {def resultoutputFile.withOutputStream { output ->result = project.exec {- executable "python3"+ executable project.externalToolExecutables["python3"]ignoreExitValue = truestandardOutput = outputerrorOutput = outputdiff --git a/gradle/validation/missing-docs-check.gradle b/gradle/validation/missing-docs-check.gradleindex e4659973cfc..e9cb6aefd8f 100644--- a/gradle/validation/missing-docs-check.gradle+++ b/gradle/validation/missing-docs-check.gradle@@ -89,7 +89,7 @@ class CheckMissingDocsTask extends DefaultTask {def checkMissingJavadocs(File dir, String level) {def output = new ByteArrayOutputStream()def result = project.exec {- executable "python3"+ executable project.externalToolExecutables["python3"]ignoreExitValue = truestandardOutput = outputerrorOutput = output