From 06b26ebf8accfbaa468e9655a8d00138422a0edd Mon Sep 17 00:00:00 2001 From: soywiz Date: Tue, 27 Aug 2024 12:40:32 +0200 Subject: [PATCH] Try to fix clean build for Android --- .../korge/gradle/targets/android/AndroidDirect.kt | 5 +++++ .../korge/gradle/targets/android/AndroidRun.kt | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/buildSrc/src/main/kotlin/korlibs/korge/gradle/targets/android/AndroidDirect.kt b/buildSrc/src/main/kotlin/korlibs/korge/gradle/targets/android/AndroidDirect.kt index dc4e4b4f76..9f41b4ccc6 100644 --- a/buildSrc/src/main/kotlin/korlibs/korge/gradle/targets/android/AndroidDirect.kt +++ b/buildSrc/src/main/kotlin/korlibs/korge/gradle/targets/android/AndroidDirect.kt @@ -85,6 +85,11 @@ fun Project.configureAndroidDirect(projectType: ProjectType, isKorge: Boolean) { targetCompatibility = ANDROID_JAVA_VERSION } + lintOptions.apply { + checkOnly() + //checkReleaseBuilds = false + } + buildFeatures.apply { if (project.name == "korlibs-platform") { buildConfig = true diff --git a/buildSrc/src/main/kotlin/korlibs/korge/gradle/targets/android/AndroidRun.kt b/buildSrc/src/main/kotlin/korlibs/korge/gradle/targets/android/AndroidRun.kt index cc0350a6fa..cff894c2b8 100644 --- a/buildSrc/src/main/kotlin/korlibs/korge/gradle/targets/android/AndroidRun.kt +++ b/buildSrc/src/main/kotlin/korlibs/korge/gradle/targets/android/AndroidRun.kt @@ -1,5 +1,6 @@ package korlibs.korge.gradle.targets.android +import com.android.build.gradle.internal.lint.* import korlibs.korge.gradle.* import korlibs.korge.gradle.targets.* import korlibs.korge.gradle.util.* @@ -40,6 +41,7 @@ fun Project.installAndroidRun(dependsOnList: List, direct: Boolean, isKo tasks.findByName("generate${Type}BuildConfig")?.dependsOn(createAndroidManifest) tasks.findByName("process${Type}MainManifest")?.dependsOn(createAndroidManifest) + tasks.findByName("process${Type}Resources")?.dependsOn(createAndroidManifest) // Not required anymore @@ -106,6 +108,7 @@ fun Project.installAndroidRun(dependsOnList: List, direct: Boolean, isKo dependsOn(ordered("createAndroidManifest", installAndroidTaskName)) finalizedBy(onlyRunAndroid) } + } } @@ -125,6 +128,18 @@ fun Project.installAndroidRun(dependsOnList: List, direct: Boolean, isKo tasks.createTyped("adbLogcat") { group = GROUP_KORGE_ADB } + + afterEvaluate { + afterEvaluate { + listOfNotNull( + tasks.findByName("generateReleaseLintVitalReportModel"), + tasks.findByName("generateDebugLintVitalReportModel") + ).forEach { + it.dependsOn("jvmProcessResources") + it.enabled = false + } + } + } } open class AndroidCreateAndroidManifest : DefaultTask() {