Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make desktop preview task fully configuration cache compliant #4410

Merged
merged 1 commit into from Apr 4, 2024

Conversation

eygraber
Copy link
Contributor

@eygraber eygraber commented Mar 1, 2024

Issues fixed

  1. Set org.gradle.configuration-cache=true in ~/.gradle/gradle.properties
  2. Install Compose Multiplatform IDE Support IDEA plugin
  3. Open the project gradle-plugins/compose/src/test/test-projects/misc/jvmPreview
  4. Change build.gradle to:
subprojects {
    repositories {
        mavenLocal()
        google()
        gradlePluginPortal()
        maven {
            url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
        }
    }
}
  1. change settings.gradle to:
pluginManagement {
    plugins {
        id 'org.jetbrains.kotlin.multiplatform' version '1.9.22'
        id 'org.jetbrains.kotlin.jvm' version '1.9.22'
        id 'org.jetbrains.compose' version '1.6.0'
    }
    repositories {
        mavenLocal()
        gradlePluginPortal()
        maven {
            url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
        }
    }
}
rootProject.name = 'jvmPreview'
include(':common', ':jvm', ':mpp')

  1. Sync the project.

  2. Go to common/src/commonMain/kotlin/preview.kt. Open the preview.

  3. See the crash:

Configuration cache problems found in this build.

1 problem was found storing the configuration cache.
- Task `:common:configureDesktopPreviewDesktop` of type `org.jetbrains.compose.desktop.preview.tasks.AbstractConfigureDesktopPreviewTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.4/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

Proposed changes

The issue was in a case where there wasn't a direct dependency on the skiko artifact, the task would attempt to get one at task execution time. This moves that to task configuration time.

Testing

  • The issue no longer reproduced.
  • The new test passes

This should be tested by QA.

@eygraber
Copy link
Contributor Author

@igordmn any idea on when this could get looked at?

@igordmn igordmn self-requested a review March 20, 2024 09:13
@igordmn igordmn merged commit 93f3725 into JetBrains:master Apr 4, 2024
6 checks passed
@igordmn
Copy link
Collaborator

igordmn commented Apr 4, 2024

Thanks! Lgtm.

I changed the description to comply our new guidelines that aren't enforced yet. Does it look okay?

@eygraber eygraber deleted the desktop-preview-task-cc branch April 4, 2024 02:51
@eygraber
Copy link
Contributor Author

eygraber commented Apr 4, 2024

Description looks ok. Do you want to add that an integration test was added, or is that section only for manual QA testing?

@igordmn
Copy link
Collaborator

igordmn commented Apr 4, 2024

Do you want to add that an integration test was added, or is that section only for manual QA testing?

Thanks, added. This is for all kinds of testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants