2018-12-07 21:11:50 +01:00
|
|
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
|
|
|
|
|
|
buildscript {
|
2020-04-15 19:54:36 +02:00
|
|
|
// This logic is duplicated in the allprojects block: I don't know how to fix that.
|
2018-12-07 21:11:50 +01:00
|
|
|
repositories {
|
2020-04-15 19:54:36 +02:00
|
|
|
maven {
|
2020-05-13 18:36:48 +02:00
|
|
|
name "Mozilla Nightly"
|
2020-04-15 19:54:36 +02:00
|
|
|
url "https://nightly.maven.mozilla.org/maven2"
|
|
|
|
content {
|
|
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
|
|
}
|
|
|
|
}
|
|
|
|
maven {
|
2020-05-13 18:36:48 +02:00
|
|
|
name "Mozilla"
|
2020-04-15 19:54:36 +02:00
|
|
|
url "https://maven.mozilla.org/maven2"
|
|
|
|
content {
|
|
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
|
|
}
|
|
|
|
}
|
2020-05-13 18:36:48 +02:00
|
|
|
if (project.hasProperty("googleRepo")) {
|
|
|
|
maven {
|
|
|
|
name "Google"
|
|
|
|
url project.property("googleRepo")
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
google() {
|
|
|
|
content {
|
|
|
|
// Improve performance: only check google maven for mozilla deps.
|
|
|
|
includeGroupByRegex RepoMatching.androidx
|
|
|
|
includeGroupByRegex RepoMatching.comGoogleAndroid
|
|
|
|
includeGroupByRegex RepoMatching.comGoogleFirebase
|
|
|
|
includeGroupByRegex RepoMatching.comAndroid
|
|
|
|
}
|
2020-04-15 19:54:36 +02:00
|
|
|
}
|
|
|
|
}
|
2020-05-13 18:36:48 +02:00
|
|
|
|
|
|
|
if (project.hasProperty("jcenterRepo")) {
|
|
|
|
maven {
|
|
|
|
name "BintrayJCenter"
|
|
|
|
url project.property("jcenterRepo")
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
jcenter() {
|
|
|
|
content {
|
|
|
|
// Improve security: don't search deps with known repos.
|
|
|
|
excludeGroupByRegex RepoMatching.mozilla
|
|
|
|
excludeGroupByRegex RepoMatching.androidx
|
|
|
|
excludeGroupByRegex RepoMatching.comGoogleAndroid
|
|
|
|
excludeGroupByRegex RepoMatching.comGoogleFirebase
|
|
|
|
excludeGroupByRegex RepoMatching.comAndroid
|
|
|
|
}
|
2020-04-15 19:54:36 +02:00
|
|
|
}
|
|
|
|
}
|
2018-12-07 21:11:50 +01:00
|
|
|
}
|
2020-04-15 19:54:36 +02:00
|
|
|
|
2018-12-07 21:11:50 +01:00
|
|
|
dependencies {
|
2019-01-07 22:47:47 +01:00
|
|
|
classpath Deps.tools_androidgradle
|
|
|
|
classpath Deps.tools_kotlingradle
|
2019-02-08 19:35:48 +01:00
|
|
|
classpath Deps.androidx_safeargs
|
2019-02-20 03:10:17 +01:00
|
|
|
classpath Deps.allopen
|
2019-08-07 18:37:56 +02:00
|
|
|
classpath Deps.osslicenses_plugin
|
2018-12-07 21:11:50 +01:00
|
|
|
|
2020-04-15 19:54:36 +02:00
|
|
|
classpath "org.mozilla.components:tooling-glean-gradle:${Versions.mozilla_android_components}"
|
|
|
|
|
2018-12-07 21:11:50 +01:00
|
|
|
// NOTE: Do not place your application dependencies here; they belong
|
|
|
|
// in the individual module build.gradle files
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-30 17:29:45 +01:00
|
|
|
plugins {
|
2020-04-02 00:42:46 +02:00
|
|
|
id("io.gitlab.arturbosch.detekt").version("1.6.0")
|
2019-01-30 17:29:45 +01:00
|
|
|
}
|
|
|
|
|
2018-12-07 21:11:50 +01:00
|
|
|
allprojects {
|
2020-04-15 19:54:36 +02:00
|
|
|
// This logic is duplicated in the buildscript block: I don't know how to fix that.
|
2018-12-07 21:11:50 +01:00
|
|
|
repositories {
|
2019-01-15 19:47:38 +01:00
|
|
|
maven {
|
2020-05-13 18:36:48 +02:00
|
|
|
name "Mozilla Nightly"
|
2020-03-13 15:39:55 +01:00
|
|
|
url "https://nightly.maven.mozilla.org/maven2"
|
2020-04-15 19:54:36 +02:00
|
|
|
content {
|
|
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
|
|
}
|
2019-01-15 19:47:38 +01:00
|
|
|
}
|
2019-01-07 22:47:47 +01:00
|
|
|
maven {
|
2020-05-13 18:36:48 +02:00
|
|
|
name "Mozilla"
|
2019-01-07 22:47:47 +01:00
|
|
|
url "https://maven.mozilla.org/maven2"
|
2020-04-15 19:54:36 +02:00
|
|
|
content {
|
|
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
|
|
}
|
2019-01-07 22:47:47 +01:00
|
|
|
}
|
2020-05-13 18:36:48 +02:00
|
|
|
if (project.hasProperty("googleRepo")) {
|
|
|
|
maven {
|
|
|
|
name "Google"
|
|
|
|
url project.property("googleRepo")
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
google() {
|
|
|
|
content {
|
|
|
|
// Improve performance: only check google maven for mozilla deps.
|
|
|
|
includeGroupByRegex RepoMatching.androidx
|
|
|
|
includeGroupByRegex RepoMatching.comGoogleAndroid
|
|
|
|
includeGroupByRegex RepoMatching.comGoogleFirebase
|
|
|
|
includeGroupByRegex RepoMatching.comAndroid
|
|
|
|
}
|
2020-04-15 19:54:36 +02:00
|
|
|
}
|
|
|
|
}
|
2020-05-13 18:36:48 +02:00
|
|
|
if (project.hasProperty("jcenterRepo")) {
|
|
|
|
maven {
|
|
|
|
name "BintrayJCenter"
|
|
|
|
url project.property("jcenterRepo")
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
jcenter() {
|
|
|
|
content {
|
|
|
|
// Improve security: don't search deps with known repos.
|
|
|
|
excludeGroupByRegex RepoMatching.mozilla
|
|
|
|
excludeGroupByRegex RepoMatching.androidx
|
|
|
|
excludeGroupByRegex RepoMatching.comGoogleAndroid
|
|
|
|
excludeGroupByRegex RepoMatching.comGoogleFirebase
|
|
|
|
excludeGroupByRegex RepoMatching.comAndroid
|
|
|
|
}
|
2020-04-15 19:54:36 +02:00
|
|
|
}
|
2019-03-07 08:19:31 +01:00
|
|
|
}
|
2018-12-07 21:11:50 +01:00
|
|
|
}
|
2020-04-15 19:54:36 +02:00
|
|
|
|
2019-08-07 23:00:53 +02:00
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
2019-08-09 21:16:44 +02:00
|
|
|
kotlinOptions.jvmTarget = "1.8"
|
2019-08-07 23:00:53 +02:00
|
|
|
kotlinOptions.allWarningsAsErrors = true
|
|
|
|
kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlin.Experimental", "-Xskip-runtime-version-check"]
|
|
|
|
}
|
2018-12-07 21:11:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
task clean(type: Delete) {
|
|
|
|
delete rootProject.buildDir
|
2019-01-15 19:47:38 +01:00
|
|
|
}
|
2019-01-30 17:29:45 +01:00
|
|
|
|
|
|
|
detekt {
|
|
|
|
// The version number is duplicated, please refer to plugins block for more details
|
2020-04-02 00:42:46 +02:00
|
|
|
version = "1.6.0"
|
2019-12-05 04:06:05 +01:00
|
|
|
input = files("$projectDir/app/src")
|
2019-01-30 17:29:45 +01:00
|
|
|
config = files("$projectDir/config/detekt.yml")
|
|
|
|
|
|
|
|
reports {
|
|
|
|
html {
|
|
|
|
enabled = true
|
|
|
|
destination = file("$projectDir/build/reports/detekt.html")
|
|
|
|
}
|
2019-08-21 19:52:09 +02:00
|
|
|
xml {
|
|
|
|
enabled = false
|
|
|
|
}
|
2019-01-30 17:29:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
ktlint
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2019-08-09 21:16:44 +02:00
|
|
|
ktlint "com.pinterest:ktlint:0.34.2"
|
2019-12-31 17:46:22 +01:00
|
|
|
detekt project(":mozilla-detekt-rules")
|
|
|
|
detekt "io.gitlab.arturbosch.detekt:detekt-cli:${Versions.detekt}"
|
2019-01-30 17:29:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
task ktlint(type: JavaExec, group: "verification") {
|
|
|
|
description = "Check Kotlin code style."
|
|
|
|
classpath = configurations.ktlint
|
2019-08-21 19:21:58 +02:00
|
|
|
main = "com.pinterest.ktlint.Main"
|
2019-12-05 04:06:05 +01:00
|
|
|
args "app/src/**/*.kt"
|
2019-05-29 15:19:17 +02:00
|
|
|
}
|
2020-04-02 00:42:46 +02:00
|
|
|
|
|
|
|
tasks.withType(io.gitlab.arturbosch.detekt.Detekt.class) {
|
|
|
|
exclude("**/resources/**")
|
|
|
|
exclude("**/test/**")
|
|
|
|
exclude("**/tmp/**")
|
|
|
|
}
|
2020-05-13 18:36:48 +02:00
|
|
|
|
|
|
|
task listRepositories {
|
|
|
|
doLast {
|
|
|
|
println "Repositories:"
|
|
|
|
project.repositories.each { println "Name: " + it.name + "; url: " + it.url }
|
|
|
|
}
|
|
|
|
}
|