-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
190 lines (160 loc) · 5.39 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
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.multiplatform'
id 'kotlinx-atomicfu'
id 'org.jetbrains.kotlin.plugin.serialization'
id 'maven-publish'
}
group rootProject.group
version rootProject.version
repositories {
mavenCentral()
}
android {
compileSdk rootProject.ext.version_android_compile_sdk
sourceSets.main.manifest.srcFile('src/androidMain/AndroidManifest.xml')
defaultConfig {
minSdkVersion 21
targetSdkVersion rootProject.ext.version_android_target_sdk
}
//As per https://developer.android.com/build/jdks
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildTypes {
release {
consumerProguardFiles 'proguard-rules.pro'
}
}
namespace 'com.ustadmobile.door.runtime'
}
kotlin {
//This is essential: if this is removed, then expect/actual typealias resolution breaks on Android compilation.
androidTarget {
publishLibraryVariants("release", "debug")
}
//As per https://developer.android.com/build/jdks#toolchain
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
jvm {
compilations.all {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17
}
testRuns["test"].executionTask.configure {
useJUnit()
}
}
js(IR) {
browser {
testTask {
useKarma {
useChromeHeadless()
/* This is not supported from Kotlin 1.8
* webpackConfig.cssSupport.enabled = true
*/
}
}
}
}
/* Targets configuration omitted.
* To find out how to configure the targets, please follow the link:
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */
sourceSets {
commonMain {
dependencies {
api libs.paging.multiplatform.common
implementation project(":room-annotations")
implementation kotlin("stdlib-common")
implementation libs.ktor.client.core
implementation libs.ktor.client.json
implementation libs.napier
implementation libs.kotlinx.serialization.json
implementation libs.kodein.di
implementation libs.kotlinx.atomicfu
implementation libs.kotlinx.coroutines.core
}
}
commonTest {
dependencies {
implementation kotlin("test-common")
implementation kotlin("test-annotations-common")
}
}
roomAnnotations {
}
commonJvmMain {
dependsOn commonMain
dependencies {
implementation libs.okhttp
implementation libs.okhttp.sse
compileOnly libs.nanohttpd
compileOnly libs.nanohttpd.nanolets
}
}
androidMain {
dependsOn commonJvmMain
dependencies {
implementation project(":room-annotations")
implementation libs.androidx.room.runtime
implementation libs.androidx.room.ktx
implementation libs.androidx.paging.runtime
implementation libs.androidx.core.ktx
implementation libs.okhttp
implementation libs.okhttp.sse
}
}
commonJvmJs {
dependsOn commonMain
dependencies {
implementation kotlin("stdlib-common")
}
}
jvmMain {
dependsOn roomAnnotations
dependsOn commonJvmMain
dependsOn commonJvmJs
dependencies {
implementation libs.kodein.di.framework.ktor.server
implementation libs.sqlite.jdbc
compileOnly libs.postgres.jdbc
implementation libs.ktor.server.core
implementation libs.okhttp
implementation libs.okhttp.sse
implementation libs.kotlin.reflect
implementation libs.hikaricp
}
}
jvmTest {
dependencies {
implementation kotlin("test-junit")
implementation libs.mockito.kotlin
implementation libs.sqlite.jdbc
implementation libs.mockwebserver
implementation libs.ktor.server
implementation libs.ktor.client.core
implementation libs.ktor.server.core
implementation libs.ktor.server.netty
implementation libs.ktor.server.content.negotiation
implementation libs.ktor.client.content.negotiation
implementation libs.ktor.serialization.kotlinx.json
implementation libs.ktor.client.okhttp
implementation libs.ktor.server.test.host
implementation libs.turbine
}
}
jsMain {
dependsOn roomAnnotations
dependsOn commonJvmJs
dependencies {
implementation libs.kotlin.wrappers.kotlin.extensions
}
}
jsTest {
dependencies {
implementation kotlin("test-js")
}
}
}
}