Improvement for LUCENE-9881 (#46): Completely disable Eclipse plugins's eclipseJdt task and replace by owur own just copying the filtered config files. This now works correctly with inputs/outputs.

This commit is contained in:
Uwe Schindler 2021-03-27 12:08:12 +01:00
parent 690e256ec9
commit 3538709269
1 changed files with 15 additions and 11 deletions

View File

@ -73,27 +73,31 @@ configure(rootProject) {
}
}
eclipseJdt {
task luceneEclipseJdt(type: Sync) {
def errorMode = project.propertyOrDefault('eclipse.errors','warning');
def ecjLintFile = rootProject.file('gradle/validation/ecj-lint/ecj.javadocs.prefs');
description = 'Generates the Eclipse JDT settings file.'
inputs.file(ecjLintFile)
inputs.property('errorMode', errorMode)
from rootProject.file("${resources}/dot.settings")
into rootProject.file(".settings")
filter(ReplaceTokens, tokens: [
'ecj-lint-config': ecjLintFile.getText('UTF-8').replaceAll(/=error\b/, '=' + errorMode)
])
filteringCharset = 'UTF-8'
doLast {
def ecjLintConfig = ecjLintFile.getText('UTF-8')
.replaceAll(/=error\b/, '=' + errorMode)
project.sync {
from rootProject.file("${resources}/dot.settings")
into rootProject.file(".settings")
filter(ReplaceTokens, tokens: [
'ecj-lint-config': ecjLintConfig
])
filteringCharset = 'UTF-8'
}
logger.lifecycle('Eclipse config written with ECJ errors configured as {}. Change by passing -Peclipse.errors=ignore/warning/error.', errorMode)
}
}
eclipseJdt {
enabled = false
dependsOn 'luceneEclipseJdt'
}
}
public class LibEntry implements ClasspathEntry {