@ -6,18 +6,15 @@ import org.jetbrains.compose.desktop.application.internal.JvmApplicationRuntimeF
import org.jetbrains.compose.desktop.preview.tasks.AbstractConfigureDesktopPreviewTask
import org.jetbrains.compose.desktop.preview.tasks.AbstractConfigureDesktopPreviewTask
import org.jetbrains.compose.internal.*
import org.jetbrains.compose.internal.*
import org.jetbrains.compose.internal.utils.uppercaseFirstChar
import org.jetbrains.compose.internal.utils.uppercaseFirstChar
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
fun Project . initializePreview ( desktopExtension : DesktopExtension ) {
fun Project . initializePreview ( desktopExtension : DesktopExtension ) {
plugins . withId ( KOTLIN _MPP _PLUGIN _ID ) {
plugins . withId ( KOTLIN _MPP _PLUGIN _ID ) {
mppExt . targets . all { target ->
mppExt . targets . withType ( KotlinJvmTarget :: class . java ) { target ->
if ( target . platformType == KotlinPlatformType . jvm ) {
val runtimeFilesProvider = JvmApplicationRuntimeFilesProvider . FromKotlinMppTarget ( target )
val runtimeFilesProvider = JvmApplicationRuntimeFilesProvider . FromKotlinMppTarget ( target as KotlinJvmTarget )
registerConfigurePreviewTask ( project , runtimeFilesProvider , targetName = target . name )
registerConfigurePreviewTask ( project , runtimeFilesProvider , targetName = target . name )
}
}
}
}
}
plugins . withId ( KOTLIN _JVM _PLUGIN _ID ) {
plugins . withId ( KOTLIN _JVM _PLUGIN _ID ) {
val sourceSet = project . javaSourceSets . getByName ( " main " )
val sourceSet = project . javaSourceSets . getByName ( " main " )
val runtimeFilesProvider = JvmApplicationRuntimeFilesProvider . FromGradleSourceSet ( sourceSet )
val runtimeFilesProvider = JvmApplicationRuntimeFilesProvider . FromGradleSourceSet ( sourceSet )