-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
114 lines (95 loc) · 2.4 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
kotlin("multiplatform")
id("com.android.library")
kotlin("plugin.serialization")
`maven-publish`
signing
}
description = "Runtime for Twirp service generator PBandK plugin for use in Kotlin Multiplatform projects."
kotlin {
explicitApi()
androidTarget {
publishAllLibraryVariants()
}
jvm()
js {
browser {}
nodejs {}
}
// Native targets, according to https://kotlinlang.org/docs/native-target-support.html
// Tier 1
macosX64()
macosArm64()
iosSimulatorArm64()
iosX64()
// Tier 2
linuxX64()
linuxArm64()
// watchosSimulatorArm64()
// watchosX64()
// watchosArm32()
// watchosArm64()
tvosSimulatorArm64()
tvosX64()
tvosArm64()
iosArm64()
// Tier 3
// androidNativeArm32()
// androidNativeArm64()
// androidNativeX86()
// androidNativeX64()
mingwX64()
// watchosDeviceArm64()
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
).forEach {
it.binaries.framework {
baseName = "twirp-kmp-runtime"
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.auth)
implementation(libs.kotlinx.serialization.core)
implementation(libs.kotlinx.serialization.json)
}
}
val commonTest by getting {
dependencies {
implementation(libs.kotlin.test)
}
}
}
}
android {
compileSdk = 34
defaultConfig {
minSdk = 23
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
namespace = "com.collectiveidea.twirp"
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8)
}
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
publishing {
publications.withType<MavenPublication> {
artifact(javadocJar.get())
configureTwirpKmpPOM(project.description!!)
}
}
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
}