forked from PaulWoitaschek/Voice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
executable file
·117 lines (103 loc) · 2.88 KB
/
build.gradle.kts
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import com.android.build.gradle.AppPlugin
import com.android.build.gradle.BaseExtension
import com.android.build.gradle.LibraryPlugin
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import deps.Deps
import deps.Versions
import org.jlleitschuh.gradle.ktlint.KtlintExtension
buildscript {
repositories {
maven { setUrl("https://maven.google.com") }
jcenter()
google()
maven { setUrl("https://maven.fabric.io/public") }
mavenCentral()
}
@Suppress("RemoveRedundantQualifierName")
dependencies {
classpath(deps.Deps.androidGradlePlugin)
classpath(deps.Deps.Kotlin.gradlePlugin)
classpath(deps.Deps.fabricGradlePlugin)
}
}
plugins {
`build-scan`
id("com.github.ben-manes.versions") version "0.21.0"
id("org.jlleitschuh.gradle.ktlint") version "7.3.0"
}
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
setTermsOfServiceAgree("yes")
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
tasks {
"dependencyUpdates"(DependencyUpdatesTask::class) {
resolutionStrategy {
componentSelection {
all {
val reject = listOf("rc", "beta", "alpha").any {
candidate.version.contains(it, ignoreCase = true)
}
if (reject) {
reject("blacklisted")
}
if (candidate.group == "javax.annotation" && candidate.version == "1.0-20050927.133100") {
reject("blacklisted")
}
}
}
}
}
}
allprojects {
repositories {
maven { setUrl("https://maven.google.com") }
google()
jcenter()
mavenCentral()
maven { setUrl("https://maven.fabric.io/public") }
maven { setUrl("https://jitpack.io") }
}
configurations.all {
resolutionStrategy {
force(Deps.AndroidX.supportAnnotations)
force(Deps.Kotlin.std)
force("com.google.code.findbugs:jsr305:3.0.1")
}
}
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
configure<KtlintExtension> {
version.set(Deps.ktLint)
android.set(true)
}
plugins.whenPluginAdded {
if (this is AppPlugin || this is LibraryPlugin) {
convention.findByType(BaseExtension::class)?.let {
it.dexOptions.preDexLibraries = System.getenv("CI") != "true"
}
}
}
}
tasks {
register<Exec>("importStrings") {
executable = "sh"
args("-c", "tx pull -af --minimum-perc=5")
finalizedBy(":core:lintDebug")
}
register("appVersion") {
print("#BEGIN_VERSION#${Versions.versionName}#END_VERSION#")
}
register<TestReport>("allUnitTests") {
val tests = subprojects.mapNotNull { subProject ->
(subProject.tasks.findByName("testProprietaryDebugUnitTest")
?: subProject.tasks.findByName("testDebugUnitTest")) as? Test
}
val artifactFolder = File("${rootDir.absolutePath}/artifacts")
destinationDir = File(artifactFolder, "testResults")
reportOn(tests)
}
}