Browse Source

Fix eager tryGetSkikoRuntimeIfNeeded (#4918)

Fixes #4886

## Testing
- Built the gradle plugin to mavenLocal
- used it in the reproducer of #4886, - the issue is gonve


This should be tested by QA

## Release Notes

### Fixes - Gradle Plugin
- Make sure tryGetSkikoRuntimeIfNeeded is executed only during the task
execution
pull/4922/head
Oleksandr Karpovich 6 months ago committed by GitHub
parent
commit
9b453a9164
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/preview/internal/configurePreview.kt
  2. 6
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/preview/tasks/AbstractConfigureDesktopPreviewTask.kt

2
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/preview/internal/configurePreview.kt

@ -34,7 +34,7 @@ private fun registerConfigurePreviewTask(
) { previewTask ->
runtimeFiles.configureUsageBy(previewTask) { (runtimeJars, _) ->
previewClasspath = runtimeJars
skikoRuntime = tryGetSkikoRuntimeIfNeeded()
skikoRuntime.set(project.provider { tryGetSkikoRuntimeIfNeeded() })
}
}
}

6
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/preview/tasks/AbstractConfigureDesktopPreviewTask.kt

@ -19,7 +19,7 @@ abstract class AbstractConfigureDesktopPreviewTask : AbstractComposeDesktopTask(
internal lateinit var previewClasspath: FileCollection
@get:InputFiles
internal lateinit var skikoRuntime: FileCollection
internal abstract val skikoRuntime: Property<FileCollection>
@get:Internal
internal val javaHome: Property<String> = objects.notNullProperty<String>().apply {
@ -58,10 +58,12 @@ abstract class AbstractConfigureDesktopPreviewTask : AbstractComposeDesktopTask(
javaExecutable = javaExecutable(javaHome.get()),
hostClasspath = hostClasspath.files.asSequence().pathString()
)
val skikoRuntimeFiles = skikoRuntime.get()
val previewClasspathString =
(previewClasspath.files.asSequence() +
uiTooling.files.asSequence() +
skikoRuntime.files.asSequence()
skikoRuntimeFiles.files.asSequence()
).pathString()
val gradleLogger = logger

Loading…
Cancel
Save