@@ -56,7 +56,6 @@ android {
56
56
}
57
57
defaultConfig {
58
58
minSdk = 23
59
- targetSdk = 31
60
59
setCompileSdkVersion(30 )
61
60
testInstrumentationRunner = " android.support.test.runner.AndroidJUnitRunner"
62
61
}
@@ -138,9 +137,18 @@ kotlin {
138
137
mavenPublication { setupPom(artifactId) }
139
138
}
140
139
141
- ios {
140
+ iosX64 {
142
141
binaries { framework { baseName = " spotify" } }
142
+ mavenPublication { setupPom(artifactId) }
143
+ }
144
+
145
+ iosArm64 {
146
+ binaries { framework { baseName = " spotify" } }
147
+ mavenPublication { setupPom(artifactId) }
148
+ }
143
149
150
+ iosSimulatorArm64 {
151
+ binaries { framework { baseName = " spotify" } }
144
152
mavenPublication { setupPom(artifactId) }
145
153
}
146
154
@@ -158,146 +166,145 @@ kotlin {
158
166
mavenPublication { setupPom(artifactId) }
159
167
}*/
160
168
161
- targets {
162
- sourceSets {
163
- val kotlinxDatetimeVersion : String by project
164
- val kotlinxSerializationVersion : String by project
165
- val kotlinxCoroutinesVersion : String by project
166
- val ktorVersion : String by project
167
-
168
- val sparkVersion : String by project
169
- val korlibsVersion : String by project
170
-
171
- val commonMain by getting {
172
- dependencies {
173
- implementation( " org.jetbrains.kotlinx:kotlinx-serialization-json: $kotlinxSerializationVersion " )
174
- implementation(" io.ktor:ktor-client-core: $ktorVersion " )
175
- implementation(" com.soywiz.korlibs.krypto:krypto: $korlibsVersion " )
176
- implementation(" com.soywiz.korlibs.korim:korim :$korlibsVersion " )
177
- implementation(" org.jetbrains.kotlinx:kotlinx-datetime: $kotlinxDatetimeVersion " )
178
- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core: $kotlinxCoroutinesVersion " )
179
- }
169
+ applyDefaultHierarchyTemplate()
170
+
171
+ sourceSets {
172
+ val kotlinxDatetimeVersion : String by project
173
+ val kotlinxSerializationVersion : String by project
174
+ val kotlinxCoroutinesVersion : String by project
175
+ val ktorVersion : String by project
176
+
177
+ val sparkVersion : String by project
178
+ val korlibsVersion : String by project
179
+
180
+ commonMain {
181
+ dependencies {
182
+ implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json: $kotlinxSerializationVersion " )
183
+ implementation(" io.ktor:ktor-client-core: $ktorVersion " )
184
+ implementation(" com.soywiz.korlibs.krypto:krypto :$korlibsVersion " )
185
+ implementation(" com.soywiz.korlibs.korim:korim: $korlibsVersion " )
186
+ implementation(" org.jetbrains.kotlinx:kotlinx-datetime: $kotlinxDatetimeVersion " )
187
+ implementation( " org.jetbrains.kotlinx:kotlinx-coroutines-core: $kotlinxCoroutinesVersion " )
180
188
}
189
+ }
181
190
182
- val commonTest by getting {
183
- dependencies {
184
- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion " )
185
- implementation(kotlin(" test-common" ))
186
- implementation(kotlin(" test-annotations-common" ))
187
- }
191
+ commonTest {
192
+ dependencies {
193
+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion " )
194
+ implementation(kotlin(" test-common" ))
195
+ implementation(kotlin(" test-annotations-common" ))
188
196
}
197
+ }
189
198
190
- val commonJvmLikeMain by creating {
191
- dependsOn(commonMain)
199
+ val commonJvmLikeMain by creating {
200
+ dependsOn(commonMain.get() )
192
201
193
- dependencies {
194
- implementation(" net.sourceforge.streamsupport:android-retrofuture:1.7.3" )
195
- }
202
+ dependencies {
203
+ implementation(" net.sourceforge.streamsupport:android-retrofuture:1.7.3" )
196
204
}
205
+ }
197
206
198
- val commonJvmLikeTest by creating {
199
- dependencies {
200
- implementation(kotlin(" test-junit" ))
201
- implementation(" com.sparkjava:spark-core:$sparkVersion " )
202
- runtimeOnly(kotlin(" reflect" ))
203
- }
207
+ val commonJvmLikeTest by creating {
208
+ dependencies {
209
+ implementation(kotlin(" test-junit" ))
210
+ implementation(" com.sparkjava:spark-core:$sparkVersion " )
211
+ runtimeOnly(kotlin(" reflect" ))
204
212
}
213
+ }
205
214
206
- val commonNonJvmTargetsTest by creating {
207
- dependsOn(commonTest)
208
- }
215
+ val commonNonJvmTargetsTest by creating {
216
+ dependsOn(commonTest.get() )
217
+ }
209
218
210
- val jvmMain by getting {
211
- dependsOn(commonJvmLikeMain)
212
- repositories {
213
- mavenCentral()
214
- }
219
+ jvmMain {
220
+ dependsOn(commonJvmLikeMain)
215
221
216
- dependencies {
217
- implementation(" io.ktor:ktor-client-cio:$ktorVersion " )
218
- }
222
+ repositories {
223
+ mavenCentral()
219
224
}
220
225
221
- val jvmTest by getting {
222
- dependsOn(commonJvmLikeTest )
226
+ dependencies {
227
+ implementation( " io.ktor:ktor-client-cio: $ktorVersion " )
223
228
}
229
+ }
224
230
225
- val jsMain by getting {
226
- dependencies {
227
- implementation(" io.ktor:ktor-client-js:$ktorVersion " )
228
- implementation(kotlin(" stdlib-js" ))
229
- }
231
+ jvmTest.get().dependsOn(commonJvmLikeTest)
232
+
233
+ jsMain {
234
+ dependencies {
235
+ implementation(" io.ktor:ktor-client-js:$ktorVersion " )
236
+ implementation(kotlin(" stdlib-js" ))
230
237
}
238
+ }
231
239
232
- val jsTest by getting {
233
- dependsOn(commonNonJvmTargetsTest)
240
+ jsTest {
241
+ dependsOn(commonNonJvmTargetsTest)
234
242
235
- dependencies {
236
- implementation(kotlin(" test-js" ))
237
- }
243
+ dependencies {
244
+ implementation(kotlin(" test-js" ))
238
245
}
246
+ }
239
247
240
- val androidMain by getting {
241
- dependsOn(commonJvmLikeMain)
248
+ androidMain {
249
+ dependsOn(commonJvmLikeMain)
242
250
243
- repositories {
244
- mavenCentral()
245
- }
251
+ repositories {
252
+ mavenCentral()
253
+ }
246
254
247
- dependencies {
248
- val androidSpotifyAuthVersion: String by project
249
- val androidCryptoVersion: String by project
250
- val androidxCompatVersion: String by project
255
+ dependencies {
256
+ val androidSpotifyAuthVersion: String by project
257
+ val androidCryptoVersion: String by project
258
+ val androidxCompatVersion: String by project
251
259
252
- api(" com.spotify.android:auth:$androidSpotifyAuthVersion " )
253
- implementation(" io.ktor:ktor-client-okhttp:$ktorVersion " )
254
- implementation(" androidx.security:security-crypto:$androidCryptoVersion " )
255
- implementation(" androidx.appcompat:appcompat:$androidxCompatVersion " )
256
- }
260
+ api(" com.spotify.android:auth:$androidSpotifyAuthVersion " )
261
+ implementation(" io.ktor:ktor-client-okhttp:$ktorVersion " )
262
+ implementation(" androidx.security:security-crypto:$androidCryptoVersion " )
263
+ implementation(" androidx.appcompat:appcompat:$androidxCompatVersion " )
257
264
}
265
+ }
258
266
259
- val androidUnitTest by getting {
260
- dependsOn(commonJvmLikeTest)
261
- }
267
+ val androidUnitTest by getting {
268
+ dependsOn(commonJvmLikeTest)
269
+ }
262
270
263
- // as kotlin/native, they require special ktor versions
264
- val desktopMain by creating {
265
- dependsOn(commonMain)
271
+ // desktop targets
272
+ // as kotlin/native, they require special ktor versions
273
+ val desktopMain by creating {
274
+ dependsOn(commonMain.get())
266
275
267
- dependencies {
268
- implementation(" io.ktor:ktor-client-curl:$ktorVersion " )
269
- }
276
+ dependencies {
277
+ implementation(" io.ktor:ktor-client-curl:$ktorVersion " )
270
278
}
279
+ }
271
280
272
- val nativeDarwinMain by creating {
273
- dependsOn(commonMain)
281
+ linuxMain.get().dependsOn(desktopMain)
282
+ mingwMain.get().dependsOn(desktopMain)
283
+ macosMain.get().dependsOn(desktopMain)
274
284
275
- dependencies {
276
- implementation(" io.ktor:ktor-client-ios:$ktorVersion " )
277
- }
285
+ val desktopTest by creating { dependsOn(commonNonJvmTargetsTest) }
286
+ linuxTest.get().dependsOn(desktopTest)
287
+ mingwTest.get().dependsOn(desktopTest)
288
+ macosTest.get().dependsOn(desktopTest)
289
+
290
+ // darwin targets
291
+
292
+ val nativeDarwinMain by creating {
293
+ dependsOn(commonMain.get())
294
+
295
+ dependencies {
296
+ implementation(" io.ktor:ktor-client-ios:$ktorVersion " )
278
297
}
298
+ }
299
+
300
+ val nativeDarwinTest by creating { dependsOn(commonNonJvmTargetsTest) }
301
+
302
+ iosMain.get().dependsOn(nativeDarwinMain)
303
+ iosTest.get().dependsOn(nativeDarwinTest)
279
304
280
- // desktop targets
281
- val desktopTest by creating { dependsOn(commonNonJvmTargetsTest) }
282
- val linuxX64Main by getting { dependsOn(desktopMain) }
283
- val linuxX64Test by getting { dependsOn(desktopTest) }
284
- val mingwX64Main by getting { dependsOn(desktopMain) }
285
- val mingwX64Test by getting { dependsOn(desktopTest) }
286
- val macosX64Main by getting { dependsOn(desktopMain) }
287
- val macosX64Test by getting { dependsOn(desktopTest) }
288
-
289
- // darwin targets
290
- val nativeDarwinTest by creating { dependsOn(commonNonJvmTargetsTest) }
291
- val iosMain by getting { dependsOn(nativeDarwinMain) }
292
- val iosTest by getting { dependsOn(nativeDarwinTest) }
293
-
294
- // !! unable to include currently due to korlibs not being available !!
295
- // val tvosMain by getting { dependsOn(nativeDarwinMain) }
296
- // val tvosTest by getting { dependsOn(nativeDarwinTest) }
297
- // val watchosMain by getting { dependsOn(nativeDarwinMain) }
298
- // val watchosTest by getting { dependsOn(nativeDarwinTest) }
299
-
300
- all { languageSettings.optIn(" kotlin.RequiresOptIn" ) }
305
+ all {
306
+ languageSettings.optIn(" kotlin.RequiresOptIn" )
307
+ languageSettings.optIn(" kotlinx.serialization.ExperimentalSerializationApi" )
301
308
}
302
309
}
303
310
@@ -307,7 +314,7 @@ kotlin {
307
314
}
308
315
309
316
tasks {
310
- val dokkaHtml by getting( DokkaTask :: class ) {
317
+ dokkaHtml {
311
318
outputDirectory.set(projectDir.resolve(" docs" ))
312
319
313
320
dokkaSourceSets {
@@ -352,7 +359,7 @@ tasks {
352
359
val framework = kotlin.targets.getByName<KotlinNativeTarget >(targetName).binaries.getFramework(mode)
353
360
inputs.property(" mode" , mode)
354
361
dependsOn(framework.linkTask)
355
- val targetDir = File (buildDir , " xcode-frameworks" )
362
+ val targetDir = File (layout.buildDirectory.asFile.get() , " xcode-frameworks" )
356
363
from({ framework.outputDirectory })
357
364
into(targetDir)
358
365
}
0 commit comments