@@ -3,8 +3,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
3
3
4
4
plugins {
5
5
kotlin(" multiplatform" ) version " 1.5.31"
6
- jacoco
7
- id(" com.diffplug.spotless" ) version " 5.17.0"
6
+ id(" com.diffplug.spotless" ) version " 5.17.1"
8
7
id(" maven-publish" )
9
8
id(" com.vanniktech.maven.publish" ) version " 0.18.0"
10
9
}
@@ -15,20 +14,11 @@ version = "0.0.7-SNAPSHOT"
15
14
repositories {
16
15
google()
17
16
mavenCentral()
18
- }
19
-
20
- jacoco {
21
- toolVersion = " 0.8.6"
22
- }
23
-
24
- tasks.withType<JacocoReport > {
25
- reports {
26
- xml.isEnabled = true
27
- }
28
- dependsOn(tasks.withType<Test >())
17
+ gradlePluginPortal()
29
18
}
30
19
31
20
val kotlinCoroutinesVersion = " 1.5.2"
21
+ val ktlintVersion = " 0.43.0"
32
22
33
23
kotlin {
34
24
explicitApi()
@@ -37,10 +27,6 @@ kotlin {
37
27
compilations.all {
38
28
kotlinOptions.jvmTarget = " 1.8"
39
29
}
40
- testRuns[" test" ].executionTask.configure {
41
- useJUnit()
42
- finalizedBy(tasks.withType<JacocoReport >())
43
- }
44
30
}
45
31
js(BOTH ) {
46
32
compilations.all {
@@ -82,7 +68,6 @@ kotlin {
82
68
watchosX64()
83
69
watchosX86()
84
70
85
-
86
71
sourceSets {
87
72
val commonMain by getting {
88
73
dependencies {
@@ -93,18 +78,22 @@ kotlin {
93
78
dependencies {
94
79
implementation(kotlin(" test-common" ))
95
80
implementation(kotlin(" test-annotations-common" ))
96
- implementation(" app.cash.turbine:turbine :0.6.1 " )
81
+ implementation(" org.jetbrains.kotlinx:atomicfu :0.16.3 " )
97
82
}
98
83
}
99
- val jvmMain by getting
84
+ val jvmMain by getting {
85
+ dependsOn(commonMain)
86
+ }
100
87
val jvmTest by getting {
101
88
dependsOn(commonTest)
102
89
103
90
dependencies {
104
91
implementation(kotlin(" test-junit" ))
105
92
}
106
93
}
107
- val jsMain by getting
94
+ val jsMain by getting {
95
+ dependsOn(commonMain)
96
+ }
108
97
val jsTest by getting {
109
98
dependencies {
110
99
implementation(kotlin(" test-js" ))
@@ -113,6 +102,13 @@ kotlin {
113
102
114
103
val nativeMain by creating {
115
104
dependsOn(commonMain)
105
+ dependencies {
106
+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion " ) {
107
+ version {
108
+ strictly(kotlinCoroutinesVersion)
109
+ }
110
+ }
111
+ }
116
112
}
117
113
val nativeTest by creating {
118
114
dependsOn(commonTest)
@@ -162,17 +158,32 @@ spotless {
162
158
kotlin {
163
159
target(" **/*.kt" )
164
160
165
- ktlint(" 0.37.2 " ).userData(
161
+ ktlint(ktlintVersion ).userData(
166
162
mapOf (
167
163
// TODO this should all come from editorconfig https://github.com/diffplug/spotless/issues/142
168
164
" indent_size" to " 2" ,
169
- " kotlin_imports_layout " to " ascii " ,
165
+ " ij_kotlin_imports_layout " to " * " ,
170
166
)
171
167
)
168
+
169
+ trimTrailingWhitespace()
170
+ indentWithSpaces()
171
+ endWithNewline()
172
172
}
173
173
174
174
kotlinGradle {
175
175
target(" **/*.kts" )
176
+
177
+ ktlint(ktlintVersion).userData(
178
+ mapOf (
179
+ " indent_size" to " 4" ,
180
+ " ij_kotlin_imports_layout" to " *" ,
181
+ )
182
+ )
183
+
184
+ trimTrailingWhitespace()
185
+ indentWithSpaces()
186
+ endWithNewline()
176
187
}
177
188
}
178
189
@@ -182,4 +193,4 @@ allprojects {
182
193
sonatypeHost = com.vanniktech.maven.publish.SonatypeHost .S01
183
194
}
184
195
}
185
- }
196
+ }
0 commit comments