This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
173 lines (153 loc) · 4.58 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest
plugins {
id("com.android.library") version libs.versions.android.tools.gradle
kotlin("multiplatform") version libs.versions.kotlin
alias(libs.plugins.versioning)
alias(libs.plugins.kotlin.serialization)
id("maven-publish")
id("signing")
}
group = "com.liftric"
version = with(versioning.info) {
if (branch == "HEAD" && dirty.not()) tag else full
}
kotlin {
ios()
iosSimulatorArm64()
android {
publishLibraryVariants("debug", "release")
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.atomicfu)
implementation(libs.multiplatform.settings)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation(libs.multiplatform.settings.test)
implementation(libs.kotlinx.coroutines.test)
}
}
val androidMain by getting
val androidTest by getting {
dependencies {
implementation(libs.roboelectric)
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
implementation(libs.androidx.test.core)
implementation(libs.androidx.test.runner)
implementation(libs.androidx.test.ext)
}
}
val iosMain by getting
val iosTest by getting
val iosSimulatorArm64Main by getting {
dependsOn(iosMain)
}
val iosSimulatorArm64Test by getting {
dependsOn(iosTest)
}
all {
languageSettings {
optIn("kotlinx.serialization.ExperimentalSerializationApi")
optIn("kotlin.RequiresOptIn")
}
}
}
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of("11"))
}
}
android {
compileSdk = 33
namespace = "com.liftric.job.queue"
defaultConfig {
minSdk = 21
targetSdk = 33
testInstrumentationRunner = "androidx.test.runner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
testOptions {
unitTests {
isReturnDefaultValues = true
}
}
publishing {
multipleVariants {
withSourcesJar()
withJavadocJar()
allVariants()
}
}
}
tasks {
withType<KotlinNativeSimulatorTest> {
deviceId = "iPhone 14"
}
withType(JavaCompile::class) {
options.release.set(11)
}
}
val ossrhUsername: String? by project
val ossrhPassword: String? by project
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
publishing {
repositories {
maven {
name = "sonatype"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
publications.withType<MavenPublication> {
artifact(javadocJar.get())
pom {
name.set(project.name)
description.set("Persistable coroutine job queue for Kotlin Multiplatform projects.")
url.set("https://github.com/Liftric/kmm-job-queue")
licenses {
license {
name.set("MIT")
url.set("https://github.com/Liftric/kmm-job-queue/blob/master/LICENSE")
}
}
developers {
developer {
id.set("gaebel")
name.set("Jan Gaebel")
email.set("gaebel@liftric.com")
}
}
scm {
url.set("https://github.com/Liftric/kmm-job-queue")
}
}
}
}
afterEvaluate {
project.publishing.publications.withType(MavenPublication::class.java).forEach {
it.groupId = group.toString()
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}