Skip to content

Commit

Permalink
Gradle: Only query google repository for Android dependencies
Browse files Browse the repository at this point in the history
Avoid leaking all other used dependencies to Google servers and speed
up dependency resolution. Enforce using repositories from
`settings.gradle.kts` only.
  • Loading branch information
saschpe committed Jun 12, 2024
1 parent 556bf9b commit c507104
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
@file:Suppress("UnstableApiUsage")

pluginManagement {
repositories {
gradlePluginPortal()
google()
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
}

plugins {
Expand All @@ -12,10 +20,16 @@ pluginManagement {
}

dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
mavenCentral()
google()
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
}
}

Expand Down

0 comments on commit c507104

Please sign in to comment.