refactor(build): simplify repository declaration and support build scans

This commit is contained in:
Harsh Shandilya 2023-12-27 17:43:23 +05:30
parent 11be868d43
commit b5b8a864cd
2 changed files with 29 additions and 102 deletions

View file

@ -14,25 +14,8 @@ dependencyResolutionManagement {
forRepository(::google) forRepository(::google)
filter { filter {
includeGroup("androidx.databinding") includeGroup("androidx.databinding")
includeGroup("com.android") includeGroupByRegex("com.android.*")
includeGroup("com.android.tools.analytics-library")
includeGroup("com.android.tools.build")
includeGroup("com.android.tools.build.jetifier")
includeGroup("com.android.databinding")
includeGroup("com.android.tools.ddms")
includeGroup("com.android.tools.layoutlib")
includeGroup("com.android.tools.lint")
includeGroup("com.android.tools.utp")
includeGroup("com.google.testing.platform") includeGroup("com.google.testing.platform")
includeModule("com.android.tools", "annotations")
includeModule("com.android.tools", "common")
includeModule("com.android.tools", "desugar_jdk_libs")
includeModule("com.android.tools", "desugar_jdk_libs_configuration")
includeModule("com.android.tools", "dvlib")
includeModule("com.android.tools", "play-sdk-proto")
includeModule("com.android.tools", "repository")
includeModule("com.android.tools", "sdklib")
includeModule("com.android.tools", "sdk-common")
} }
} }
exclusiveContent { exclusiveContent {
@ -43,7 +26,7 @@ dependencyResolutionManagement {
includeModule("gradle.plugin.org.gradle.android", "android-cache-fix-gradle-plugin") includeModule("gradle.plugin.org.gradle.android", "android-cache-fix-gradle-plugin")
} }
} }
mavenCentral() mavenCentral { mavenContent { releasesOnly() } }
} }
versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } } versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } }
} }

View file

