-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
101 lines (88 loc) · 2.89 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
repositories {
mavenCentral()
}
plugins {
kotlin("jvm") version "1.5.31"
kotlin("plugin.serialization") version "1.5.31"
`maven-publish`
signing
id("org.jetbrains.dokka") version "1.5.31"
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("com.charleskorn.kaml:kaml:0.37.0")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.3.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.3")
testImplementation("org.assertj:assertj-core:3.24.2")
}
tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
test {
useJUnitPlatform()
}
}
val dokkaJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka"
archiveClassifier.set("javadoc")
from(tasks.dokkaJavadoc)
}
java {
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
artifact(dokkaJar)
pom {
name.set("GitlabCi Kotlin DSL")
description.set("Library providing Kotlin DSL to configure GitlabCI file")
url.set("https://github.com/pcimcioch/gitlab-ci-kotlin-dsl")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
connection.set("scm:git:git://github.com/pcimcioch/gitlab-ci-kotlin-dsl.git")
developerConnection.set("scm:git:[email protected]:pcimcioch/gitlab-ci-kotlin-dsl.git")
url.set("https://github.com/pcimcioch/gitlab-ci-kotlin-dsl")
}
developers {
developer {
id.set("pcimcioch")
name.set("Przemysław Cimcioch")
email.set("[email protected]")
}
}
}
}
}
repositories {
val url = if (project.version.toString().contains("SNAPSHOT")) "https://oss.sonatype.org/content/repositories/snapshots" else "https://oss.sonatype.org/service/local/staging/deploy/maven2"
maven(url) {
credentials {
username = project.findProperty("ossrhUsername")?.toString() ?: ""
password = project.findProperty("ossrhPassword")?.toString() ?: ""
}
}
}
}
signing {
useInMemoryPgpKeys(project.findProperty("signingKey").toString(), project.findProperty("signingPassword").toString())
sign(publishing.publications["maven"])
}