Skip to content

Commit f89c40d

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. Signed-off-by: Danno Ferrin <[email protected]>
1 parent 5ee1640 commit f89c40d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ apply {
3636
}
3737

3838
repositories {
39+
mavenLocal()
3940
maven {
4041
url 'https://plugins.gradle.org/m2/'
4142
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ group=org.web3j
22
version=4.11.2
33
org.gradle.caching=true
44
org.gradle.parallel=true
5-
solidityPluginVersion=0.4.0
5+
solidityPluginVersion=0.4.1-SNAPSHOT
66
kotlinVersion=1.8.10
77
junitVersion=4.12

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)