diff --git a/.github/workflows/run-checks-gradle-upgrade.yml b/.github/workflows/run-checks-gradle-upgrade.yml index 751c3471b51..4e0ef65f03a 100644 --- a/.github/workflows/run-checks-gradle-upgrade.yml +++ b/.github/workflows/run-checks-gradle-upgrade.yml @@ -30,7 +30,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - java-version: [ '22' ] + java-version: [ '23-ea' ] uses-alt-java: [ true, false ] runs-on: ${{ matrix.os }} @@ -61,7 +61,16 @@ jobs: # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable echo "RUNTIME_JAVA_HOME=${{ env.ALT_JAVA_DIR }}" >> "$GITHUB_ENV" - - run: ./gradlew -p lucene/core check -x test + - name: ./gradlew tidy + run: | + ./gradlew tidy + if [ ! -z "$(git status --porcelain)" ]; then + echo ":warning: **tidy left local checkout in modified state**" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + git status --porcelain >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + git reset --hard && git clean -xfd . + fi - name: ./gradlew regenerate run: | @@ -69,7 +78,7 @@ jobs: sudo apt-get install libwww-perl ./gradlew regenerate -x generateUAX29URLEmailTokenizerInternal --rerun-tasks if [ ! -z "$(git status --porcelain)" ]; then - echo ":warning: **regenerateleft local checkout in modified state**" >> $GITHUB_STEP_SUMMARY + echo ":warning: **regenerate left local checkout in modified state**" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY git status --porcelain >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY @@ -79,8 +88,7 @@ jobs: - run: ./gradlew testOpts - run: ./gradlew helpWorkflow - run: ./gradlew licenses updateLicenses - - run: ./gradlew tidy - - run: ./gradlew check -x test + - run: ./gradlew check -x test -Pvalidation.git.failOnModified=false - run: ./gradlew assembleRelease mavenToLocal # Conserve resources: only run these in non-alt-java mode. diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java index aaf7059bb5f..d084243b2a5 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java @@ -60,8 +60,8 @@ public class WrapperDownloader { public static void checkVersion() { int major = Runtime.version().feature(); - if (major != 21 && major != 22) { - throw new IllegalStateException("java version must be 21 or 22, your version: " + major); + if (major != 21 && major != 22 && major != 23) { + throw new IllegalStateException("java version must be 21, 22 or 23, your version: " + major); } } diff --git a/gradle/documentation/render-javadoc.gradle b/gradle/documentation/render-javadoc.gradle index ddfb68a1b1c..a161fbc24dd 100644 --- a/gradle/documentation/render-javadoc.gradle +++ b/gradle/documentation/render-javadoc.gradle @@ -32,7 +32,7 @@ allprojects { missingdoclet "org.apache.lucene.tools:missing-doclet" } - ext { + project.ext { relativeDocPath = project.path.replaceFirst(/:\w+:/, "").replace(':', '/') } diff --git a/gradle/generation/kuromoji.gradle b/gradle/generation/kuromoji.gradle index cfe2cd559ce..a5aa5fbd604 100644 --- a/gradle/generation/kuromoji.gradle +++ b/gradle/generation/kuromoji.gradle @@ -33,7 +33,7 @@ configure(project(":lucene:analysis:kuromoji")) { apply plugin: deps.plugins.undercouch.download.get().pluginId plugins.withType(JavaPlugin) { - ext { + project.ext { targetDir = file("src/resources") } diff --git a/gradle/generation/nori.gradle b/gradle/generation/nori.gradle index db05babdf03..3a558325964 100644 --- a/gradle/generation/nori.gradle +++ b/gradle/generation/nori.gradle @@ -33,7 +33,7 @@ configure(project(":lucene:analysis:nori")) { apply plugin: deps.plugins.undercouch.download.get().pluginId plugins.withType(JavaPlugin) { - ext { + project.ext { targetDir = file("src/resources") } diff --git a/gradle/testing/beasting.gradle b/gradle/testing/beasting.gradle index 8934100ec10..67c20140ba8 100644 --- a/gradle/testing/beasting.gradle +++ b/gradle/testing/beasting.gradle @@ -27,7 +27,7 @@ def beastingMode = gradle.startParameter.taskNames.any{ name -> name == 'beast' allprojects { plugins.withType(JavaPlugin) { - ext { + project.ext { testOptions += [ [propName: 'tests.dups', value: 0, description: "Reiterate runs of entire test suites ('beast' task)."] ] diff --git a/gradle/testing/profiling.gradle b/gradle/testing/profiling.gradle index 6c71b3f827a..88284fb5454 100644 --- a/gradle/testing/profiling.gradle +++ b/gradle/testing/profiling.gradle @@ -19,7 +19,7 @@ def recordings = files() allprojects { plugins.withType(JavaPlugin) { - ext { + project.ext { testOptions += [ [propName: 'tests.profile', value: false, description: "Enable Java Flight Recorder profiling."] ] diff --git a/gradle/testing/randomization.gradle b/gradle/testing/randomization.gradle index 9ca8625b0ee..670f8ef2689 100644 --- a/gradle/testing/randomization.gradle +++ b/gradle/testing/randomization.gradle @@ -62,7 +62,7 @@ allprojects { // Configure test property defaults and their descriptions. allprojects { plugins.withType(JavaPlugin) { - ext { + project.ext { String randomVectorSize = RandomPicks.randomFrom(new Random(projectSeedLong), ["default", "128", "256", "512"]) testOptions += [ // seed, repetition and amplification. @@ -135,14 +135,14 @@ allprojects { } afterEvaluate { - ext.testOptionsResolved = testOptions.findAll { opt -> + project.ext.testOptionsResolved = testOptions.findAll { opt -> propertyOrDefault(opt.propName, opt.value) != null }.collectEntries { opt -> [(opt.propName): Objects.toString(resolvedTestOption(opt.propName))] } // Compute the "reproduce with" string. - ext.testOptionsForReproduceLine = testOptions.findAll { opt -> + project.ext.testOptionsForReproduceLine = testOptions.findAll { opt -> if (opt["includeInReproLine"] == false) { return false } diff --git a/gradle/testing/slowest-tests-at-end.gradle b/gradle/testing/slowest-tests-at-end.gradle index eaf9cd1a2f1..d24e523394d 100644 --- a/gradle/testing/slowest-tests-at-end.gradle +++ b/gradle/testing/slowest-tests-at-end.gradle @@ -22,7 +22,7 @@ def allSuites = [] allprojects { plugins.withType(JavaPlugin) { - ext { + project.ext { testOptions += [ [propName: 'tests.slowestTests', value: true, description: "Print the summary of the slowest tests."], [propName: 'tests.slowestSuites', value: true, description: "Print the summary of the slowest suites."] diff --git a/gradle/wrapper/gradle-wrapper.jar.sha256 b/gradle/wrapper/gradle-wrapper.jar.sha256 index 2a6b8668ac7..6d5fdcd3f30 100644 --- a/gradle/wrapper/gradle-wrapper.jar.sha256 +++ b/gradle/wrapper/gradle-wrapper.jar.sha256 @@ -1 +1 @@ -cb0da6751c2b753a16ac168bb354870ebb1e162e9083f116729cec9c781156b8 +2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar.version b/gradle/wrapper/gradle-wrapper.jar.version index 3b6825376ad..7f6758ef97b 100644 --- a/gradle/wrapper/gradle-wrapper.jar.version +++ b/gradle/wrapper/gradle-wrapper.jar.version @@ -1 +1 @@ -8.8.0 +8.10.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4413138c96..9355b415575 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index e956c99289f..ae15247ac23 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -266,6 +266,8 @@ Build * GITHUB#13649: Fix eclipse ide settings generation #13649 (Uwe Schindler, Dawid Weiss) +* GITHUB#13698: Upgrade to gradle 8.10 (Dawid Weiss) + ======================== Lucene 9.12.0 ======================= API Changes diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/SandboxFacetsExample.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/SandboxFacetsExample.java index b6759da115b..0655abac131 100644 --- a/lucene/demo/src/java/org/apache/lucene/demo/facet/SandboxFacetsExample.java +++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/SandboxFacetsExample.java @@ -148,9 +148,10 @@ public class SandboxFacetsExample { FacetFieldCollectorManager collectorManager = new FacetFieldCollectorManager<>(defaultTaxoCutter, defaultRecorder); - //// (2.1) if we need to collect data using multiple different collectors, e.g. taxonomy and - //// ranges, or even two taxonomy facets that use different Category List Field, we can - //// use MultiCollectorManager, e.g.: + // (2.1) if we need to collect data using multiple different collectors, e.g. taxonomy and + // ranges, or even two taxonomy facets that use different Category List Field, we can + // use MultiCollectorManager, e.g.: + // // TODO: add a demo for it. // TaxonomyFacetsCutter publishDateCutter = new // TaxonomyFacetsCutter(config.getDimConfig("Publish Date"), taxoReader); diff --git a/lucene/distribution/binary-release.gradle b/lucene/distribution/binary-release.gradle index 5c03ac3a82a..c3365e961ab 100644 --- a/lucene/distribution/binary-release.gradle +++ b/lucene/distribution/binary-release.gradle @@ -37,9 +37,9 @@ configure(project(":lucene:distribution")) { // Maven-published submodule JARs are part of the binary distribution. // We don't copy their transitive dependencies. - def binaryModules = rootProject.ext.mavenProjects.findAll { p -> !(p in [ + def binaryModules = rootProject.ext.mavenProjects.findAll { p -> !(p.path in [ // Placed in a separate folder (module layer conflicts). - project(":lucene:test-framework"), + ":lucene:test-framework", ]) } for (Project module : binaryModules) { jars(module, { diff --git a/versions.toml b/versions.toml index 1a2c52c1f38..c93d1e405c4 100644 --- a/versions.toml +++ b/versions.toml @@ -9,7 +9,7 @@ errorprone = "2.18.0" flexmark = "0.61.24" # @keep This is GJF version for spotless/ tidy. googleJavaFormat = "1.23.0" -groovy = "3.0.21" +groovy = "4.0.22" hamcrest = "2.2" icu4j = "74.2" javacc = "7.0.12" @@ -19,7 +19,7 @@ jmh = "1.37" jts = "1.17.0" junit = "4.13.1" # @keep Minimum gradle version to run the build -minGradle = "8.8" +minGradle = "8.10" # @keep This is the minimum required Java version. minJava = "21" morfologik = "2.1.9" @@ -49,7 +49,7 @@ flexmark-ext-abbreviation = { module = "com.vladsch.flexmark:flexmark-ext-abbrev flexmark-ext-attributes = { module = "com.vladsch.flexmark:flexmark-ext-attributes", version.ref = "flexmark" } flexmark-ext-autolink = { module = "com.vladsch.flexmark:flexmark-ext-autolink", version.ref = "flexmark" } flexmark-ext-tables = { module = "com.vladsch.flexmark:flexmark-ext-tables", version.ref = "flexmark" } -groovy = { module = "org.codehaus.groovy:groovy-all", version.ref = "groovy" } +groovy = { module = "org.apache.groovy:groovy-all", version.ref = "groovy" } hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" } icu4j = { module = "com.ibm.icu:icu4j", version.ref = "icu4j" } javacc = { module = "net.java.dev.javacc:javacc", version.ref = "javacc" }