Zac Sweers
03/21/2023, 5:07 AMVampire
03/21/2023, 8:49 AMmbonnin
03/21/2023, 8:50 AMval foo by getting
and String.invoke()
. The main problem is that a lot of the snippets are written for Groovycreate("foo")
better than val foo by creating {}
and Kotlin has its own syntax for DSL too. In theory it doesn't need to map the Groovy syntaxPaul Woitaschek
03/21/2023, 9:30 AM@Suppress("UNUSED")
before the latter statement :trollface:Vampire
03/21/2023, 10:59 AMKotlin build scripts are not ugly without the val foo by getting and String.invoke() .
Neither of them is what I mentioned. I said type safe accessors. The ones to get task providers and configure extensions
eygraber
03/21/2023, 11:46 AMZac Sweers
03/21/2023, 1:23 PMeygraber
03/21/2023, 1:49 PMproperty.set(value)
though š¤Javier
03/21/2023, 2:02 PMkotlin-dsl
or kotlin("jvm")
+ java-gradle-plugin
mbonnin
03/21/2023, 2:07 PMa special compiler plugin can do some magic by adding wrappers by default under the hoodThat doesn't sound like going in the direction of sreamlining things š
var
. It's not like I will run a huge computation to get itJavier
03/21/2023, 2:09 PMval foo: Provider<Foo>
with val foo: Foo
and val foo: Property<Foo>
with var foo: Foo
. But if it was possible, that would be the right direction for surembonnin
03/21/2023, 2:10 PMGradle Kotlin != Other Kotlin
is the main pain as far as I'm concerned.breandan
03/21/2023, 3:00 PMvar foo = Foo
with a custom setter that acts like a lazy property configuration, e.g., set(value) { lazyConfig(*field*) }
? Why was setFoo(...)
ever necessary in the first place?Zac Sweers
03/21/2023, 3:35 PMJavier
03/21/2023, 4:04 PMbreandan
03/21/2023, 4:04 PMJavier
03/21/2023, 4:05 PMfoo.set(...)
, indeed you are still doing that, but with the compiler plugin, under the hood.
Anyone know if there are public docs about if it was possible to create a design without wrappers and it was discarded?val foo: Provider<Int> = provider { bar.get() + baz.get() } // works
val foo: Provider<Int> = provider { bar + baz } // doesn't work
Vampire
03/21/2023, 11:51 PMval foo = bar.zip(baz) { x, y -> x + y }
cristiangm
03/30/2023, 7:36 AMmyTask.minSdk.set( provider { androidExtention.minSdk })
mbonnin
03/30/2023, 7:58 AMcristiangm
03/30/2023, 7:59 AM.set
or =
seems controversial enough, and kind of subjective or a matter of taste (basically I don't want to have an opinion š )