mirror of https://github.com/apache/lucene.git
LUCENE-9474: Make external tools configurable like in ant through those sysprops: perl.exe, python3.exe, python2.exe
This commit is contained in:
parent
ee6cf4c418
commit
494a8a8e04
|
@ -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.
|
||||
|
|
|
@ -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 = output
|
||||
|
|
|
@ -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.parentFile
|
||||
standardOutput = output
|
||||
args += [
|
||||
|
|
|
@ -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").absolutePath
|
||||
|
|
|
@ -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[] instead
|
||||
args = [snowballScript, snowballStemmerDir, snowballWebsiteDir, snowballDataDir, projectDir]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class CheckBrokenLinksTask extends DefaultTask {
|
|||
def result
|
||||
outputFile.withOutputStream { output ->
|
||||
result = project.exec {
|
||||
executable "python3"
|
||||
executable project.externalToolExecutables["python3"]
|
||||
ignoreExitValue = true
|
||||
standardOutput = output
|
||||
errorOutput = output
|
||||
|
|
|
@ -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 = true
|
||||
standardOutput = output
|
||||
errorOutput = output
|
||||
|
|
Loading…
Reference in New Issue