Slackbot
08/06/2023, 8:33 AMephemient
08/07/2023, 12:58 AMephemient
08/07/2023, 12:59 AMMartin
08/07/2023, 7:28 AMbuild.gradle vs build.gradke.kts thingMartin
08/07/2023, 7:28 AMKengo TODA
08/07/2023, 7:30 AMKengo TODA
08/07/2023, 7:31 AMI would expect the plugin language to be irrelevant here and this to be asad to say but plugin language matters...vsbuild.gradlethingbuild.gradke.kts
Adam
08/07/2023, 8:58 AMfun Property<Values>.assign(value: String) {
set(Values.valueOf(value))
}Kengo TODA
08/07/2023, 9:02 AMKengo TODA
08/07/2023, 9:02 AMAdam
08/07/2023, 9:04 AMProperty<> interface has an annotation so assignment overloading is available.Adam
08/07/2023, 9:07 AMProperty<Enum<>> properties from all other plugins, which will probably cause issues
inline fun <reified T: Enum<T>>Property<T>.assign(value: String) {
val enumValue = enumValueOf<T>(value)
set(enumValue)
}Kengo TODA
08/07/2023, 9:21 AMKengo TODA
08/07/2023, 9:21 AMMartin
08/07/2023, 9:34 AMsad to say but plugin language mattersI don't think it does? At the end of the day, a plugin is a .jar file with a
Property<Values> field. Whether that plugin is written in Groovy or Java or Kotlin, the bytecode is the sameMartin
08/07/2023, 9:34 AMplugin.jar bytecode to "help" the Kotlin consumers (build.gradle.kts )Martin
08/07/2023, 9:36 AMbuild.gradle vs build.gradle.kts usagesMartin
08/07/2023, 9:37 AMfun foo(action: Action<T>) . You could define overloaded fun foo(action: (T) -> Unit) but I find it's adding noise to the API. Which function are you now calling?Martin
08/07/2023, 9:39 AMMartin
08/07/2023, 9:39 AM