forked from xxfast/KStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
110 lines (95 loc) · 2.97 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
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
plugins {
id("org.jetbrains.kotlinx.kover") version "0.6.1"
id("org.jetbrains.dokka") version "1.9.10"
}
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
google()
}
dependencies {
classpath(libs.agp)
classpath(libs.kotlin)
classpath(libs.kotlin.serialization)
}
}
allprojects {
repositories {
google()
mavenCentral()
}
group = "io.github.xxfast"
version = "0.8.0-SNAPSHOT"
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
apply(plugin = "org.jetbrains.kotlinx.kover")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "maven-publish")
apply(plugin = "signing")
extensions.configure<PublishingExtension> {
repositories {
maven {
val isSnapshot = version.toString().endsWith("SNAPSHOT")
url = uri(
if (!isSnapshot) "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
else "https://s01.oss.sonatype.org/content/repositories/snapshots"
)
credentials {
username = gradleLocalProperties(rootDir).getProperty("sonatypeUsername")
password = gradleLocalProperties(rootDir).getProperty("sonatypePassword")
}
}
}
val javadocJar = tasks.register<Jar>("javadocJar") {
dependsOn(tasks.dokkaHtml)
archiveClassifier.set("javadoc")
from("$buildDir/dokka")
}
publications {
withType<MavenPublication> {
artifact(javadocJar)
pom {
name.set("KStore")
description.set("A tiny Kotlin multiplatform library that assists in saving and restoring objects to and from disk using kotlinx.coroutines, kotlinx.serialisation and okio")
licenses {
license {
name.set("Apache-2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}
url.set("https://xxfast.github.io/KStore/")
issueManagement {
system.set("Github")
url.set("https://github.com/xxfast/KStore/issues")
}
scm {
connection.set("https://github.com/xxfast/KStore.git")
url.set("https://github.com/xxfast/KStore")
}
developers {
developer {
name.set("Isuru Rajapakse")
email.set("[email protected]")
}
}
}
}
}
}
val publishing = extensions.getByType<PublishingExtension>()
extensions.configure<SigningExtension> {
useInMemoryPgpKeys(
gradleLocalProperties(rootDir).getProperty("gpgKeySecret"),
gradleLocalProperties(rootDir).getProperty("gpgKeyPassword"),
)
sign(publishing.publications)
}
// TODO: remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed
project.tasks.withType(AbstractPublishToMaven::class.java).configureEach {
dependsOn(project.tasks.withType(Sign::class.java))
}
}
koverMerged {
enable()
}