Slackbot
01/25/2024, 12:26 PMVampire
01/25/2024, 12:30 PMVampire
01/25/2024, 12:30 PMVampire
01/25/2024, 12:31 PMVampire
01/25/2024, 12:32 PMLilly
01/25/2024, 12:46 PMval libs: VersionCatalog = versionCatalogs.named("libs") in all scripts.Vampire
01/25/2024, 12:51 PMVampire
01/25/2024, 12:51 PMplugins { ... } block.Vampire
01/25/2024, 12:52 PMVampire
01/25/2024, 12:53 PMplugins { ... } block of that script, as the pure presence of the accessor is already a guarantee, that the configuration you try to use there is present at runtime.Vampire
01/25/2024, 12:53 PMVampire
01/25/2024, 12:54 PMimplementation(platform(it)) by "implementation"(platform(it))Vampire
01/25/2024, 12:55 PMval implementation by configurations, that would also work but also not have the "it exists" compile-time guarantee, but fail at runtime if it does not.Vampire
01/25/2024, 12:56 PMLilly
01/25/2024, 1:00 PMVampire
01/25/2024, 1:02 PMimplementation but not debugImplementation I guess.Lilly
01/25/2024, 1:09 PMimplementation ?Vampire
01/25/2024, 1:33 PMVampire
01/25/2024, 1:34 PMkotlin("android") is fine.Vampire
01/25/2024, 1:34 PMimplementation and debugImplementationLilly
01/25/2024, 1:47 PMYou should apply that plugin that does do register those configurations that are then also used. Applying any plugin just because it adds that configuration, then you can also just use "solution 3".Makes sense. Solution 3 is clean. I like it and it works
Vampire
01/25/2024, 1:48 PMkotlin("android") is sufficient.
But whatever works for youVampire
01/25/2024, 1:48 PMLilly
01/25/2024, 1:57 PMVampire
01/25/2024, 1:58 PMVampire
01/25/2024, 1:58 PMLilly
01/25/2024, 1:58 PMVampire
01/25/2024, 1:58 PMLilly
01/25/2024, 2:00 PMconfiguration-plugin/src/main/kotlin/de/test/configuration/compose-deps.gradle.kts1149 Unresolved reference: implementation
Vampire
01/25/2024, 2:01 PMLilly
01/25/2024, 2:04 PMVampire
01/25/2024, 2:05 PMLilly
01/25/2024, 3:06 PMVampire
01/25/2024, 4:27 PMkotlin("android") is of course useless.
But to apply it I had to apply one of the android plugins or it fails.
And those are adding these configurations, so you would need to apply one of the Android pluginsVampire
01/25/2024, 4:55 PMpackage de.test.configuration
val libs: VersionCatalog = versionCatalogs.named("libs")
listOf(
"com.android.application",
"com.android.library"
).forEach {
pluginManager.withPlugin(it) {
val implementation by configurations
val debugImplementation by configurations
dependencies {
libs.findLibrary("compose-bom").ifPresent { implementation(platform(it)) }
libs.findLibrary("core-ktx").ifPresent { implementation(it) }
libs.findLibrary("coroutines-android").ifPresent { implementation(it) }
libs.findBundle("compose").ifPresent { implementation(it) }
libs.findLibrary("compose-ui-tooling-core").ifPresent { debugImplementation(it) }
libs.findLibrary("compose-ui-test-manifest").ifPresent { debugImplementation(it) }
}
}
}Lilly
01/25/2024, 5:29 PMval implementation by configurations
val debugImplementation by configurations
dependencies {
libs.findLibrary("compose-bom").ifPresent { implementation(platform(it)) }
libs.findLibrary("core-ktx").ifPresent { implementation(it) }
libs.findLibrary("coroutines-android").ifPresent { implementation(it) }
libs.findBundle("compose").ifPresent { implementation(it) }
libs.findLibrary("compose-ui-tooling-core").ifPresent { debugImplementation(it) }
libs.findLibrary("compose-ui-test-manifest").ifPresent { debugImplementation(it) }
}Vampire
01/25/2024, 5:29 PMVampire
01/25/2024, 5:30 PMLilly
01/25/2024, 5:30 PMVampire
01/25/2024, 5:31 PMLilly
01/25/2024, 6:29 PMLilly
01/25/2024, 6:29 PM