Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to gradle 8.10 #13700

Merged
merged 14 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/run-checks-gradle-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -61,15 +61,24 @@ 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: |
# add this package for generateEmojiTokenizationTestChecksumLoad.
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
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static void main(String[] args) {

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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/documentation/render-javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ allprojects {
missingdoclet "org.apache.lucene.tools:missing-doclet"
}

ext {
project.ext {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. it's odd that we have to do this, but I see that it's now necessary (why Gradle.. why!? ). This is reason that my previous local attempt to upgrade failed. Good that you have a fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something within the scope changed and either groovy or gradle looks up a different 'ext' (extension) property now. I didn't bother trying to narrow it down but it is ugly.

relativeDocPath = project.path.replaceFirst(/:\w+:/, "").replace(':', '/')
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/generation/kuromoji.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/generation/nori.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/testing/beasting.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)."]
]
Expand Down
2 changes: 1 addition & 1 deletion gradle/testing/profiling.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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."]
]
Expand Down
6 changes: 3 additions & 3 deletions gradle/testing/randomization.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/testing/slowest-tests-at-end.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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."]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.jar.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cb0da6751c2b753a16ac168bb354870ebb1e162e9083f116729cec9c781156b8
2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.jar.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.8.0
8.10.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ List<FacetResult> facetsOnly() throws IOException {
FacetFieldCollectorManager<CountFacetRecorder> 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);
Expand Down
4 changes: 2 additions & 2 deletions lucene/distribution/binary-release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
6 changes: 3 additions & 3 deletions versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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" }
Expand Down