forked from ctripcorp/SQLlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
133 lines (115 loc) · 3.29 KB
/
build.gradle.kts
File metadata and controls
133 lines (115 loc) · 3.29 KB
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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.konan.target.HostManager
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlinx.serialization)
alias(libs.plugins.android.library)
alias(libs.plugins.ksp)
alias(libs.plugins.vanniktech.maven.publish)
}
val GROUP_ID: String by project
val VERSION: String by project
group = GROUP_ID
version = VERSION
kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())
androidTarget {
publishLibraryVariants("release")
}
jvm {
compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
}
iosX64()
iosArm64()
iosSimulatorArm64()
macosX64()
macosArm64()
watchosArm32()
watchosArm64()
watchosX64()
watchosSimulatorArm64()
watchosDeviceArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
linuxX64()
linuxArm64()
mingwX64()
compilerOptions {
freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters", "-Xnested-type-aliases")
}
sourceSets {
all {
languageSettings {
optIn("kotlin.RequiresOptIn")
}
}
commonMain.dependencies {
api(project(":sqllin-driver"))
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.coroutines.core)
}
}
}
gradle.taskGraph.whenReady {
if (!project.hasProperty("onCICD"))
return@whenReady
tasks.forEach {
when {
it.name.contains("linux", true) -> it.enabled = HostManager.hostIsLinux
it.name.contains("mingw", true) -> it.enabled = HostManager.hostIsMingw
it.name.contains("ios", true)
|| it.name.contains("macos", true)
|| it.name.contains("watchos", true)
|| it.name.contains("tvos", true) -> it.enabled = HostManager.hostIsMac
}
}
}
android {
namespace = "com.ctrip.sqllin.dsl"
compileSdk = libs.versions.android.sdk.compile.get().toInt()
defaultConfig {
minSdk = libs.versions.android.sdk.min.get().toInt()
}
}
mavenPublishing {
publishToMavenCentral()
signAllPublications()
val artifactId = "sqllin-dsl"
coordinates(
groupId = GROUP_ID,
artifactId = artifactId,
version = VERSION,
)
pom {
name.set(artifactId)
description.set("SQL DSL APIs for SQLite on Kotlin Multiplatform")
val githubURL: String by project
url.set(githubURL)
licenses {
license {
val licenseName: String by project
name.set(licenseName)
val licenseURL: String by project
url.set(licenseURL)
}
}
developers {
developer {
val developerID: String by project
id.set(developerID)
val developerName: String by project
name.set(developerName)
val developerEmail: String by project
email.set(developerEmail)
}
}
scm {
url.set(githubURL)
val scmURL: String by project
connection.set(scmURL)
developerConnection.set(scmURL)
}
}
}