generated from titan-data/template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
58 lines (48 loc) · 1.57 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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
buildscript {
repositories {
mavenCentral()
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("com.github.ben-manes:gradle-versions-plugin:0.27.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61")
}
}
plugins {
id("com.github.ben-manes.versions") version("0.27.0")
}
val titanVersion by extra(when(project.hasProperty("titanVersion")) {
true -> project.property("titanVersion")
false -> "latest"
})
tasks.register("check")
allprojects {
apply(plugin = "com.github.ben-manes.versions")
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
allWarningsAsErrors = true
freeCompilerArgs += "-Xuse-experimental=kotlin.Experimental"
}
}
tasks.register("style") {
group = "Verification"
description = "Run all style checks"
}
tasks.withType<DependencyUpdatesTask>().configureEach {
resolutionStrategy {
componentSelection {
all {
val rejected = listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea", "eap").any { qualifier ->
candidate.version.matches(Regex("(?i).*[.-]$qualifier[.\\d-+]*"))
}
if (rejected) {
reject("Release candidate")
}
}
}
}
}
}