Files
sousa-gecko/mobile/android/focus-android/build.gradle
T
Ryan VanderMeulen d298e30fbf Bug 2049916 - Bump AGP to 9.2.1 and migrate to built-in Kotlin. r=android-reviewers,mcarare
Updates android-gradle-plugin to 9.2.1 (lint 32.2.1) and migrates off the
org.jetbrains.kotlin.android plugin to AGP's built-in Kotlin, pinning the Kotlin version on each
root's buildscript classpath and applying the com.android.library/application plugins through the
plugins DSL.

Differential Revision: https://phabricator.services.mozilla.com/D309476
2026-06-30 14:05:29 +00:00

114 lines
2.8 KiB
Groovy

import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
gradle.configureMavenRepositories(delegate)
}
dependencies {
classpath libs.android.gradle.plugin
classpath libs.kotlin.gradle.plugin
classpath libs.mozilla.glean.gradle.plugin
classpath libs.osslicenses.plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "mozac.ConfigPlugin"
alias(libs.plugins.dependency.analysis)
alias(libs.plugins.detekt)
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.ksp)
}
mozilla {
ktlintSourcePaths = ["app/**/*.kt", "buildSrc/**/*.kt", "!**/build/**/*.kt"]
}
dependencyAnalysis {
structure {
bundle("leakcanary") {
includeGroup("com.squareup.leakcanary")
}
// Ignore Android KTX dependencies. See https://developer.android.com/kotlin/ktx#modules
//ignoreKtx(true)
}
issues {
all {
onAny {
// Fail the run if any issues are found (default = 'warn')
//severity('fail')
}
}
}
}
detekt {
input = files("$projectDir/app")
config = files("$projectDir/quality/detekt.yml")
baseline = file("$projectDir/quality/detekt-baseline.xml")
reports {
html {
enabled = true
destination = file("$projectDir/build/reports/detekt.html")
}
xml {
enabled = false
}
txt {
enabled = false
}
}
}
tasks.withType(Detekt).configureEach() {
// Custom detekt rules should be built before.
// See https://detekt.dev/docs/introduction/extensions#pitfalls
dependsOn(":components:tooling-detekt:assemble")
autoCorrect = true
exclude "**/test/**"
exclude "**/androidTest/**"
exclude "**/build/**"
exclude "**/resources/**"
exclude "**/tmp/**"
}
// Apply same path exclusions as for the main task
tasks.withType(DetektCreateBaselineTask).configureEach() {
exclude "**/test/**"
exclude "**/androidTest/**"
exclude "**/build/**"
exclude "**/resources/**"
exclude "**/tmp/**"
}
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}
dependencies {
detektPlugins project(':components:tooling-detekt')
}
tasks.register("listRepositories") {
def reposData = project.provider {
project.repositories.collect { repo ->
[name: repo.name, url: repo.url.toString()]
}
}
doLast {
println "Repositories:"
reposData.get().each { println "Name: " + it.name + "; url: " + it.url }
}
}