Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 8 compatability #67

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package org.web3j.solidity.gradle.plugin
import groovy.transform.CompileStatic
import org.gradle.api.Action
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.file.SourceDirectorySetFactory
import org.gradle.api.model.ObjectFactory
import org.gradle.api.reflect.HasPublicType
import org.gradle.api.reflect.TypeOf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ class SolidityPlugin implements Plugin<Project> {
def defaultOutputDir = new File(project.buildDir, "resources/$sourceSet.name/$NAME")

soliditySourceSet.solidity.srcDir(defaultSrcDir)
soliditySourceSet.solidity.outputDir = defaultOutputDir
try {
soliditySourceSet.solidity.destinationDirectory = defaultOutputDir
} catch (ReadOnlyPropertyException ignored) {
//TODO delete this catch block and unwrap the try block after Gradle 8 migration
soliditySourceSet.solidity.outputDir = defaultOutputDir
}

sourceSet.allJava.source(soliditySourceSet.solidity)
sourceSet.allSource.source(soliditySourceSet.solidity)
Expand Down Expand Up @@ -122,7 +127,7 @@ class SolidityPlugin implements Plugin<Project> {
compileTask.evmVersion = project.solidity.evmVersion
compileTask.allowPaths = project.solidity.allowPaths
compileTask.ignoreMissing = project.solidity.ignoreMissing
compileTask.outputs.dir(soliditySourceSet.solidity.outputDir)
compileTask.outputs.dir(soliditySourceSet.solidity.destinationDirectory)
compileTask.description = "Compiles $sourceSet.name Solidity source."

if (project.solidity.resolvePackages) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ class SolidityPluginTest {
}
}
}
tasks.named("jar").configure { dependsOn("compileSolidity") }
"""

def success = build()
Expand Down
Loading