@@ -6,6 +6,7 @@ import java.io.ByteArrayOutputStream
6
6
import java.io.PrintWriter
7
7
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
8
8
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
9
+ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
9
10
import org.jetbrains.kotlin.konan.target.Family
10
11
11
12
plugins {
@@ -32,57 +33,65 @@ java {
32
33
toolchain { languageVersion.set(JavaLanguageVersion .of(mainJavaToolchainVersion)) }
33
34
}
34
35
35
- kotlin {
36
- explicitApi()
37
-
38
- infra {
39
- common(" tzfile" ) {
40
- // Tiers are in accordance with <https://kotlinlang.org/docs/native-target-support.html>
41
- common(" tzdbOnFilesystem" ) {
42
- common(" linux" ) {
43
- // Tier 1
44
- target(" linuxX64" )
45
- // Tier 2
46
- target(" linuxArm64" )
47
- // Tier 4 (deprecated, but still in demand)
48
- target(" linuxArm32Hfp" )
49
- }
50
- common(" darwin" ) {
51
- common(" darwinDevices" ) {
52
- // Tier 1
53
- target(" macosX64" )
54
- target(" macosArm64" )
55
- // Tier 2
56
- target(" watchosX64" )
57
- target(" watchosArm32" )
58
- target(" watchosArm64" )
59
- target(" tvosX64" )
60
- target(" tvosArm64" )
61
- target(" iosArm64" )
62
- // Tier 3
63
- target(" watchosDeviceArm64" )
64
- }
65
- common(" darwinSimulator" ) {
66
- // Tier 1
67
- target(" iosSimulatorArm64" )
68
- target(" iosX64" )
69
- // Tier 2
70
- target(" watchosSimulatorArm64" )
71
- target(" tvosSimulatorArm64" )
72
- }
73
- }
36
+ fun NamedDomainObjectContainer<KotlinSourceSet>.groupSourceSets (
37
+ groupName : String ,
38
+ reverseDependencies : List <String >,
39
+ dependencies : List <String >
40
+ ) {
41
+ val sourceSetSuffixes = listOf (" Main" , " Test" )
42
+ for (suffix in sourceSetSuffixes) {
43
+ register(groupName + suffix) {
44
+ for (dep in dependencies) {
45
+ dependsOn(get(dep + suffix))
74
46
}
75
- common(" androidNative" ) {
76
- target(" androidNativeArm32" )
77
- target(" androidNativeArm64" )
78
- target(" androidNativeX86" )
79
- target(" androidNativeX64" )
47
+ for (revDep in reverseDependencies) {
48
+ get(revDep + suffix).dependsOn(this )
80
49
}
81
50
}
82
- // Tier 3
83
- common(" windows" ) {
84
- target(" mingwX64" )
85
- }
51
+ }
52
+ }
53
+
54
+ kotlin {
55
+ explicitApi()
56
+
57
+ linuxX64()
58
+ linuxArm64()
59
+ @Suppress(" DEPRECATION" )
60
+ linuxArm32Hfp()
61
+ mingwX64()
62
+ macosX64()
63
+ macosArm64()
64
+ iosX64()
65
+ iosArm64()
66
+ iosSimulatorArm64()
67
+ watchosArm32()
68
+ watchosArm64()
69
+ watchosX64()
70
+ watchosSimulatorArm64()
71
+ watchosDeviceArm64()
72
+ tvosArm64()
73
+ tvosX64()
74
+ tvosSimulatorArm64()
75
+ androidNativeArm32()
76
+ androidNativeArm64()
77
+ androidNativeX86()
78
+ androidNativeX64()
79
+
80
+ sourceSets {
81
+ groupSourceSets(" linux" , listOf (" linuxX64" , " linuxArm64" , " linuxArm32Hfp" ), emptyList())
82
+ groupSourceSets(" darwinDevices" ,
83
+ listOf (" macosX64" , " macosArm64" , " watchosX64" , " watchosArm32" , " watchosArm64" , " tvosX64" , " tvosArm64" , " iosArm64" ),
84
+ listOf ()
85
+ )
86
+ groupSourceSets(" darwinSimulator" ,
87
+ listOf (" iosSimulatorArm64" , " iosX64" , " watchosSimulatorArm64" , " tvosSimulatorArm64" ),
88
+ listOf ()
89
+ )
90
+ groupSourceSets(" darwin" , listOf (" darwinDevices" , " darwinSimulator" ), emptyList())
91
+ groupSourceSets(" tzdbOnFilesystem" , listOf (" linux" , " darwin" ), emptyList())
92
+ groupSourceSets(" androidNative" , listOf (" androidNativeArm32" , " androidNativeArm64" , " androidNativeX86" , " androidNativeX64" ), listOf ())
93
+ groupSourceSets(" tzfile" , listOf (" tzdbOnFilesystem" , " androidNative" ), listOf (" native" ))
94
+ groupSourceSets(" windows" , listOf (" mingwX64" ), listOf (" native" ))
86
95
}
87
96
88
97
jvm {
@@ -107,7 +116,6 @@ kotlin {
107
116
kotlinOptions {
108
117
sourceMap = true
109
118
moduleKind = " umd"
110
- metaInfo = true
111
119
}
112
120
}
113
121
// compilations["main"].apply {
@@ -165,7 +173,6 @@ kotlin {
165
173
commonMain {
166
174
dependencies {
167
175
compileOnly(" org.jetbrains.kotlinx:kotlinx-serialization-core:$serializationVersion " )
168
- api(project(" :fake-kotlinx-time" ))
169
176
}
170
177
}
171
178
@@ -248,6 +255,10 @@ kotlin {
248
255
val darwinTest by getting {
249
256
}
250
257
}
258
+
259
+ compilerOptions {
260
+ optIn.add(" kotlin.time.ExperimentalTime" )
261
+ }
251
262
}
252
263
253
264
tasks {
0 commit comments