:wave: I’m finishing migrating a “large” project ...
# refreshversions
p
👋 I’m finishing migrating a “large” project to refreshVersions and I’m wondering what’s the best way to add support for libraries I’m using in buildSrc. I’ve seen this website page about just declaring refreshVersion in
buildSrc/settings.gradle.kts
but it just didn’t work, whatever the expected behavior. I ended-up with this file in declaration in `buildSrc/settings.gradle.kts`:
Copy code
val versions = loadProperties(projectDir.resolve("../versions.properties").toString())
dependencies {
    val refVerImpl: (String, String) -> Unit = { artifact, version ->
        implementation("$artifact:${versions["version.$version"]}")
    }
    // ...
    refVerImpl("com.github.triplet.gradle:play-publisher", "com.github.triplet.gradle..play-publisher")
}
and in the root `build.gradle.kts`:
Copy code
@Suppress("GradlePluginVersion") buildscript {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
    dependencies { // Allowing to populate versions.properties with buildSrc dependencies
        classpath("com.android.tools.build:gradle:_")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
        classpath("com.github.triplet.gradle:play-publisher:_")
    }
}
Is there a better alternative approach I could use for buildSrc dependencies?
l
Hello! buildSrc is supported, just add this to your buildSrc's
settings.gradle.kts
file:
Copy code
pluginManagement {
    plugins {
        id("de.fayard.refreshVersions") version "0.10.0"
    }
}

plugins {
    id("de.fayard.refreshVersions")
}
p
What is the expected behavior?
l
If you run refreshVersions in the root project, it'll also handle the dependencies for buildSrc, if it's been setup as shown above.
👍 1