This repository has been archived by the owner on Jan 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 711
/
build.gradle
102 lines (84 loc) · 2.84 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import org.mozilla.focus.gradle.tasks.GithubDetailsTask
buildscript {
repositories {
google()
mavenCentral()
maven {
// We will always need this repository for retrieving stable dependencies (like Glean).
url "https://maven.mozilla.org/maven2"
}
maven {
url "https://nightly.maven.mozilla.org/maven2"
}
}
dependencies {
classpath FocusDependencies.android_gradle_plugin
classpath FocusDependencies.kotlin_gradle_plugin
classpath "org.mozilla.components:tooling-glean-gradle:${AndroidComponents.VERSION}"
classpath "org.mozilla.components:tooling-nimbus-gradle:${AndroidComponents.VERSION}"
// 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.18.0" // Variables in plugins {} aren't supported
}
detekt {
buildUponDefaultConfig = true
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")
}
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://nightly.maven.mozilla.org/maven2"
}
maven {
url "https://maven.mozilla.org/maven2"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
configurations {
ktlint
}
dependencies {
ktlint("com.pinterest:ktlint:${FocusVersions.ktlint_version}") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
}
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "app/**/*.kt", "!**/build/**/*.kt", "buildSrc/**/*.kt"
}
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "-F", "app/**/*.kt", "!**/build/**/*.kt", "buildSrc/**/*.kt"
}
tasks.register("githubTestDetails", GithubDetailsTask) {
text = "### [Unit Test Results]({reportsUrl}/test/testFocusDebugUnitTest/index.html)"
}
tasks.register("githubLintDetektDetails", GithubDetailsTask) {
text = "### [Detekt Results]({reportsUrl}/detekt.html)"
}
tasks.register("githubLintAndroidDetails", GithubDetailsTask) {
text = "### [Android Lint Results]({reportsUrl}/lint-results-debug.html)"
}