-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
114 lines (98 loc) · 3.23 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("org.jetbrains.dokka")
id("io.github.gradle-nexus.publish-plugin")
`maven-publish`
signing
}
group = "dev.sublab"
version = "1.0.0"
repositories {
mavenLocal()
mavenCentral()
}
val dokkaVersion: String by project
val commonVersion: String by project
dependencies {
testImplementation(kotlin("test"))
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:$dokkaVersion")
dokkaJavadocPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:$dokkaVersion")
implementation("dev.sublab:common-kotlin:$commonVersion")
}
tasks.test {
useJUnitPlatform()
}
tasks.dokkaHtml.configure {
outputDirectory.set(projectDir.resolve("reference"))
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
dependsOn("dokkaJavadoc")
from("$buildDir/dokka/javadoc")
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
publishing {
publications {
register("mavenJava", MavenPublication::class) {
groupId = groupId
artifactId = rootProject.name
version = version
from(components["java"])
artifact(sourcesJar.get())
artifact(javadocJar.get())
pom {
name.set(rootProject.name)
description.set("Sublab's Common Kotlin library")
url.set("https://github.com/sublabdev/${rootProject.name}")
licenses {
license {
name.set("Apache 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
name.set("Sublab")
email.set("[email protected]")
organization.set("Substrate Laboratory LLC")
organizationUrl.set("https://sublab.dev")
}
}
scm {
connection.set("scm:git:https://github.com/sublabdev/${rootProject.name}.git")
developerConnection.set("scm:git:https://github.com/sublabdev/${rootProject.name}.git")
url.set("https://github.com/sublabdev/${rootProject.name}")
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
packageGroup.set("dev.sublab")
username.set(extra.get("ossrhUsername") as? String)
password.set(extra.get("ossrhPassword") as? String)
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
signing {
useGpgCmd()
sign(publishing.publications["mavenJava"])
}