Skip to content

Commit

Permalink
Use Gradle 8 compatible API
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
shemnon committed Apr 8, 2024
1 parent 5ee1640 commit f89c40d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ apply {
}

repositories {
mavenLocal()
maven {
url 'https://plugins.gradle.org/m2/'
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion src/main/java/org/web3j/gradle/plugin/Web3jPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

0 comments on commit f89c40d

Please sign in to comment.