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

Could not set unknown property 'outputDir' for Main Solidity Sources of type org.gradle.api.internal.file.DefaultSourceDirectorySet. #2043

Closed
iirekm opened this issue Apr 18, 2024 · 4 comments · Fixed by #2051 or #2057
Labels
bug A bug in behaviour or functionality

Comments

@iirekm
Copy link

iirekm commented Apr 18, 2024

I'm getting

> Failed to apply plugin class 'org.web3j.solidity.gradle.plugin.SolidityPlugin'.
   > Could not set unknown property 'outputDir' for Main Solidity Sources of type org.gradle.api.internal.file.DefaultSourceDirectorySet.

The code:

buildscript {
    repositories {
        maven("https://artifacts.consensys.net/public/maven/maven/")
    }
}

plugins {
    kotlin("jvm") version "1.9.23"
    id("org.web3j") version "4.11.2"
}

Tested Gradle versions: 8.4, 8.7

@iirekm iirekm added the bug A bug in behaviour or functionality label Apr 18, 2024
@iirekm
Copy link
Author

iirekm commented Apr 18, 2024

Workaround competitive plugin id("io.github.ehdrbs0318.lazy3j") version "1.0.4" seems to work

@AlexOreshkevich
Copy link

Same here:

An exception occurred applying plugin request [id: 'org.web3j', version: '4.11.3']
> Failed to apply plugin class 'org.web3j.solidity.gradle.plugin.SolidityPlugin'.
   > Could not set unknown property 'outputDir' for Main Solidity Sources of type org.gradle.api.internal.file.DefaultSourceDirectorySet.

gradle 8.7, java 17

@bradbown
Copy link
Contributor

bradbown commented May 3, 2024

Looks to be an issue when using a gradle version >= 8.0

Quote from https://docs.gradle.org/7.6/javadoc/org/gradle/api/file/SourceDirectorySet.html#setOutputDir:

setOutputDir
@deprecated
void setOutputDir​(Provider<java.io.File> provider)
Deprecated.
Use getDestinationDirectory().set() instead. This method will be removed in Gradle 8.0.
Sets the provider that gives the directory to assemble the compiled classes into.
Parameters:
provider - provides output directory for this source directory set
Since:
4.0

@bradbown bradbown mentioned this issue May 7, 2024
3 tasks
@NickSneo
Copy link
Contributor

Same here:

An exception occurred applying plugin request [id: 'org.web3j', version: '4.11.3']
> Failed to apply plugin class 'org.web3j.solidity.gradle.plugin.SolidityPlugin'.
   > Could not set unknown property 'outputDir' for Main Solidity Sources of type org.gradle.api.internal.file.DefaultSourceDirectorySet.

gradle 8.7, java 17

Yes it is due to incompatibility with gradle version >=8.5.
We are working on updating all web3j repos to gradle 8.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in behaviour or functionality
Projects
None yet
4 participants