-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
182 lines (145 loc) · 4.5 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.github.benmanes.gradle.versions.updates.gradle.GradleReleaseChannel
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.versions)
`maven-publish`
signing
}
tasks.withType<DependencyUpdatesTask> {
gradleReleaseChannel = GradleReleaseChannel.CURRENT.id
rejectVersionIf {
listOf("alpha", "beta", "rc", "cr", "m", "eap", "pr", "dev").any {
candidate.version.contains(it, ignoreCase = true)
}
}
}
kotlin {
explicitApi()
jvmToolchain(8)
jvm()
js(IR) {
browser()
nodejs()
}
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
binaries.executable()
nodejs()
}
/* https://kotlinlang.org/docs/native-target-support.html#tier-1 */
macosX64()
macosArm64()
iosSimulatorArm64()
iosX64()
/* https://kotlinlang.org/docs/native-target-support.html#tier-2 */
linuxX64()
linuxArm64()
watchosSimulatorArm64()
watchosX64()
watchosArm32()
watchosArm64()
tvosSimulatorArm64()
tvosX64()
tvosArm64()
iosArm64()
/* https://kotlinlang.org/docs/native-target-support.html#tier-3 */
androidNativeArm32()
androidNativeArm64()
androidNativeX86()
androidNativeX64()
mingwX64()
watchosDeviceArm64()
sourceSets {
all {
languageSettings.apply {
optIn("kotlin.contracts.ExperimentalContracts")
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
jvmTest {
dependencies {
implementation(kotlin("test-junit"))
}
}
jsTest {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}
tasks.withType<Jar> {
from(rootDir.resolve("LICENSE")) {
into("META-INF")
}
}
publishing {
repositories {
maven {
if (project.version.toString().endsWith("SNAPSHOT")) {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
} else {
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
credentials {
val ossrhUsername: String? by project
val ossrhPassword: String? by project
username = ossrhUsername
password = ossrhPassword
}
}
}
publications.withType<MavenPublication> {
val targetName = [email protected]
artifact(tasks.register("${targetName}JavadocJar", Jar::class) {
group = LifecycleBasePlugin.BUILD_GROUP
description = "Assembles a jar archive containing the Javadoc API documentation of target '$targetName'."
archiveClassifier.set("javadoc")
archiveAppendix.set(targetName)
})
pom {
name.set(project.name)
description.set(project.description)
url.set("https://github.com/michaelbull/kotlin-itertools")
inceptionYear.set("2024")
licenses {
license {
name.set("ISC License")
url.set("https://opensource.org/licenses/isc-license.txt")
}
}
developers {
developer {
name.set("Michael Bull")
url.set("https://www.michael-bull.com")
}
}
scm {
connection.set("scm:git:https://github.com/michaelbull/kotlin-itertools")
developerConnection.set("scm:git:[email protected]:michaelbull/kotlin-itertools.git")
url.set("https://github.com/michaelbull/kotlin-itertools")
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/michaelbull/kotlin-itertools/issues")
}
ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/michaelbull/kotlin-itertools/actions")
}
}
}
}
signing {
val signingKeyId: String? by project // must be the last 8 digits of the key
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
}