-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
127 lines (112 loc) · 3.45 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
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
apply(from = "publish-root.gradle")
plugins {
kotlin("multiplatform") version "2.0.20"
kotlin("plugin.serialization") version "2.0.20"
id("maven-publish")
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("signing")
}
group = "dev.snipme"
version = "1.0.0"
kotlin {
// Android
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
// iOS
val xcf = XCFramework()
val iosTargets = listOf(iosX64(), iosArm64(), iosSimulatorArm64())
iosTargets.forEach {
it.binaries.framework {
baseName = "highlights"
xcf.add(this)
}
}
// Desktop
mingwX64()
linuxX64()
linuxArm64()
macosX64()
macosArm64()
// Web
js {
browser()
nodejs()
}
wasmJs()
// Dependencies
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
}
}
val commonTest by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
implementation(kotlin("test"))
}
}
}
}
publishing {
val emptyJar = tasks.register<Jar>("emptyJar") {
archiveAppendix.set("empty")
}
publications.forEach {
val publication = it as? MavenPublication ?: return@forEach
publication.artifact(emptyJar) {
classifier = "javadoc"
}
publication.pom.withXml {
val root = asNode()
root.appendNode("name", project.name)
root.appendNode(
"description",
"Kotlin Multiplatform syntax highlighting engine."
)
root.appendNode("url", "https://github.com/SnipMeDev/Highlights")
root.appendNode("licenses").apply {
appendNode("license").apply {
appendNode("name", "The Apache Software License, Version 2.0")
appendNode("url", "https://www.apache.org/licenses/LICENSE-2.0.txt")
appendNode("distribution", "repo")
}
}
root.appendNode("developers").apply {
appendNode("developer").apply {
appendNode("id", "tkadziolka")
appendNode("name", "Tomasz Kądziołka")
appendNode("email", "[email protected]")
}
}
root.appendNode("scm").apply {
appendNode(
"connection",
"scm:git:ssh://[email protected]:SnipMeDev/Highlights.git"
)
appendNode(
"developerConnection",
"scm:git:ssh://[email protected]:SnipMeDev/Highlights.git",
)
appendNode("url", "https://github.com/SnipMeDev/Highlights")
}
}
}
}
signing {
useInMemoryPgpKeys(
rootProject.ext["signing.keyId"] as String,
rootProject.ext["signing.key"] as String,
rootProject.ext["signing.password"] as String
)
sign(publishing.publications)
}