|
|
@ -35,6 +35,11 @@ abstract class AbstractConfigureDesktopPreviewTask : AbstractComposeDesktopTask( |
|
|
|
internal val idePort: Provider<String> = |
|
|
|
internal val idePort: Provider<String> = |
|
|
|
project.providers.gradleProperty("compose.desktop.preview.ide.port") |
|
|
|
project.providers.gradleProperty("compose.desktop.preview.ide.port") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@get:InputFiles |
|
|
|
|
|
|
|
internal val uiTooling = project.configurations.detachedConfiguration( |
|
|
|
|
|
|
|
project.dependencies.create("org.jetbrains.compose.ui:ui-tooling-desktop:${ComposeBuildConfig.composeVersion}") |
|
|
|
|
|
|
|
).apply { isTransitive = false } |
|
|
|
|
|
|
|
|
|
|
|
@get:InputFiles |
|
|
|
@get:InputFiles |
|
|
|
internal val hostClasspath = project.configurations.detachedConfiguration( |
|
|
|
internal val hostClasspath = project.configurations.detachedConfiguration( |
|
|
|
project.dependencies.create("org.jetbrains.compose:preview-rpc:${ComposeBuildConfig.composeVersion}") |
|
|
|
project.dependencies.create("org.jetbrains.compose:preview-rpc:${ComposeBuildConfig.composeVersion}") |
|
|
@ -44,9 +49,11 @@ abstract class AbstractConfigureDesktopPreviewTask : AbstractComposeDesktopTask( |
|
|
|
fun run() { |
|
|
|
fun run() { |
|
|
|
val hostConfig = PreviewHostConfig( |
|
|
|
val hostConfig = PreviewHostConfig( |
|
|
|
javaExecutable = javaExecutable(javaHome.get()), |
|
|
|
javaExecutable = javaExecutable(javaHome.get()), |
|
|
|
hostClasspath = hostClasspath.files.pathString() |
|
|
|
hostClasspath = hostClasspath.files.asSequence().pathString() |
|
|
|
) |
|
|
|
) |
|
|
|
val previewClasspathString = previewClasspath.files.pathString() |
|
|
|
val previewClasspathString = |
|
|
|
|
|
|
|
(previewClasspath.files.asSequence() + uiTooling.files.asSequence()) |
|
|
|
|
|
|
|
.pathString() |
|
|
|
|
|
|
|
|
|
|
|
val gradleLogger = logger |
|
|
|
val gradleLogger = logger |
|
|
|
val previewLogger = GradlePreviewLoggerAdapter(gradleLogger) |
|
|
|
val previewLogger = GradlePreviewLoggerAdapter(gradleLogger) |
|
|
@ -65,7 +72,7 @@ abstract class AbstractConfigureDesktopPreviewTask : AbstractComposeDesktopTask( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun Collection<File>.pathString(): String = |
|
|
|
private fun Sequence<File>.pathString(): String = |
|
|
|
joinToString(File.pathSeparator) { it.absolutePath } |
|
|
|
joinToString(File.pathSeparator) { it.absolutePath } |
|
|
|
|
|
|
|
|
|
|
|
private class GradlePreviewLoggerAdapter( |
|
|
|
private class GradlePreviewLoggerAdapter( |
|
|
|