@@ -206,8 +206,7 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
206
206
iosArm64(" uikitArm64" )
207
207
iosSimulatorArm64(" uikitSimArm64" )
208
208
209
- val commonMain = sourceSets.getByName(" commonMain" )
210
- val nativeMain = sourceSets.create(" nativeMain" )
209
+ val nativeMain = getOrCreateNativeMain()
211
210
val darwinMain = sourceSets.create(" darwinMain" )
212
211
val macosMain = sourceSets.create(" macosMain" )
213
212
val macosX64Main = sourceSets.getByName(" macosX64Main" )
@@ -216,7 +215,6 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
216
215
val uikitX64Main = sourceSets.getByName(" uikitX64Main" )
217
216
val uikitArm64Main = sourceSets.getByName(" uikitArm64Main" )
218
217
val uikitSimArm64Main = sourceSets.getByName(" uikitSimArm64Main" )
219
- nativeMain.dependsOn(commonMain)
220
218
darwinMain.dependsOn(nativeMain)
221
219
macosMain.dependsOn(darwinMain)
222
220
macosX64Main.dependsOn(macosMain)
@@ -226,8 +224,7 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
226
224
uikitArm64Main.dependsOn(uikitMain)
227
225
uikitSimArm64Main.dependsOn(uikitMain)
228
226
229
- val commonTest = sourceSets.getByName(" commonTest" )
230
- val nativeTest = sourceSets.create(" nativeTest" )
227
+ val nativeTest = getOrCreateNativeTest()
231
228
val darwinTest = sourceSets.create(" darwinTest" )
232
229
val macosTest = sourceSets.create(" macosTest" )
233
230
val macosX64Test = sourceSets.getByName(" macosX64Test" )
@@ -236,7 +233,6 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
236
233
val uikitX64Test = sourceSets.getByName(" uikitX64Test" )
237
234
val uikitArm64Test = sourceSets.getByName(" uikitArm64Test" )
238
235
val uikitSimArm64Test = sourceSets.getByName(" uikitSimArm64Test" )
239
- nativeTest.dependsOn(commonTest)
240
236
darwinTest.dependsOn(nativeTest)
241
237
macosTest.dependsOn(darwinTest)
242
238
macosX64Test.dependsOn(macosTest)
@@ -247,12 +243,25 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
247
243
uikitSimArm64Test.dependsOn(uikitTest)
248
244
}
249
245
250
- override fun linuxX64 (): Unit = multiplatformExtension.run {
246
+ override fun linux (): Unit = multiplatformExtension.run {
251
247
linuxX64()
252
- }
253
-
254
- override fun linuxArm64 (): Unit = multiplatformExtension.run {
255
248
linuxArm64()
249
+
250
+ val nativeMain = getOrCreateNativeMain()
251
+ val linuxMain = sourceSets.create(" linuxMain" )
252
+ val linuxX64Main = sourceSets.getByName(" linuxX64Main" )
253
+ val linuxArm64Main = sourceSets.getByName(" linuxArm64Main" )
254
+ linuxMain.dependsOn(nativeMain)
255
+ linuxX64Main.dependsOn(linuxMain)
256
+ linuxArm64Main.dependsOn(linuxMain)
257
+
258
+ val nativeTest = getOrCreateNativeTest()
259
+ val linuxTest = sourceSets.create(" linuxTest" )
260
+ val linuxX64Test = sourceSets.getByName(" linuxX64Test" )
261
+ val linuxArm64Test = sourceSets.getByName(" linuxArm64Test" )
262
+ linuxTest.dependsOn(nativeTest)
263
+ linuxX64Test.dependsOn(linuxTest)
264
+ linuxArm64Test.dependsOn(linuxTest)
256
265
}
257
266
258
267
private fun getOrCreateJvmMain (): KotlinSourceSet =
@@ -261,6 +270,12 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
261
270
private fun getOrCreateJvmTest (): KotlinSourceSet =
262
271
getOrCreateSourceSet(" jvmTest" , " commonTest" )
263
272
273
+ private fun getOrCreateNativeMain (): KotlinSourceSet =
274
+ getOrCreateSourceSet(" nativeMain" , " commonMain" )
275
+
276
+ private fun getOrCreateNativeTest (): KotlinSourceSet =
277
+ getOrCreateSourceSet(" nativeTest" , " commonTest" )
278
+
264
279
private fun getOrCreateSourceSet (
265
280
name : String ,
266
281
dependsOnSourceSetName : String
0 commit comments