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

downloadClient: Cannot cast object 'true' with class 'Boolean' to class 'Property' #73

Closed
wingsofovnia opened this issue Sep 18, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@wingsofovnia
Copy link

wingsofovnia commented Sep 18, 2020

I am trying to enable client downloading as per docs:

// build.gradle
helm {
    downloadClient {
        enabled = true
        version = '3.2.0'
    }
}

However, this is what I get on Gradle 6.6:

Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'true' with class 'java.lang.Boolean' to class 'org.gradle.api.provider.Property'

However, Kotlin syntax works:

helm {
    downloadClient {
        enabled.set(true)
        version.set("3.2.0")
    }
}

It is strange because it seems other closures don't have this problem:

helm {
    downloadClient {
        enabled.set(true)
        version.set("3.2.0")
    }
    // works as expected
    lint {
        strict = true
    }
}
@tkrullmann
Copy link
Member

Interesting. One difference is that many of the other blocks are instantiated by ObjectFactory.newInstance, while the downloadClient is just a POJO owned by the HelmExtension directly. I always thought the Groovy syntactic sugar for setting properties was something that Gradle makes generally available, not just for objects instantiated via ObjectFactory. Will investigate!

@tkrullmann tkrullmann added the bug Something isn't working label Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants