-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle.kts
46 lines (42 loc) · 1.75 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.library") version "8.1.0" apply false
// https://kotlinlang.org/docs/releases.html#release-details
// https://kotlinlang.org/docs/kotlin-evolution.html#evolving-the-binary-format
kotlin("android") version "1.8.22" apply false // This library can be compiled with at least a Kotlin 1.7 compiler.
// https://github.com/ben-manes/gradle-versions-plugin/releases
id("com.github.ben-manes.versions") version "0.47.0"
// https://github.com/gradle-nexus/publish-plugin/releases
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
nexusPublishing {
packageGroup.set("com.uwetrottmann")
this.repositories {
sonatype {
if (rootProject.hasProperty("SONATYPE_NEXUS_USERNAME")
&& rootProject.hasProperty("SONATYPE_NEXUS_PASSWORD")) {
username.set(rootProject.property("SONATYPE_NEXUS_USERNAME").toString())
password.set(rootProject.property("SONATYPE_NEXUS_PASSWORD").toString())
}
}
}
}
// reject preview releases for dependencyUpdates task
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()
}
tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version)
}
}
tasks.register("clean", Delete::class) {
group = "build"
delete(rootProject.buildDir)
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}