Skip to content

Commit ee41003

Browse files
committed
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.
1 parent 5ee1640 commit ee41003

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ protected File buildOutputDir(final SourceSet sourceSet) {
184184
final SoliditySourceSet soliditySourceSet =
185185
(SoliditySourceSet) convention.getPlugins().get(SoliditySourceSet.NAME);
186186

187-
return soliditySourceSet.getSolidity().getOutputDir();
187+
try {
188+
return soliditySourceSet.getSolidity().getDestinationDirectory().getAsFile().get();
189+
} catch (NoSuchMethodError ignored) {
190+
//TODO delete this catch block and unwrap the try block after Gradle 8 migration
191+
return soliditySourceSet.getSolidity().getOutputDir();
192+
}
188193
}
189194
}

0 commit comments

Comments
 (0)