From 22dfb1431a85a76d2f8e6f0290f836a4a8547413 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Fri, 28 Jun 2024 11:32:19 +0200 Subject: [PATCH] [gradle] Fix AGP lint tasks dependencies. --- .../jetbrains/compose/resources/AndroidResources.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt index 8ca1fed8f9..afd400483e 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt @@ -6,9 +6,14 @@ import com.android.build.gradle.internal.lint.AndroidLintAnalysisTask import com.android.build.gradle.internal.lint.LintModelWriterTask import org.gradle.api.DefaultTask import org.gradle.api.Project -import org.gradle.api.file.* +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.FileCollection +import org.gradle.api.file.FileSystemOperations import org.gradle.api.provider.Property -import org.gradle.api.tasks.* +import org.gradle.api.tasks.IgnoreEmptyDirectories +import org.gradle.api.tasks.InputFiles +import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.tasks.TaskAction import org.jetbrains.compose.internal.utils.registerTask import org.jetbrains.compose.internal.utils.uppercaseFirstChar import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension @@ -131,6 +136,10 @@ internal fun Project.configureAndroidAssetsForPreview() { if (task.name == "compile${variant.name.uppercaseFirstChar()}Sources") { task.dependsOn(kgpCopyAssetsTaskName) } + //fix https://github.com/JetBrains/compose-multiplatform/issues/5038 + if (task is AndroidLintAnalysisTask || task is LintModelWriterTask) { + task.mustRunAfter(kgpCopyAssetsTaskName) + } } } }