From ee4100337ac00b8dbbcd71de7f90e64ea6b92276 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Sun, 7 Apr 2024 20:47:57 -0600 Subject: [PATCH] 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. --- src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); + } } }