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