This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
76 lines (66 loc) · 1.69 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
import org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
plugins {
kotlin("multiplatform") version "1.4.20"
id("maven-publish")
id("com.android.library") version "4.0.2"
}
repositories {
mavenCentral()
}
group = "com.example"
version = "0.0.1"
kotlin {
android {
publishLibraryVariants("release", "debug")
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
}
ios {
binaries {
framework()
}
}
/**
* Other Apple Options– un-comment each to enable
*
* each target will need its own `binaries { framework() }` configuration
*/
//watchos()
//iosArm32()
//tvos()
sourceSets {
commonTest {
dependencies {
implementation(kotlin("test-multiplatform"))
}
}
val androidTest by getting {
dependencies {
// https://youtrack.jetbrains.com/issue/KT-41097
implementation(kotlin("test-junit"))
}
}
}
}
tasks.register("debugFatFramework", FatFrameworkTask::class) {
baseName = project.name
// Framework is output here
destinationDir = buildDir.resolve("fat-framework/debug")
val targets = mutableListOf(
kotlin.iosX64(),
kotlin.iosArm64()
)
/**
* Un-comment/modify to include additional targets
*
* targets.add(kotlin.iosArm32())
*/
// Specify the frameworks to be merged.
from(targets.map { it.binaries.getFramework(NativeBuildType.DEBUG) })
}
// Enough settings to gradle sync, but more can be added
android {
compileSdkVersion(29)
}