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

Fix configuration cache issues #2607

Merged
merged 5 commits into from Jan 11, 2023
Merged

Conversation

AlexeyTsvetkov
Copy link
Collaborator

No description provided.

Comment on lines 35 to 45
fileOperations.clearDirs(outputDir)

for (file in skikoRuntimeFiles.files) {
if (file.name.endsWith(".jar", ignoreCase = true)) {
unpackJar(file)
}
}
}

private fun unpackSkikoRuntime(skikoVersion: String) {
val skikoRuntimeConfig = project.configurations.detachedConfiguration(
project.dependencies.create("org.jetbrains.skiko:skiko-js-wasm-runtime:$skikoVersion")
)

for (file in skikoRuntimeConfig.resolve()) {
if (file.name.endsWith(".jar", ignoreCase = true)) {
project.copy { copySpec ->
copySpec.from(project.zipTree(file))
copySpec.into(outputDir)
}
}
private fun unpackJar(file: File) {
fileOperations.copy { copySpec ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this used sync() instead of copy(), then there's no need for fileOperations.clearDirs(outputDir)

  • Gradle will automatically create task directory properties tagged @OutputDirectories
  • Sync will automatically delete old files

And then the new util file, gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/internal/utils/fileUtils.kt, isn't needed.

Copy link
Contributor

@dima-avdeev-jb dima-avdeev-jb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked on local builds, it works well. But GitHub Actions tests are failed.

@AlexeyTsvetkov AlexeyTsvetkov merged commit 472ef34 into master Jan 11, 2023
@AlexeyTsvetkov AlexeyTsvetkov deleted the fix-configuration-cache-issues branch January 11, 2023 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gradle Gradle plugin problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants