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 (branch 9x, backport of #13700) #13729

Merged
merged 4 commits into from
Sep 6, 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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ configurations {

dependencies {
// Use a newer groovy that doesn't have illegal reflective accesses.
groovy "org.codehaus.groovy:groovy-all:3.0.21"
groovy "org.apache.groovy:groovy-all:4.0.22"
}

apply from: file('buildSrc/scriptDepVersions.gradle')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public static void main(String[] args) {

public static void checkVersion() {
int major = Runtime.getRuntime().version().feature();
if (major < 11 || major > 22) {
throw new IllegalStateException("java version must be between 17 and 22, your version: " + major);
if (major < 11 || major > 23) {
throw new IllegalStateException("java version must be between 17 and 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 @@ -34,7 +34,7 @@ allprojects {
missingdoclet "org.apache.lucene.tools:missing-doclet"
}

ext {
project.ext {
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: "de.undercouch.download"

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: "de.undercouch.download"

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 @@ -124,14 +124,14 @@ allprojects {
allprojects {
plugins.withType(JavaPlugin) {
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/validation/check-environment.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.gradle.util.GradleVersion

configure(rootProject) {
ext {
expectedGradleVersion = '8.8'
expectedGradleVersion = '8.10'
hasJavaFlightRecorder = ModuleLayer.boot().findModule('jdk.jfr').map(this.class.module::canRead).orElse(false)
}

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
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,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