Browse Source

[gradle] Fix AGP lint tasks dependencies.

pull/5051/head
Konstantin Tskhovrebov 5 months ago
parent
commit
22dfb1431a
  1. 13
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/AndroidResources.kt

13
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 com.android.build.gradle.internal.lint.LintModelWriterTask
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.Project 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.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.registerTask
import org.jetbrains.compose.internal.utils.uppercaseFirstChar import org.jetbrains.compose.internal.utils.uppercaseFirstChar
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
@ -131,6 +136,10 @@ internal fun Project.configureAndroidAssetsForPreview() {
if (task.name == "compile${variant.name.uppercaseFirstChar()}Sources") { if (task.name == "compile${variant.name.uppercaseFirstChar()}Sources") {
task.dependsOn(kgpCopyAssetsTaskName) task.dependsOn(kgpCopyAssetsTaskName)
} }
//fix https://github.com/JetBrains/compose-multiplatform/issues/5038
if (task is AndroidLintAnalysisTask || task is LintModelWriterTask) {
task.mustRunAfter(kgpCopyAssetsTaskName)
}
} }
} }
} }

Loading…
Cancel
Save