sdkman / sdkman-vendor-gradle-plugin

A plugin for Gradle to allow Vendors to release Candidate Versions on SDKMAN!
Apache License 2.0
14 stars 12 forks source link

Gradle Kotlin Script compatibility #11

Open elect86 opened 4 years ago

elect86 commented 4 years ago

Hi,

how may I convert this for build.gradle.kts?

sdkman {
   api = "https://vendors.sdkman.io/"
   consumerKey = "SOME_KEY"
   consumerToken = "SOME_TOKEN"
   candidate = "grails"
   version = "x.y.z"
   url = "http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-x.y.z.zip"
   hashtag = "#grailsfw"
}
marc0der commented 4 years ago

@elect86 the plugin does has not yet been tested in a kotlin dsl build script. We would probably need to make some changes to get it working as this is plugin is written in Groovy. In the meanwhile, if you do figure it out, please post your results here for the benefit of everyone else.

elect86 commented 4 years ago

Hey Marco,

thanks for the quick reply

I'm trying to give it a refresh, I ported it to kotlin, and now I'm stuck at the tests (which the first is failing because it seems somehow I cant apply the sdkman plugin itself)

Could you give me an hand?

elect86 commented 4 years ago

It's almost complete

the only thing I cant figure it out is this

mpetuska commented 1 year ago

Here's a converted version for build.gradle.kts (in case anyone is still stuck on this). It basically uses gradle's Property<T> API directly without groovy syntactic sugar.

sdkman {
   api.set("https://vendors.sdkman.io/")
   consumerKey.set("SOME_KEY")
   consumerToken.set("SOME_TOKEN")
   candidate.set("grails")
   version.set("x.y.z")
   url.set("http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-x.y.z.zip")
   hashtag.set("#grailsfw")
}