From f89c40d30e6d17cfb1e6c2d7e87a56e148a4acbe Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Sun, 7 Apr 2024 20:47:57 -0600 Subject: [PATCH 1/3] Use Gradle 8 compatible API In Web3JGradle plugin replace an API that was removed in Gradle 8 with a Gradle 8 API and an appropriate fallback. Signed-off-by: Danno Ferrin --- build.gradle | 1 + gradle.properties | 2 +- src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 9a2566f..2967aef 100644 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,7 @@ apply { } repositories { + mavenLocal() maven { url 'https://plugins.gradle.org/m2/' } diff --git a/gradle.properties b/gradle.properties index c9dba91..f4fe501 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,6 @@ group=org.web3j version=4.11.2 org.gradle.caching=true org.gradle.parallel=true -solidityPluginVersion=0.4.0 +solidityPluginVersion=0.4.1-SNAPSHOT kotlinVersion=1.8.10 junitVersion=4.12 diff --git a/src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java b/src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java index 964f53c..cdfaaa4 100644 --- a/src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java +++ b/src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java @@ -184,6 +184,11 @@ protected File buildOutputDir(final SourceSet sourceSet) { final SoliditySourceSet soliditySourceSet = (SoliditySourceSet) convention.getPlugins().get(SoliditySourceSet.NAME); - return soliditySourceSet.getSolidity().getOutputDir(); + try { + return soliditySourceSet.getSolidity().getDestinationDirectory().getAsFile().get(); + } catch (NoSuchMethodError ignored) { + //TODO delete this catch block and unwrap the try block after Gradle 8 migration + return soliditySourceSet.getSolidity().getOutputDir(); + } } } From ebaa5982e2d30bd4191b3cbc24f65136fedad1c7 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Tue, 9 Apr 2024 13:47:30 -0600 Subject: [PATCH 2/3] review comments Signed-off-by: Danno Ferrin --- gradle.properties | 2 +- src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index f4fe501..c9dba91 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,6 @@ group=org.web3j version=4.11.2 org.gradle.caching=true org.gradle.parallel=true -solidityPluginVersion=0.4.1-SNAPSHOT +solidityPluginVersion=0.4.0 kotlinVersion=1.8.10 junitVersion=4.12 diff --git a/src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java b/src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java index cdfaaa4..bb2d34d 100644 --- a/src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java +++ b/src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java @@ -187,7 +187,7 @@ protected File buildOutputDir(final SourceSet sourceSet) { try { return soliditySourceSet.getSolidity().getDestinationDirectory().getAsFile().get(); } catch (NoSuchMethodError ignored) { - //TODO delete this catch block and unwrap the try block after Gradle 8 migration + // TODO delete this catch block and unwrap the try block after Gradle 8 migration return soliditySourceSet.getSolidity().getOutputDir(); } } From 8e6726aef46a97237e0fba16ddc9a22dd8185899 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Tue, 9 Apr 2024 13:48:16 -0600 Subject: [PATCH 3/3] remove dev setup Signed-off-by: Danno Ferrin --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2967aef..9a2566f 100644 --- a/build.gradle +++ b/build.gradle @@ -36,7 +36,6 @@ apply { } repositories { - mavenLocal() maven { url 'https://plugins.gradle.org/m2/' }