Skip to content

Commit

Permalink
Fix eager tryGetSkikoRuntimeIfNeeded (#4918)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eymar committed Jun 3, 2024
1 parent 9a513c5 commit 9b453a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private fun registerConfigurePreviewTask(
) { previewTask ->
runtimeFiles.configureUsageBy(previewTask) { (runtimeJars, _) ->
previewClasspath = runtimeJars
skikoRuntime = tryGetSkikoRuntimeIfNeeded()
skikoRuntime.set(project.provider { tryGetSkikoRuntimeIfNeeded() })
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9b453a9

Please sign in to comment.