Skip to content

Commit 741721c

Browse files
committed
refactor: add plugin management and dependency resolution management to settings.gradle.kts
1 parent f86190a commit 741721c

2 files changed

Lines changed: 37 additions & 16 deletions

File tree

build.gradle.kts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
33
// Top-level build file where you can add configuration options common to all sub-projects/modules.
44
buildscript {
55

6-
repositories {
7-
google()
8-
mavenCentral()
9-
gradlePluginPortal()
10-
}
11-
126
dependencies {
137
// https://developer.android.com/build/migrate-to-catalogs#migrate-dependencies
148
classpath(libs.android.tools.build.gradle)
@@ -26,16 +20,6 @@ plugins {
2620
alias(libs.plugins.ksp) apply false
2721
}
2822

29-
30-
allprojects {
31-
repositories {
32-
google()
33-
maven { url = uri("https://repo1.maven.org/maven2") }
34-
maven { url = uri("https://jitpack.io") }
35-
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
36-
}
37-
}
38-
3923
subprojects {
4024
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
4125
compilerOptions {

settings.gradle.kts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
pluginManagement {
2+
repositories {
3+
google {
4+
content {
5+
includeGroupByRegex("androidx\\..*")
6+
includeGroupByRegex("com\\.android(\\..*|)")
7+
includeGroupByRegex("com\\.google\\.android\\..*")
8+
includeGroupByRegex("com\\.google\\.testing\\.platform")
9+
}
10+
mavenContent {
11+
releasesOnly()
12+
}
13+
}
14+
mavenCentral()
15+
gradlePluginPortal()
16+
17+
}
18+
}
19+
dependencyResolutionManagement {
20+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
21+
repositories {
22+
google {
23+
content {
24+
includeGroupByRegex("androidx\\..*")
25+
includeGroupByRegex("com\\.android(\\..*|)")
26+
includeGroupByRegex("com\\.google\\.android\\..*")
27+
includeGroupByRegex("com\\.google\\.testing\\.platform")
28+
}
29+
mavenContent {
30+
releasesOnly()
31+
}
32+
}
33+
// fallback for the rest of the dependencies
34+
mavenCentral()
35+
maven { url = uri("https://jitpack.io") }
36+
}
37+
}
138
include(":prefs")
239
include(":scripts")
340
include(":libautomata")

0 commit comments

Comments
 (0)