with Kotlin DSL build scripts, is there a way to d...
# android
p
with Kotlin DSL build scripts, is there a way to define the dependency version extras separately in top level build.gradle.kts while still keeping the version update available warnings on the module level build.gradle.kts? I noticed i don't get the outdated dependency version warning anymore which worked before converting from Groovy to Kotlin DSL.
Copy code
// root build.gradle.kts
buildscript {
  extra.set("androidxMaterialVersion", "1.1.0-alpha06")
  ...
}

// module/app build.gradle.kts
dependencies {
 implementation("com.google.android.material:material:${rootProject.extra.get("androidxMaterialVersion")}")
}
this above is the implementation i'm using btw. the module implementation does not give a (Android Studio) warning saying there is a new version available, which works if it's Groovy
i
I also miss this. THB Kotlin DSL support is still not that mature (not 100% sure, but I doubt it will work). To check versions of project dependency we can use
gradle-versions-plugin
that provides
./gradlew dependenciesCheck
gradle task Regarding sharing dependencies I would suggest to place them in
buildSrc
(mainly to keep top level grade file shorter and have cleaner syntax for dependency) Take a look at my sample project where both above things are set up https://github.com/igorwojda/Android-Showcase
p
Interesting, I'll be using some of those buildSrc examples too looks good. Thanks!
p
i
@passiondroid I don’t see IDE warning regarding outdated dependencies 🤔