-
Notifications
You must be signed in to change notification settings - Fork 59
/
build.gradle.kts
105 lines (88 loc) · 2.66 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
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.konan.target.HostManager
import java.net.URL
plugins {
kotlin("multiplatform") version "1.7.21"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.dokka") version "1.7.20"
id("maven-publish")
id("signing")
}
val GROUP: String by project
val VERSION_NAME: String by project
group = GROUP
version = VERSION_NAME
repositories {
mavenCentral()
}
kotlin {
targets {
jvm()
js(BOTH) {
compilations.all {
kotlinOptions {
sourceMap = true
moduleKind = "umd"
metaInfo = true
}
}
browser()
nodejs()
}
if (HostManager.hostIsMac) {
macosX64()
macosArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
}
if (HostManager.hostIsMingw || HostManager.hostIsMac) {
mingwX64 {
binaries.findTest(DEBUG)!!.linkerOpts = mutableListOf("-Wl,--subsystem,windows")
}
}
if (HostManager.hostIsLinux || HostManager.hostIsMac) {
linuxX64()
}
}
sourceSets {
commonMain {
dependencies {
implementation(kotlin("stdlib-common"))
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
}
}
tasks {
val dokkaHtml by getting(DokkaTask::class) {
dokkaSourceSets {
configureEach {
reportUndocumented.set(false)
skipEmptyPackages.set(true)
skipDeprecated.set(true)
jdkVersion.set(8)
// Add Android SDK packages
noAndroidSdkLink.set(false)
sourceLink {
localDirectory.set(project.file("src/commonMain/kotlin"))
// URL showing where the source code can be accessed through the web browser
remoteUrl.set(URL("https://github.com/romainguy/kotlin-math/blob/main/${project.name}/src/commonMain/kotlin"))
// Suffix which is used to append the line number to the URL. Use #L for GitHub
remoteLineSuffix.set("#L")
}
}
}
}
}
val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)
val javadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
}
apply(from = "publish.gradle")