From 90723b96cf3877972af280a35acd15b78bffc6ba Mon Sep 17 00:00:00 2001 From: Adam Valenta Date: Sat, 6 Apr 2024 02:21:32 +0200 Subject: [PATCH] Upgrade to gradle 8.4 --- build.gradle | 2 +- gradle/copyJars.gradle | 10 +++++----- gradle/java.gradle | 2 +- gradle/javaIgnoreSymbolFile.gradle | 2 +- gradle/publish.gradle | 2 +- gradle/ubench.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- h2o-assemblies/genmodel/build.gradle | 2 +- h2o-assemblies/main/build.gradle | 2 +- h2o-assemblies/minimal/build.gradle | 2 +- h2o-assemblies/steam/build.gradle | 2 +- h2o-hadoop-2/assemblyjar.gradle | 4 ++-- h2o-hadoop-3/assemblyjar_common.gradle | 4 ++-- h2o-k8s-comp/build.gradle | 2 +- h2o-py-cloud-extensions/build.gradle | 1 + h2o-py-mlflow-flavor/build.gradle | 1 + 16 files changed, 22 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index 57107b67810f..be9bb55cfaf3 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ buildscript { //noinspection GroovyAssignabilityCheck dependencies { classpath 'org.ow2.asm:asm:5.1' - classpath 'gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0' + classpath 'com.github.johnrengelman:shadow:8.1.1' classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.7.1' classpath 'org.testng:testng:6.8' classpath 'me.champeau.gradle:jmh-gradle-plugin:0.5.2' diff --git a/gradle/copyJars.gradle b/gradle/copyJars.gradle index 47bff3798223..3409b0073ec0 100644 --- a/gradle/copyJars.gradle +++ b/gradle/copyJars.gradle @@ -3,14 +3,14 @@ tasks.withType(Jar) { Jar t -> t.doLast { copy { - from t.archivePath - into t.destinationDir + from t.archiveFile + into t.destinationDirectory // Here we expected standard JAR file archive name: // [baseName]-[appendix]-[version]-[classifier].[extension] - if (t.classifier!=null) { - rename("(.*)-${t.version}(.*)", '$1$2') + if (t.archiveClassifier!=null) { + rename("(.*)-${t.archiveVersion.get()}(.*)", '$1$2') } else { - rename("(.*)${t.version}-?(.*)", '$1$2') + rename("(.*)${t.archiveVersion.get()}-?(.*)", '$1$2') } } } diff --git a/gradle/java.gradle b/gradle/java.gradle index 4e35fff13277..e4b47163d0c3 100644 --- a/gradle/java.gradle +++ b/gradle/java.gradle @@ -11,7 +11,7 @@ compileJava { } task testJar(type: Jar, dependsOn: testClasses, group: "build") { - classifier = 'test' + archiveClassifier.set('test') from sourceSets.test.output } diff --git a/gradle/javaIgnoreSymbolFile.gradle b/gradle/javaIgnoreSymbolFile.gradle index 74c2eb45e35c..1528c27e0ef5 100644 --- a/gradle/javaIgnoreSymbolFile.gradle +++ b/gradle/javaIgnoreSymbolFile.gradle @@ -2,5 +2,5 @@ compileJava { // This only works when forking and passing 'javac' as an executable options.compilerArgs << '-XDignore.symbol.file' options.fork = true - options.forkOptions.executable = 'javac' + options.forkOptions.executable = "${System.properties['java.home']}/../bin/javac" } diff --git a/gradle/publish.gradle b/gradle/publish.gradle index 039ca026c8f5..bdcd66ddd07e 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -4,7 +4,7 @@ apply plugin: 'signing' // Default task to bundle sources code as jar task sourcesJar(type: Jar) { - classifier = 'sources' + archiveClassifier.set('sources') from sourceSets.main.allSource } diff --git a/gradle/ubench.gradle b/gradle/ubench.gradle index 2bfee1e1e848..32b5903cc843 100644 --- a/gradle/ubench.gradle +++ b/gradle/ubench.gradle @@ -76,7 +76,7 @@ task jmhPostProcess(dependsOn: "jmh") { } task jmhFatJar(type: ShadowJar) { - classifier = "jmh" + archiveClassifier.set('jmh') manifest { attributes "Main-Class": "org.openjdk.jmh.Main" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a254e91..48c0a02ca419 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/h2o-assemblies/genmodel/build.gradle b/h2o-assemblies/genmodel/build.gradle index 346e1db6073a..c34aa72c8ca5 100644 --- a/h2o-assemblies/genmodel/build.gradle +++ b/h2o-assemblies/genmodel/build.gradle @@ -35,7 +35,7 @@ for (comp in optionalComponents) { shadowJar { mergeServiceFiles() - classifier = '' + archiveClassifier.set('') relocate 'com.google.gson', 'ai.h2o.com.google.gson' // Should be eventually removed: https://github.com/h2oai/h2o-3/issues/12372 relocate 'org.apache.commons.text', 'ai.h2o.org.apache.commons.text' relocate 'org.apache.commons.lang3', 'ai.h2o.org.apache.commons.lang3' diff --git a/h2o-assemblies/main/build.gradle b/h2o-assemblies/main/build.gradle index 6231736b5867..d836c896f4ad 100644 --- a/h2o-assemblies/main/build.gradle +++ b/h2o-assemblies/main/build.gradle @@ -92,7 +92,7 @@ dependencies { shadowJar { zip64 true mergeServiceFiles() - classifier = '' + archiveClassifier.set('') // CDH 5.3.0 provides joda-time v1.6 which is too old, shadow the library instead if (!project.hasProperty("jacocoCoverage")) { relocate 'org.joda.time', 'ai.h2o.org.joda.time' diff --git a/h2o-assemblies/minimal/build.gradle b/h2o-assemblies/minimal/build.gradle index 2a0fe0b54359..13e522ffe6c6 100644 --- a/h2o-assemblies/minimal/build.gradle +++ b/h2o-assemblies/minimal/build.gradle @@ -33,7 +33,7 @@ dependencies { shadowJar { mergeServiceFiles() - classifier = '' + archiveClassifier.set('') exclude 'META-INF/*.DSA' exclude 'META-INF/*.SF' exclude 'synchronize.properties' diff --git a/h2o-assemblies/steam/build.gradle b/h2o-assemblies/steam/build.gradle index 2f177ecd991b..a3609fdb3d13 100644 --- a/h2o-assemblies/steam/build.gradle +++ b/h2o-assemblies/steam/build.gradle @@ -89,7 +89,7 @@ dependencies { shadowJar { mergeServiceFiles() - classifier = '' + archiveClassifier.set('') exclude 'META-INF/*.DSA' exclude 'META-INF/*.SF' exclude 'synchronize.properties' diff --git a/h2o-hadoop-2/assemblyjar.gradle b/h2o-hadoop-2/assemblyjar.gradle index 6b69dce78b85..d87a359b6ff9 100644 --- a/h2o-hadoop-2/assemblyjar.gradle +++ b/h2o-hadoop-2/assemblyjar.gradle @@ -127,8 +127,8 @@ shadowJar { relocate 'org.apache.http', 'ai.h2o.org.apache.http' exclude hadoopShadowJarExcludes relocate 'com.google.common', 'ai.h2o.com.google.common' - baseName = 'h2odriver' - classifier = '' + archiveBaseName.set('h2odriver') + archiveClassifier.set('') manifest { attributes 'Main-Class': 'water.hadoop.h2odriver' } diff --git a/h2o-hadoop-3/assemblyjar_common.gradle b/h2o-hadoop-3/assemblyjar_common.gradle index ce5b3fc8c039..90f764655d98 100644 --- a/h2o-hadoop-3/assemblyjar_common.gradle +++ b/h2o-hadoop-3/assemblyjar_common.gradle @@ -90,8 +90,8 @@ shadowJar { exclude hadoopShadowJarExcludes relocate 'com.google.common', 'ai.h2o.com.google.common' relocate 'org.eclipse.jetty', 'ai.h2o.org.eclipse.jetty' - baseName = 'h2odriver' - classifier = '' + archiveBaseName.set('h2odriver') + archiveClassifier.set('') manifest { attributes 'Main-Class': 'water.hadoop.h2odriver' } diff --git a/h2o-k8s-comp/build.gradle b/h2o-k8s-comp/build.gradle index c607ff1b3636..6101bd0bdc52 100644 --- a/h2o-k8s-comp/build.gradle +++ b/h2o-k8s-comp/build.gradle @@ -19,7 +19,7 @@ dependencies { shadowJar { mergeServiceFiles() - classifier = '' + archiveClassifier.set('') exclude 'META-INF/*.DSA' exclude 'META-INF/*.SF' exclude 'synchronize.properties' diff --git a/h2o-py-cloud-extensions/build.gradle b/h2o-py-cloud-extensions/build.gradle index 2d4457445e08..b262686fe712 100644 --- a/h2o-py-cloud-extensions/build.gradle +++ b/h2o-py-cloud-extensions/build.gradle @@ -84,5 +84,6 @@ task cleanBuild(type: Delete) { // // Define the dependencies // +jar.dependsOn copySrcFiles clean.dependsOn cleanBuild, cleanUpTestResults build.dependsOn copyMainDist diff --git a/h2o-py-mlflow-flavor/build.gradle b/h2o-py-mlflow-flavor/build.gradle index 1edc3ccab43e..1b9608b908f6 100644 --- a/h2o-py-mlflow-flavor/build.gradle +++ b/h2o-py-mlflow-flavor/build.gradle @@ -59,5 +59,6 @@ task cleanBuild(type: Delete) { // // Define the dependencies // +jar.dependsOn copySrcFiles clean.dependsOn cleanBuild build.dependsOn copyMainDist