mirror of https://github.com/apache/lucene.git
after reading code, correct the argument file to comply with ECJ's parser
This commit is contained in:
parent
6941701c6d
commit
db9dff225c
|
@ -65,12 +65,15 @@ allprojects {
|
||||||
// limits. We could pass a directory but ecj seems to be buggy: when it
|
// limits. We could pass a directory but ecj seems to be buggy: when it
|
||||||
// encounters a module-info.java file it no longer compiles other source files.
|
// encounters a module-info.java file it no longer compiles other source files.
|
||||||
def inputsFile = file("${tmpDst}/ecj-inputs.txt")
|
def inputsFile = file("${tmpDst}/ecj-inputs.txt")
|
||||||
def escapeOption = { String s -> (s =~ /[ '"]/) ? ('"' + s.replaceAll(/[\\'"]/, /\\$0/) + '"') : s }
|
// escape filename accoring to ECJ's rules:
|
||||||
|
// https://github.com/eclipse/aspectj.eclipse.jdt.core/blob/a05312e746b9bc2b48b4b039f6e7b5e061b5b393/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java#L1533-L1537
|
||||||
|
// Basically surround all whitespace by quotes:
|
||||||
|
def escapeFileName = { String s -> s.replaceAll(/ +/, /"$0"/) }
|
||||||
inputsFile.setText(
|
inputsFile.setText(
|
||||||
srcDirs.collectMany { dir ->
|
srcDirs.collectMany { dir ->
|
||||||
project.fileTree(dir: dir, include: "**/*.java" ).files
|
project.fileTree(dir: dir, include: "**/*.java" ).files
|
||||||
}
|
}
|
||||||
.collect {file -> escapeOption(file.absolutePath.toString())}.join("\n"), "UTF-8")
|
.collect {file -> escapeFileName(file.absolutePath.toString())}.join("\n"), "UTF-8")
|
||||||
|
|
||||||
args += [ "-d", "none" ]
|
args += [ "-d", "none" ]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue