diff --git a/gradle/ide/eclipse.gradle b/gradle/ide/eclipse.gradle index e24bdfb9dcc..0a5b6083d63 100644 --- a/gradle/ide/eclipse.gradle +++ b/gradle/ide/eclipse.gradle @@ -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 {