@ -7,7 +7,6 @@
@file:Suppress("UnstableApiUsage") @file:Suppress("UnstableApiUsage")
pluginManagement { pluginManagement {
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" }
repositories { repositories {
exclusiveContent { exclusiveContent {
forRepository { google() } forRepository { google() }
@ -15,26 +14,8 @@ pluginManagement {
includeGroup("androidx.baselineprofile") includeGroup("androidx.baselineprofile")
includeGroup("androidx.benchmark") includeGroup("androidx.benchmark")
includeGroup("androidx.databinding") includeGroup("androidx.databinding")
includeGroup("com.android") includeGroupByRegex("com.android.*")
includeModule("com.android.test", "com.android.test.gradle.plugin")
includeGroup("com.android.tools.analytics-library")
includeGroup("com.android.tools.build")
includeGroup("com.android.tools.build.jetifier")
includeGroup("com.android.databinding")
includeGroup("com.android.tools.ddms")
includeGroup("com.android.tools.layoutlib")
includeGroup("com.android.tools.lint")
includeGroup("com.android.tools.utp")
includeGroup("com.google.testing.platform") includeGroup("com.google.testing.platform")
includeModule("com.android.tools", "annotations")
includeModule("com.android.tools", "common")
includeModule("com.android.tools", "desugar_jdk_libs")
includeModule("com.android.tools", "desugar_jdk_libs_configuration")
includeModule("com.android.tools", "dvlib")
includeModule("com.android.tools", "play-sdk-proto")
includeModule("com.android.tools", "repository")
includeModule("com.android.tools", "sdklib")
includeModule("com.android.tools", "sdk-common")
} }
} }
exclusiveContent { exclusiveContent {
@ -49,15 +30,36 @@ pluginManagement {
"com.jraska.module.graph.assertion", "com.jraska.module.graph.assertion",
"com.jraska.module.graph.assertion.gradle.plugin" "com.jraska.module.graph.assertion.gradle.plugin"
) )
includeModule("com.gradle", "gradle-enterprise-gradle-plugin")
includeModule("com.gradle.enterprise", "com.gradle.enterprise.gradle.plugin")
includeModule("com.jraska.module.graph.assertion", "plugin") includeModule("com.jraska.module.graph.assertion", "plugin")
includeModule(
"org.gradle.toolchains.foojay-resolver-convention",
"org.gradle.toolchains.foojay-resolver-convention.gradle.plugin",
)
includeModule("org.gradle.toolchains", "foojay-resolver")
} }
} }
includeBuild("build-logic") includeBuild("build-logic")
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots/") { maven("https://oss.sonatype.org/content/repositories/snapshots/") {
name = "Sonatype Snapshots" name = "Sonatype Snapshots"
content { includeGroup("dev.msfjarvis.whetstone") } content { includeGroup("dev.msfjarvis.whetstone") }
mavenContent { snapshotsOnly() }
} }
mavenCentral { mavenContent { releasesOnly() } }
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
id("com.gradle.enterprise") version "3.16.1"
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = if (System.getenv("GITHUB_WORKFLOW").isNullOrEmpty()) "no" else "yes"
publishOnFailureIf(!System.getenv("GITHUB_WORKFLOW").isNullOrEmpty())
} }
} }
@ -66,68 +68,9 @@ dependencyResolutionManagement {
repositories { repositories {
google { google {
content { content {
includeGroup("androidx.activity") includeGroupByRegex("androidx.*")
includeGroup("androidx.appcompat") includeGroupByRegex("com.android.*")
includeGroup("androidx.annotation")
includeGroup("androidx.arch.core")
includeGroup("androidx.autofill")
includeGroup("androidx.benchmark")
includeGroup("androidx.browser")
includeGroup("androidx.collection")
includeGroup("androidx.compose")
includeGroup("androidx.compose.animation")
includeGroup("androidx.compose.compiler")
includeGroup("androidx.compose.foundation")
includeGroup("androidx.compose.material")
includeGroup("androidx.compose.material3")
includeGroup("androidx.compose.runtime")
includeGroup("androidx.compose.ui")
includeGroup("androidx.concurrent")
includeGroup("androidx.core")
includeGroup("androidx.cursoradapter")
includeGroup("androidx.customview")
includeGroup("androidx.databinding")
includeGroup("androidx.datastore")
includeGroup("androidx.drawerlayout")
includeGroup("androidx.emoji2")
includeGroup("androidx.exifinterface")
includeGroup("androidx.fragment")
includeGroup("androidx.glance")
includeGroup("androidx.interpolator")
includeGroup("androidx.lifecycle")
includeGroup("androidx.loader")
includeGroup("androidx.navigation")
includeGroup("androidx.paging")
includeGroup("androidx.profileinstaller")
includeGroup("androidx.resourceinspection")
includeGroup("androidx.room")
includeGroup("androidx.savedstate")
includeGroup("androidx.startup")
includeGroup("androidx.sqlite")
includeGroup("androidx.test")
includeGroup("androidx.test.espresso")
includeGroup("androidx.test.ext")
includeGroup("androidx.test.services")
includeGroup("androidx.test.uiautomator")
includeGroup("androidx.tracing")
includeGroup("androidx.vectordrawable")
includeGroup("androidx.versionedparcelable")
includeGroup("androidx.viewpager")
includeGroup("androidx.window")
includeGroup("androidx.work")
includeGroup("com.android")
includeGroup("com.android.tools")
includeGroup("com.android.tools.analytics-library")
includeGroup("com.android.tools.build")
includeGroup("com.android.tools.ddms")
includeGroup("com.android.tools.emulator")
includeGroup("com.android.tools.external.com-intellij")
includeGroup("com.android.tools.external.org-jetbrains")
includeGroup("com.android.tools.layoutlib")
includeGroup("com.android.tools.lint")
includeGroup("com.android.tools.utp")
includeGroup("com.google.android.gms") includeGroup("com.google.android.gms")
includeGroup("com.google.testing.platform")
includeModule("com.google.android.material", "material") includeModule("com.google.android.material", "material")
} }
} }
@ -139,14 +82,15 @@ dependencyResolutionManagement {
name = "Compose Compiler Snapshots" name = "Compose Compiler Snapshots"
content { includeGroup("androidx.compose.compiler") } content { includeGroup("androidx.compose.compiler") }
} }
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots/") { maven("https://oss.sonatype.org/content/repositories/snapshots/") {
name = "Sonatype Snapshots" name = "Sonatype Snapshots"
content { content {
includeGroup("dev.msfjarvis.whetstone") includeGroup("dev.msfjarvis.whetstone")
includeGroup("me.saket.swipe") includeGroup("me.saket.swipe")
} }
mavenContent { snapshotsOnly() }
} }
mavenCentral { mavenContent { releasesOnly() } }
} }
} }