-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
101 lines (90 loc) · 2.49 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
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinMultiplatform
import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.konan.target.HostManager
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.dokka)
alias(libs.plugins.spotless)
alias(libs.plugins.kotlinxBCV)
alias(libs.plugins.mavenPublish)
}
group = requireNotNull(project.findProperty("GROUP"))
version = requireNotNull(project.findProperty("VERSION_NAME"))
apiValidation { ignoredProjects.add("benchmark") }
@Suppress("UnstableApiUsage")
mavenPublishing {
signAllPublications()
pomFromGradleProperties()
configure(KotlinMultiplatform(JavadocJar.Dokka("dokkaHtml")))
}
publishing {
repositories {
maven {
name = "Sonatype"
setUrl {
val repositoryId =
System.getenv("SONATYPE_REPOSITORY_ID")
?: error("Missing env variable: SONATYPE_REPOSITORY_ID")
"https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${repositoryId}/"
}
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
}
spotless {
val ktfmtVersion = "0.53"
kotlin {
ktfmt(ktfmtVersion).googleStyle()
target("**/*.kt")
targetExclude("**/build/")
}
kotlinGradle {
ktfmt(ktfmtVersion).googleStyle()
target("**/*.kts")
targetExclude("**/build/")
}
}
kotlin {
explicitApi()
jvm()
js(IR) {
nodejs {}
browser {}
compilations.configureEach { kotlinOptions { moduleKind = "umd" } }
}
if (providers.gradleProperty("enableNativeTargets").isPresent) {
if (HostManager.hostIsMac) {
iosX64()
iosArm64()
tvosX64()
tvosArm64()
watchosX64()
watchosArm32()
watchosArm64()
macosX64()
macosArm64()
iosSimulatorArm64()
watchosSimulatorArm64()
tvosSimulatorArm64()
}
if (HostManager.hostIsMingw) {
mingwX64()
}
if (HostManager.hostIsLinux || HostManager.hostIsMac) {
linuxX64()
}
androidNativeArm32()
androidNativeArm64()
}
sourceSets { getByName("commonTest") { dependencies { implementation(libs.kotlin.test.core) } } }
jvmToolchain { languageVersion.set(JavaLanguageVersion.of(11)) }
}
tasks.withType<Test>().configureEach {
testLogging { events(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED) }
}