forked from ruslansharipov/mvi-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
58 lines (51 loc) · 1.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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
buildscript {
repositories {
google()
mavenCentral()
}
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
`maven-publish`
// https://www.jfrog.com/confluence/display/JFROG/Gradle+Artifactory+Plugin
alias(libs.plugins.artifactory) apply false
// https://github.com/diffplug/spotless
alias(libs.plugins.spotless)
// https://github.com/ben-manes/gradle-versions-plugin
alias(libs.plugins.ben.manes.versions)
// https://github.com/Kotlin/kotlinx.serialization
alias(libs.plugins.kotlin.serialization) apply false
// https://developer.android.com/develop/ui/compose/compiler
alias(libs.plugins.kotlin.compose) apply false
}
/**
* Run ./gradlew dependencyUpdates to check for new updates
* in dependencies used.
* More info at: https://github.com/ben-manes/gradle-versions-plugin
*/
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
// disallow release candidates as upgradable versions from stable versions
isNonStable(candidate.version) && !isNonStable(currentVersion) ||
// https://github.com/ben-manes/gradle-versions-plugin/issues/534#issuecomment-897236772
candidate.group == "org.jacoco"
}
}
subprojects {
apply(plugin = "com.diffplug.spotless")
spotless {
kotlin {
target("**/*.kt")
licenseHeaderFile(file("${project.rootDir}/spotless/LicenseHeader"))
}
}
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}