-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
86 lines (71 loc) · 1.92 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
import nebula.plugin.release.git.opinion.Strategies
plugins {
kotlin("jvm") version "1.6.21"
id("groovy")
id("idea")
id("maven-publish")
id("com.github.hierynomus.license") version "0.16.1"
id("nebula.release") version "17.1.0"
}
group = "gradle.plugin.com.xebialabs"
project.defaultTasks = listOf("build")
release {
defaultVersionStrategy = Strategies.getSNAPSHOT()
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
withSourcesJar()
withJavadocJar()
}
idea {
module {
setDownloadJavadoc(true)
setDownloadSources(true)
}
}
dependencies {
implementation(gradleApi())
implementation(localGroovy())
implementation("com.typesafe:config:1.2.1")
}
val repositoryName = if (project.version.toString().endsWith("-SNAPSHOT")) "snapshots" else "releases"
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
repositories {
maven {
url = uri("${project.property("nexusBaseUrl")}/repositories/${repositoryName}")
credentials {
username = project.property("nexusUserName").toString()
password = project.property("nexusPassword").toString()
}
}
}
}
tasks {
// TODO not needed for 3.0.x
// named<Upload>("uploadArchives") {
// dependsOn(named("publish"))
// }
register("dumpVersion") {
doLast {
file(buildDir).mkdirs()
file("$buildDir/version.dump").writeText("version=${project.version}")
}
}
compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}
compileTestKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}
withType<ValidatePlugins>().configureEach {
failOnWarning.set(false)
enableStricterValidation.set(false)
}
}