-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle.kts
86 lines (73 loc) · 2.24 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
/*
* Léon - The URL Cleaner
* Copyright (C) 2024 Sven Jacobs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import com.adarshr.gradle.testlogger.theme.ThemeType.STANDARD
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jmailen.gradle.kotlinter.tasks.LintTask
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(libs.android.gradle.plugin)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.compose.gradle.plugin)
}
}
plugins {
alias(libs.plugins.ben.manes.versions)
alias(libs.plugins.kotlinter)
alias(libs.plugins.adarshr.test.logger)
alias(libs.plugins.aboutlibraries) apply false
}
subprojects {
apply(plugin = "org.jmailen.kotlinter")
apply(plugin = "com.adarshr.test-logger")
repositories {
google()
mavenCentral()
}
testlogger {
theme = STANDARD
}
tasks.withType<LintTask>().configureEach {
exclude { it.file.path.contains("/build/generated/") }
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.addAll(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=androidx.lifecycle.compose.ExperimentalLifecycleComposeApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
)
}
}
}
tasks.create<Delete>("clean") {
delete = setOf(rootProject.layout.buildDirectory)
}
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
fun isNonStable(version: String) =
listOf("alpha", "beta", "rc", "eap", "-m", ".m", "-a", "dev").any {
version.lowercase().contains(it)
}
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}