-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
119 lines (105 loc) · 3.33 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
plugins {
id("java-library")
kotlin("jvm") version "1.9.0"
id("maven-publish")
id("signing")
id("pl.allegro.tech.build.axion-release") version "1.15.4"
id("org.jetbrains.dokka") version "1.9.0"
}
group = "io.github.marad"
project.version = scmVersion.version
tasks.register<Jar>("dokkaJavadocJar") {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}
publishing {
publications {
create<MavenPublication>("library") {
groupId = "io.github.marad"
artifactId = "kotlin-html-dsl"
version = scmVersion.version
artifact(tasks.jar)
artifact(tasks.kotlinSourcesJar)
artifact(tasks["dokkaJavadocJar"])
}
withType<MavenPublication> {
pom {
packaging = "jar"
name.set(artifactId)
description.set("Library for easy HTML generation.")
url.set("https://github.com/marad/kotlin-html-dsl")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/marad/kotlin-html-dsl/issues")
}
developers {
developer {
id.set("marad")
name.set("Marcin Radoszewski")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:https://github.com/marad/kotlin-html-dsl.git")
developerConnection.set("scm:git:ssh://[email protected]:marad/kotlin-html-dsl.git")
url.set("https://github.com/marad/kotlin-html-dsl")
}
}
}
}
repositories {
maven {
name = "OSSRH"
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = uri(if (scmVersion.version.endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
println("Publishing version ${scmVersion.version} to $url")
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
}
signing {
val key = System.getenv("GPG_KEY")
val pass = System.getenv("GPG_PASS")
useInMemoryPgpKeys(key, pass)
sign(publishing.publications)
}
repositories {
mavenCentral()
}
dependencies {
testImplementation("io.kotest:kotest-assertions-core-jvm:5.7.0")
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
java {
withSourcesJar()
withJavadocJar()
}
kotlin {
// jvmToolchain(17)
// jvmToolchain {
// languageVersion.set(JavaLanguageVersion.of(8))
// }
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
tasks.jar {
enabled = true
archiveClassifier.set("")
}