Is there a way to declare refreshVersions usings p...
# refreshversions
h
Is there a way to declare refreshVersions usings plugins block and not adding buildscript block?
l
Right now, it's not possible. If you find that it's possible to have a
Plugin<Settings>
setup a
pluginManagement { ... }
, then I mihht be able to support it, but I find the current setup good enough, and it now supports self-updates discovery.
h
Can i swap the buildscript part to be in resolutionStrategy block where i will specify the classpath url?
l
@Harun Why do you want that?
h
I wanted to add refreshVersions on a project i was working on. This is the settings.gradle.kts file.
Copy code
pluginManagement {
    repositories {
        jcenter()
        google()
        gradlePluginPortal()
        maven("<https://dl.bintray.com/kotlin/kotlin-eap>")
    }

    plugins {
        id("com.android.application") version "4.0.1"
        id("org.jetbrains.kotlin.android") version "1.3.72"
        id("org.jetbrains.kotlin.android.extensions") version "1.3.72"
        id("com.android.library") version "4.0.1"
        id("com.google.firebase.crashlytics") version "2.1.0"
    }

    resolutionStrategy {
        eachPlugin {
            when (requested.id.id) {
                "com.android.application", "com.android.library" -> useModule("com.android.tools.build:gradle:4.0.1")
                "com.google.firebase.crashlytics" -> useModule("com.google.firebase:firebase-crashlytics-gradle:2.1.0")
            }
        }
    }
}
So that's why i wanted to do something similar to what i currently have that's why i was asking
l
@Harun With refreshVersions, you don't need all of that. I'll make a new Android sample to show how to do it for the crashlytics plugin, using the Firebase BoM.
h
Nice thank you for the clarification, I was trying to add it to my existing setup and got stuck there. Thank you for your answer. Will be waiting for the Android sample