Revision control

Copy as Markdown

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import org.mozilla.gradle.Dependencies
buildscript {
ext.androidx_version = '1.0.0'
ext.architecture_components_version = '2.0.0'
ext.kotlin_version = '1.3.31'
ext.coroutines_version = '1.0.1'
ext.moz_components_version = '24.0.0'
ext.androidx_work_version = '2.0.1'
ext.adm_version = '1.0.1' // Also update proguard rule if this gets updated
ext.oss_licenses_version = '17.0.0'
ext.robolectric_version = '4.0.2' // required for SDK 28.
// Support library test dependencies
// - Keep pinned to tested versions (in release notes): https://developer.android.com/jetpack/androidx/releases/archive/test
ext.test_core = '1.1.0'
ext.test_runner = '1.1.1'
ext.test_rules = ext.test_runner
ext.test_orchestrator = '1.1.1'
ext.espresso_version = '3.1.1'
ext.uiautomator_version = '2.2.0'
ext.junit = "1.1.0"
// This logic is duplicated in the allprojects block: I don't know how to fix that.
repositories {
maven {
content {
includeGroupByRegex Dependencies.RepoMatching.mozilla
}
}
google() {
content {
// Improve performance: only check google maven for mozilla deps.
includeGroupByRegex Dependencies.RepoMatching.androidx
includeGroupByRegex Dependencies.RepoMatching.comGoogleAndroid
includeGroupByRegex Dependencies.RepoMatching.comAndroid
// Improve security: don't search deps with known repos. In theory, this is unnecessary
// if includeGroup is specified, but it's helpful in case includeGroup is removed.
excludeGroupByRegex Dependencies.RepoMatching.mozilla
}
}
jcenter() {
content {
// Improve security: don't search deps with known repos.
excludeGroupByRegex Dependencies.RepoMatching.mozilla
excludeGroupByRegex Dependencies.RepoMatching.androidx
excludeGroupByRegex Dependencies.RepoMatching.comGoogleAndroid
excludeGroupByRegex Dependencies.RepoMatching.comAndroid
}
}
}
dependencies {
// If you ever see strange Gradle behavior that looks related to the version,
// double check that this matches build.gradle.kts
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'org.ajoberstar:grgit:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC9.2"
}
detekt {
toolVersion = "1.0.0.RC9.2"
input = files("$projectDir")
config = files("$projectDir/quality/detekt.yml")
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
}
allprojects {
// This logic is duplicated in the buildscript block: I don't know how to fix that.
repositories {
maven {
content {
// Improve performance: only check moz maven for mozilla deps.
includeGroupByRegex Dependencies.RepoMatching.mozilla
}
}
google() {
content {
// Improve performance: only check google maven for google deps.
includeGroupByRegex Dependencies.RepoMatching.androidx
includeGroupByRegex Dependencies.RepoMatching.comGoogleAndroid
includeGroupByRegex Dependencies.RepoMatching.comAndroid
// Improve security: don't search deps with known repos. In theory, this is unnecessary
// if includeGroup is specified, but it's helpful in case includeGroup is removed.
excludeGroupByRegex Dependencies.RepoMatching.mozilla
}
}
jcenter() {
content {
// Improve security: don't search deps with known repos.
excludeGroupByRegex Dependencies.RepoMatching.mozilla
excludeGroupByRegex Dependencies.RepoMatching.androidx
excludeGroupByRegex Dependencies.RepoMatching.comGoogleAndroid
excludeGroupByRegex Dependencies.RepoMatching.comAndroid
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
configurations {
ktlint
}
dependencies {
ktlint "com.pinterest:ktlint:0.33.0"
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "**/*.kt"
}