Christian Sciberras
11/19/2023, 6:52 PMDaniel Pitts
11/19/2023, 7:19 PMDaniel Pitts
11/19/2023, 7:21 PMDaniel Pitts
11/19/2023, 7:21 PMChristian Sciberras
11/19/2023, 7:22 PMDaniel Pitts
11/19/2023, 7:23 PMChristian Sciberras
11/19/2023, 7:23 PMDaniel Pitts
11/19/2023, 7:26 PMDaniel Pitts
11/19/2023, 7:27 PMChristian Sciberras
11/19/2023, 7:28 PMDaniel Pitts
11/19/2023, 7:29 PMDaniel Pitts
11/19/2023, 7:30 PMChristian Sciberras
11/19/2023, 7:30 PMDaniel Pitts
11/19/2023, 7:32 PMChristian Sciberras
11/19/2023, 7:32 PMDaniel Pitts
11/19/2023, 7:32 PMChristian Sciberras
11/19/2023, 7:33 PMDaniel Pitts
11/19/2023, 7:35 PMDaniel Pitts
11/19/2023, 7:35 PMDaniel Pitts
11/19/2023, 7:36 PMChristian Sciberras
11/19/2023, 7:36 PMChristian Sciberras
11/19/2023, 7:36 PM@Serialization
annotation would be resolved/highlighted properly (from IDE, at least), but mySerializableClass.serializer()
wouldn't be.Daniel Pitts
11/19/2023, 7:37 PMDaniel Pitts
11/19/2023, 7:37 PMChristian Sciberras
11/19/2023, 7:38 PMChristian Sciberras
11/19/2023, 7:38 PMDaniel Pitts
11/19/2023, 7:38 PMDaniel Pitts
11/19/2023, 7:39 PMChristian Sciberras
11/19/2023, 7:41 PMDaniel Pitts
11/19/2023, 7:41 PMDaniel Pitts
11/19/2023, 7:42 PMDaniel Pitts
11/19/2023, 7:43 PMDaniel Pitts
11/19/2023, 7:43 PMChristian Sciberras
11/19/2023, 7:44 PMDaniel Pitts
11/19/2023, 7:45 PMDaniel Pitts
11/19/2023, 7:46 PMChristian Sciberras
11/19/2023, 7:47 PMDaniel Pitts
11/19/2023, 7:48 PMChristian Sciberras
11/19/2023, 7:48 PMChristian Sciberras
11/19/2023, 7:49 PMDaniel Pitts
11/19/2023, 7:49 PMChristian Sciberras
11/19/2023, 7:50 PMChristian Sciberras
11/19/2023, 7:50 PMChristian Sciberras
11/19/2023, 7:51 PMDaniel Pitts
11/19/2023, 7:51 PMChristian Sciberras
11/19/2023, 7:52 PMDaniel Pitts
11/19/2023, 7:53 PMChristian Sciberras
11/19/2023, 7:53 PMDaniel Pitts
11/19/2023, 7:55 PMChristian Sciberras
11/19/2023, 7:55 PMmartmists
11/19/2023, 8:01 PMChristian Sciberras
11/19/2023, 8:05 PMVampire
11/19/2023, 8:17 PMhfhbd
11/19/2023, 8:19 PMalias
) and add the json library as dependency in commonMain. That's it. You can remove the other unrelated two entries in you libs.toml file.Christian Sciberras
11/19/2023, 8:20 PMChristian Sciberras
11/19/2023, 8:22 PMhfhbd
11/19/2023, 8:26 PMChristian Sciberras
11/19/2023, 8:29 PMChristian Sciberras
11/19/2023, 8:31 PMhfhbd
11/19/2023, 8:42 PMChristian Sciberras
11/19/2023, 8:53 PM{ devPackages: <..>, buildPackages: <..>, tasks: <..>, everythingElseHereIsInvalid }
In other words and following the arguments above, I could answer any question regarding Composer (php) not because I know every package possible, but because of convention and knowing the basics. In Gradle, this seems to depend on the package (plugin/dependency) in question and not just knowing gradle.Christian Sciberras
11/19/2023, 8:53 PMhfhbd
11/19/2023, 9:06 PMChristian Sciberras
11/19/2023, 9:37 PMpackage.json
(or composer.json
) to a beginner, and they can tell you what it mostly means (and they'll be most probably right).
Show them a simple gradle.build.kts
and they'll be wrong at best, and completely clueless at worse.
I know, 'coz I just tried that on myself. 😂Daniel Pitts
11/19/2023, 10:37 PMVampire
11/19/2023, 10:40 PMeygraber
11/20/2023, 1:16 AMPablichjenkov
11/20/2023, 1:48 AMChristian Sciberras
11/20/2023, 4:49 PMThen it probably was not a "simple" or even idiomatic one.
Idiomatic Gradle build scripts are declarative.I checked the root build script for a KMP project, it looks like so:
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
id("com.louiscad.complete-kotlin") version "1.1.0"
}
So yeah, relatively simple script. However, assuming the reader already knows about plugins, there's still:
• it's not obvious what the comment is directed it - what is "this" in that context?
• why alias()?
• why apply false? how is that idiomatic?
• why id()?
• PS: ctrl-clicking into any of that pulls up the decompiler (to be fair, auto-completion does show some good documentation)
Anyway, I don't need answers to that, just wanted to point it out.Vampire
11/20/2023, 4:56 PMapply false
lines is one option to mitigate the problem that is fixed by it, but it could also be done differently in a more read-friendly way.
That ctrl+click
is not yet leading to the actual version catalog entry is just a missing feature in the IDE that is hopefully coming at some point in time.
That some plugins are coming from version catalog and use alias
while one plugin is applied directly by ID instead of version catalog, again is due the build author writing it that way instead of having all in the version catalog.
So yes, this build could of course be written differently to maybe be more beginner-read-friendly. 🙂