Skip to content

Commit

Permalink
Fix eclipse ide settings generation (#13649)
Browse files Browse the repository at this point in the history
* Only run the ide configuration block for eclipse when explicitly invoked. fix property access ordering here and there.

* Correct dependsOn task name.

* Correct crlf/encoding after versionCatalogFormatDeps finishes.

* Change java-library to java-base in the plugin applied within the eclipse task.

* use ant.fixcrlf to correct line endings.

* Changes entry.

* Simplify fixcrlf

---------

Co-authored-by: Uwe Schindler <[email protected]>
  • Loading branch information
dweiss and uschindler authored Aug 14, 2024
1 parent 97e30fa commit 1cfa697
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ ext {
// Minimum Java version required to compile and run Lucene.
minJavaVersion = JavaVersion.toVersion(deps.versions.minJava.get())

// also change this in extractor tool: ExtractForeignAPI
vectorIncubatorJavaVersions = [ JavaVersion.VERSION_21, JavaVersion.VERSION_22 ] as Set

// snapshot build marker used in scripts.
snapshotBuild = version.contains("SNAPSHOT")

Expand Down Expand Up @@ -117,10 +120,6 @@ apply from: file('gradle/generation/local-settings.gradle')
// Make sure the build environment is consistent.
apply from: file('gradle/validation/check-environment.gradle')

// IDE support, settings and specials.
apply from: file('gradle/ide/intellij-idea.gradle')
apply from: file('gradle/ide/eclipse.gradle')

// Set up defaults and configure aspects for certain modules or functionality
// (java, tests)
apply from: file('gradle/java/folder-layout.gradle')
Expand All @@ -133,6 +132,10 @@ apply from: file('gradle/testing/alternative-jdk-support.gradle')
apply from: file('gradle/java/jar-manifest.gradle')
apply from: file('gradle/java/modules.gradle')

// IDE support, settings and specials.
apply from: file('gradle/ide/intellij-idea.gradle')
apply from: file('gradle/ide/eclipse.gradle')

// Maven artifact publishing.
apply from: file('gradle/maven/publications.gradle')

Expand Down
7 changes: 0 additions & 7 deletions gradle/generation/extract-jdk-apis.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@

def resources = scriptResources(buildscript)

configure(rootProject) {
ext {
// also change this in extractor tool: ExtractForeignAPI
vectorIncubatorJavaVersions = [ JavaVersion.VERSION_21, JavaVersion.VERSION_22 ] as Set
}
}

configure(project(":lucene:core")) {
ext {
apijars = layout.projectDirectory.dir("src/generated/jdk")
Expand Down
11 changes: 6 additions & 5 deletions gradle/ide/eclipse.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import org.gradle.plugins.ide.eclipse.model.ClasspathEntry
def resources = scriptResources(buildscript)

configure(rootProject) {
plugins.withType(JavaPlugin) {
apply plugin: "eclipse"
if (gradle.startParameter.taskNames.contains("eclipse")) {
project.pluginManager.apply("java-base")
project.pluginManager.apply("eclipse")

def eclipseJavaVersion = propertyOrDefault("eclipse.javaVersion", rootProject.minJavaVersion)
def eclipseJavaVersion = propertyOrDefault("eclipse.javaVersion", deps.versions.minJava.get())
def relativize = { other -> rootProject.rootDir.relativePath(other).toString() }

eclipse {
Expand Down Expand Up @@ -105,9 +106,9 @@ configure(rootProject) {
}
}

eclipseJdt {
eclipseJdt {
enabled = false
dependsOn 'luceneEclipse'
dependsOn 'luceneEclipseJdt'
}

eclipseClasspath {
Expand Down
12 changes: 12 additions & 0 deletions gradle/validation/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ configure(rootProject) {
it.dependsOn(":versionCatalogFormatDeps")
}

// correct crlf/ default encoding after version catalog formatting finishes.
tasks.matching {
it.path in [
":versionCatalogFormatDeps"
]
}.configureEach {
it.doLast {
ant.fixcrlf(file: it.catalogFile.get().asFile,
eol: "lf", fixlast: "true", encoding: "UTF-8")
}
}

tasks.matching {
it.path in [
":versionCatalogUpdateDeps"
Expand Down
5 changes: 5 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ Other

* GITHUB#13499: Remove usage of TopScoreDocCollector + TopFieldCollector deprecated methods (#create, #createSharedManager) (Jakub Slowinski)

Build
---------------------

* GITHUB#13649: Fix eclipse ide settings generation #13649 (Uwe Schindler, Dawid Weiss)

======================== Lucene 9.12.0 =======================

API Changes
Expand Down

0 comments on commit 1cfa697

Please sign in to comment.