-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
113 lines (101 loc) · 3.12 KB
/
build.gradle
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
buildscript {
ext.kotlin_version = '1.3.41'
ext.serialization_version = '0.11.1'
ext.ktor_version = '1.2.2'
ext.sqldelight_version = '1.1.4'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "com.squareup.sqldelight:gradle-plugin:$sqldelight_version"
classpath 'co.touchlab:kotlinxcodesync:0.1.5'
}
}
repositories {
jcenter()
google()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
group 'com.example'
version '0.0.1'
apply plugin: 'kotlin-multiplatform' //for multiplatform projects
apply plugin: 'kotlinx-serialization'
apply plugin: 'maven-publish'
apply plugin: "com.squareup.sqldelight"
apply plugin: 'co.touchlab.kotlinxcodesync'
kotlin {
//jvm()
// This is for iPhone emulator
// Switch here to iosArm64 (or iosArm32) to build library for iPhone device
iosX64("ios") {
binaries {
framework()
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
implementation "io.ktor:ktor-client-core:$ktor_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version"
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
// jvmMain {
// dependencies {
// implementation kotlin('stdlib')
// }
// }
// jvmTest {
// dependencies {
// implementation kotlin('test')
// implementation kotlin('test-junit')
// }
// }
iosMain {
dependencies {
implementation "io.ktor:ktor-client-ios:$ktor_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version"
implementation "com.squareup.sqldelight:ios-driver:$sqldelight_version"
}
}
iosTest {
}
}
}
sqldelight {
MyDatabase {
packageName = "db"
// By default this is ["sqldelight"], and means your sqldelight will be in
// folders like 'src/main/db' instead of 'src/main/sqldelight'
//sourceFolders = ["db"]
}
}
xcode {
projectPath = "./iOSapp/meetup.xcodeproj"
target = "meetup"
}
task iosTest {
def device = project.findProperty("iosDevice")?.toString() ?: "iPhone 8"
dependsOn kotlin.targets.ios.binaries.getTest('DEBUG').linkTaskName
group = JavaBasePlugin.VERIFICATION_GROUP
description = "Runs tests for target 'ios' on an iOS simulator"
doLast {
def binary = kotlin.targets.ios.binaries.getTest('DEBUG').outputFile
exec {
commandLine 'xcrun', 'simctl', 'spawn', device, binary.absolutePath
}
}
}
configurations {
compileClasspath
}