Closed thomasflad closed 11 months ago
Hello @thomasflad! Thanks for reporting this issue, indeed variants
property configuration is not compatible with Kotlin DSL.
When using Groovy, it is capable to doing some conversions thanks to the meta-programming capabilites.
Kotlin DSL on another hand is statically typed, so some things should be more explicit. For the moment, the example you posted will look like following in Kotlin DSL:
datadog {
site = "US"
withGroovyBuilder {
"variants" {
"create"("fr") {
setProperty("site", "EU")
setProperty("mappingFilePath", "path/to/fr/mapping.txt")
}
}
}
}
Here I used withGroovyBuilder which may not look nice, but at least does the job. Alternatively you can write configuration in Groovy and apply it using dynamic-groovy-plugin.
In the meantime we will do the necessary changes to be compatible with Kotlin DSL for variants
property and will try to ship the fix soon.
Hi DataDog Team,
I'm struggling with setting up a configuration per variant in a Kotlin Script Gradle file. Can you provide an example how it should look like?