mirror of
https://github.com/JakeWharton/mosaic.git
synced 2025-11-01 20:20:19 +08:00
Fix programatic source set dependencies
This ensures that HMPP can correctly see our hierarchy and match it to our dependencies.
This commit is contained in:
committed by
Jake Wharton
parent
64a3a6ea62
commit
cfc92c4b98
@ -1,4 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget
|
||||
|
||||
apply plugin: 'org.jetbrains.kotlin.multiplatform'
|
||||
apply from: "$rootDir/addAllTargets.gradle"
|
||||
@ -37,11 +38,12 @@ kotlin {
|
||||
}
|
||||
|
||||
targets.each { target ->
|
||||
if (target instanceof KotlinMetadataTarget) return
|
||||
if (target.platformType != KotlinPlatformType.jvm) {
|
||||
target.compilations.main.source(sourceSets.nonJvmMain)
|
||||
target.compilations.main.defaultSourceSet.dependsOn(sourceSets.nonJvmMain)
|
||||
}
|
||||
if (target.platformType == KotlinPlatformType.native) {
|
||||
target.compilations.main.source(sourceSets.concurrentMain)
|
||||
target.compilations.main.defaultSourceSet.dependsOn(sourceSets.concurrentMain)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,9 @@
|
||||
package com.jakewharton.mosaic
|
||||
|
||||
expect fun runMosaicBlocking(body: suspend MosaicScope.() -> Unit)
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
fun runMosaicBlocking(body: suspend MosaicScope.() -> Unit) {
|
||||
runBlocking {
|
||||
runMosaic(body)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
package com.jakewharton.mosaic
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
actual fun runMosaicBlocking(body: suspend MosaicScope.() -> Unit) {
|
||||
runBlocking {
|
||||
runMosaic(body)
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
package com.jakewharton.mosaic
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
actual fun runMosaicBlocking(body: suspend MosaicScope.() -> Unit) {
|
||||
runBlocking {
|
||||
runMosaic(body)
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
package com.jakewharton.mosaic
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
actual fun runMosaicBlocking(body: suspend MosaicScope.() -> Unit) {
|
||||
runBlocking {
|
||||
runMosaic(body)
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
package com.jakewharton.mosaic
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
actual fun runMosaicBlocking(body: suspend MosaicScope.() -> Unit) {
|
||||
runBlocking {
|
||||
runMosaic(body)
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
package com.jakewharton.mosaic
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
actual fun runMosaicBlocking(body: suspend MosaicScope.() -> Unit) {
|
||||
runBlocking {
|
||||
runMosaic(body)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user