Guilherme Delgado
06/21/2022, 3:15 PMbuild.gradle.kts
, but when using build-logic, I can’t share them, it throws org.gradle.internal.exceptions.LocationAwareException
. Surely I’m doing something wrong because Google’s sample uses it with no problem here, but I don’t know what’s missing 😞
Any hint? Thanks 🙏Chris Lee
06/21/2022, 3:25 PMVampire
06/21/2022, 3:43 PMbuildscript { dependencies { ... } }
block.Vampire
06/21/2022, 3:45 PMbuild-logic
that you want to use in some build script without a plugin form build-logic
being applied there (or just the no-op plugin), you are maybe doing something wrong, especially if you want to be idiomatic.Guilherme Delgado
06/21/2022, 3:46 PMVampire
06/21/2022, 3:46 PMVampire
06/21/2022, 3:46 PMbuidSrc
nor build-logic
is the tool of choice for that, but use a version catalog instead.Guilherme Delgado
06/21/2022, 3:47 PMGuilherme Delgado
06/21/2022, 3:48 PMVampire
06/21/2022, 3:48 PMbuildscript
block.Guilherme Delgado
06/21/2022, 3:49 PMGuilherme Delgado
06/22/2022, 10:20 AMnuhkoca
06/29/2022, 12:20 AMGuilherme Delgado
06/29/2022, 8:35 AMGuilherme Delgado
06/29/2022, 8:35 AMGuilherme Delgado
06/29/2022, 8:36 AMGuilherme Delgado
06/29/2022, 8:36 AMnuhkoca
06/29/2022, 10:22 AMBuildConfigField
to other Gradle
scripts to use it. Do you have such scenario?Guilherme Delgado
06/29/2022, 11:04 AMBuildConfigField
” but i do have extension functions shared across gradle scripts, example:
internal fun Project.addComposeDependencies(libs: VersionCatalog) {
dependencies {
add("implementation", libs.findBundle("androidx.compose").get())
add("implementation", libs.findBundle("accompanist").get())
add("implementation", libs.findLibrary("helpers.coil").get())
}
}
class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.android.library")
val versionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")
...
addComposeDependencies(versionCatalog)
}
}
}
and I import it too in the “ApplicationConventionPlugin”Vampire
06/29/2022, 11:26 AM