-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
100 lines (90 loc) · 2.91 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
plugins {
kotlin("multiplatform") version "1.4.31"
id("org.jetbrains.dokka") version "1.4.20"
id("maven-publish")
id("signing")
}
repositories {
jcenter()
mavenCentral()
}
kotlin {
jvm()
macosX64()
mingwX64()
}
group = "org.kodein.playgrounds"
version = "0.1"
val dokkaOutputDir = "$buildDir/dokka"
tasks.dokkaHtml {
outputDirectory.set(file(dokkaOutputDir))
}
val deleteDokkaOutputDir by tasks.register<Delete>("deleteDokkaOutputDirectory") {
delete(dokkaOutputDir)
}
val javadocJar = tasks.register<Jar>("javadocJar") {
dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaOutputDir)
}
publishing {
repositories {
maven {
name = "Oss"
setUrl {
val repositoryId =
System.getenv("SONATYPE_REPOSITORY_ID") ?: error("Missing env variable: SONATYPE_REPOSITORY_ID")
"https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${repositoryId}/"
}
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
maven {
name = "Snapshot"
setUrl { "https://oss.sonatype.org/content/repositories/snapshots/" }
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
publications {
withType<MavenPublication> {
artifact(javadocJar)
pom {
name.set("playground-publish-kmp-to-mavencentral")
description.set("A sample project to see how to publish KMP to Maven Central.")
url.set("https://github.com/KodeinKoders/playground-publish-kmp-to-mavencentral")
licenses {
license {
name.set("MIT license")
url.set("https://opensource.org/licenses/MIT")
}
}
issueManagement {
system.set("Github")
url.set("https://github.com/KodeinKoders/playground-publish-kmp-to-mavencentral/issues")
}
scm {
connection.set("https://github.com/KodeinKoders/playground-publish-kmp-to-mavencentral.git")
url.set("https://github.com/KodeinKoders/playground-publish-kmp-to-mavencentral")
}
developers {
developer {
name.set("Kodein Koders")
email.set("[email protected]")
}
}
}
}
}
}
signing {
useInMemoryPgpKeys(
System.getenv("GPG_PRIVATE_KEY"),
System.getenv("GPG_PRIVATE_PASSWORD")
)
sign(publishing.publications)
}