@@ -190,8 +190,7 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
190
190
iosArm64(" uikitArm64" )
191
191
iosSimulatorArm64(" uikitSimArm64" )
192
192
193
- val commonMain = sourceSets.getByName(" commonMain" )
194
- val nativeMain = sourceSets.create(" nativeMain" )
193
+ val nativeMain = getOrCreateNativeMain()
195
194
val darwinMain = sourceSets.create(" darwinMain" )
196
195
val macosMain = sourceSets.create(" macosMain" )
197
196
val macosX64Main = sourceSets.getByName(" macosX64Main" )
@@ -200,7 +199,6 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
200
199
val uikitX64Main = sourceSets.getByName(" uikitX64Main" )
201
200
val uikitArm64Main = sourceSets.getByName(" uikitArm64Main" )
202
201
val uikitSimArm64Main = sourceSets.getByName(" uikitSimArm64Main" )
203
- nativeMain.dependsOn(commonMain)
204
202
darwinMain.dependsOn(nativeMain)
205
203
macosMain.dependsOn(darwinMain)
206
204
macosX64Main.dependsOn(macosMain)
@@ -210,8 +208,7 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
210
208
uikitArm64Main.dependsOn(uikitMain)
211
209
uikitSimArm64Main.dependsOn(uikitMain)
212
210
213
- val commonTest = sourceSets.getByName(" commonTest" )
214
- val nativeTest = sourceSets.create(" nativeTest" )
211
+ val nativeTest = getOrCreateNativeTest()
215
212
val darwinTest = sourceSets.create(" darwinTest" )
216
213
val macosTest = sourceSets.create(" macosTest" )
217
214
val macosX64Test = sourceSets.getByName(" macosX64Test" )
@@ -220,7 +217,6 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
220
217
val uikitX64Test = sourceSets.getByName(" uikitX64Test" )
221
218
val uikitArm64Test = sourceSets.getByName(" uikitArm64Test" )
222
219
val uikitSimArm64Test = sourceSets.getByName(" uikitSimArm64Test" )
223
- nativeTest.dependsOn(commonTest)
224
220
darwinTest.dependsOn(nativeTest)
225
221
macosTest.dependsOn(darwinTest)
226
222
macosX64Test.dependsOn(macosTest)
@@ -231,12 +227,25 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
231
227
uikitSimArm64Test.dependsOn(uikitTest)
232
228
}
233
229
234
- override fun linuxX64 (): Unit = multiplatformExtension.run {
230
+ override fun linux (): Unit = multiplatformExtension.run {
235
231
linuxX64()
236
- }
237
-
238
- override fun linuxArm64 (): Unit = multiplatformExtension.run {
239
232
linuxArm64()
233
+
234
+ val nativeMain = getOrCreateNativeMain()
235
+ val linuxMain = sourceSets.create(" linuxMain" )
236
+ val linuxX64Main = sourceSets.getByName(" linuxX64Main" )
237
+ val linuxArm64Main = sourceSets.getByName(" linuxArm64Main" )
238
+ linuxMain.dependsOn(nativeMain)
239
+ linuxX64Main.dependsOn(linuxMain)
240
+ linuxArm64Main.dependsOn(linuxMain)
241
+
242
+ val nativeTest = getOrCreateNativeTest()
243
+ val linuxTest = sourceSets.create(" linuxTest" )
244
+ val linuxX64Test = sourceSets.getByName(" linuxX64Test" )
245
+ val linuxArm64Test = sourceSets.getByName(" linuxArm64Test" )
246
+ linuxTest.dependsOn(nativeTest)
247
+ linuxX64Test.dependsOn(linuxTest)
248
+ linuxArm64Test.dependsOn(linuxTest)
240
249
}
241
250
242
251
private fun getOrCreateJvmMain (): KotlinSourceSet =
@@ -245,6 +254,12 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
245
254
private fun getOrCreateJvmTest (): KotlinSourceSet =
246
255
getOrCreateSourceSet(" jvmTest" , " commonTest" )
247
256
257
+ private fun getOrCreateNativeMain (): KotlinSourceSet =
258
+ getOrCreateSourceSet(" nativeMain" , " commonMain" )
259
+
260
+ private fun getOrCreateNativeTest (): KotlinSourceSet =
261
+ getOrCreateSourceSet(" nativeTest" , " commonTest" )
262
+
248
263
private fun getOrCreateSourceSet (
249
264
name : String ,
250
265
dependsOnSourceSetName : String
0 commit comments