Skip to content

Instantly share code, notes, and snippets.

@olshevski
Created November 5, 2021 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olshevski/4ca7be0a30be9d9b93fbd83381b52e0d to your computer and use it in GitHub Desktop.
Save olshevski/4ca7be0a30be9d9b93fbd83381b52e0d to your computer and use it in GitHub Desktop.
Example of resolutionStrategy in pluginManagement block
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
resolutionStrategy {
eachPlugin {
when {
requested.id.namespace == "com.android" -> {
useModule("com.android.tools.build:gradle:7.0.3")
}
requested.id.namespace == "org.jetbrains.kotlin" || requested.id.id.startsWith("kotlin-") -> {
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
}
}
}
}
plugins {
id("com.github.ben-manes.versions") version "0.39.0"
}
}
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "Compose Blueprint"
include(":app")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment