-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
149 lines (122 loc) · 3.68 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
import org.jetbrains.dokka.DokkaConfiguration.Visibility
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
plugins {
id ("org.jetbrains.kotlin.multiplatform") version "1.8.0"
id("org.jetbrains.dokka") version "1.7.20"
id ("com.vanniktech.maven.publish") version "0.25.2"
}
repositories {
mavenCentral()
}
kotlin {
explicitApi()
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
browser()
nodejs()
}
// val hostOs = System.getProperty("os.name")
// when {
// hostOs == "Mac OS X" -> macosX64("native")
// hostOs == "Linux" -> linuxX64("native")
// hostOs.startsWith("Windows") -> mingwX64("native")
// else -> throw GradleException("Host OS $hostOs is not supported in Kotlin/Native.")
// }
// .binaries.executable { entryPoint = "main" }
macosX64()
macosArm64()
iosX64()
iosArm64()
iosArm32()
iosSimulatorArm64()
watchosArm32()
watchosArm64()
watchosSimulatorArm64()
watchosDeviceArm64()
watchosX86()
watchosX64()
tvosArm64()
tvosSimulatorArm64()
tvosX64()
mingwX64()
mingwX86()
linuxX64()
linuxArm32Hfp()
linuxMips32()
sourceSets {
configureEach {}
getByName("commonMain") {
dependencies {
}
}
getByName("commonTest") {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
getByName("jvmTest") {
dependencies {
implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
runtimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
}
}
getByName("jsTest") {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}
// dokka
tasks.withType<DokkaTask>().configureEach {
suppressInheritedMembers.set(true)
outputDirectory.set(file("/Users/william/IdeaProjects/library/ITWorks/content/docs/multiplatform/kt-util/html"))
dokkaSourceSets.configureEach {
documentedVisibilities.set(
setOf(
Visibility.PUBLIC,
Visibility.PROTECTED,
)
)
perPackageOption {
matchingRegex.set(".*internal.*")
suppress.set(true)
}
}
}
// publish
mavenPublishing {
val isSnapshot = false
val version = "1.0.2"
coordinates("io.github.shawxingkwok", "kt-util", if (isSnapshot) "$version-SNAPSHOT" else version)
pom {
val repo = "KtUtil"
name.set(repo)
description.set("Personal kt util")
inceptionYear.set("2023")
url.set("https://github.com/ShawxingKwok/$repo/")
scm{
connection.set("scm:git:git://github.com/ShawxingKwok/$repo.git")
developerConnection.set("scm:git:ssh://git@github.com/ShawxingKwok/$repo.git")
}
}
}
rootProject.plugins.withType(YarnPlugin::class.java) {
rootProject.the<YarnRootExtension>().yarnLockMismatchReport =
YarnLockMismatchReport.WARNING // NONE | FAIL
rootProject.the<YarnRootExtension>().reportNewYarnLock = false // true
rootProject.the<YarnRootExtension>().yarnLockAutoReplace = false // true
}