Coder Social home page Coder Social logo

Comments (6)

arunkumar9t2 avatar arunkumar9t2 commented on July 22, 2024

Thanks, I understand this is a problem. I gave some background for this in #15. I am still looking for best way to fix this.

As an workaround, please let me know if the below works?

val scabbard = project.extensions.getByName("scabbard") as dev.arunkumar.scabbard.gradle.ScabbardPluginExtension

scabbard.configure(closureOf<ScabbardSpec> {
    // Configure here
    enabled(true)
})

Not the best syntax I know, will continue investigating this. Please let me know if this works, I can update FAQ.

from scabbard.

ZacSweers avatar ZacSweers commented on July 22, 2024

Where is the closureOf() function defined? We're not using Gradle's kotlin-dsl, it's just a gradle plugin written in kotlin.

from scabbard.

ZacSweers avatar ZacSweers commented on July 22, 2024

To be clear - I don't see this function in kotlin-dsl either, but mentioning just in case

from scabbard.

ZacSweers avatar ZacSweers commented on July 22, 2024

Well actually, I see it here now https://gradle.github.io/kotlin-dsl-docs/api/org.gradle.kotlin.dsl/kotlin.-any/closure-of.html. Didn't realize it's an extension function on Any rather than a free type like the sample snippet seemed to suggest (maybe it's implicitly relying on project?)`. Will try out your workaround, though not enthused about it potentially requiring kotlin-dsl :/. Hopefully I can copy their implementation out

from scabbard.

ZacSweers avatar ZacSweers commented on July 22, 2024

That appears to work, so I'll close this out. Wish Gradle would properly document that Configurable class

from scabbard.

arunkumar9t2 avatar arunkumar9t2 commented on July 22, 2024

I think it is added to Any just to prevent it being accessed statically and only as an instance method.

Here is the source for closureOf.

from scabbard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.