Skip to content

Commit

Permalink
Try to fix clean build for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz committed Aug 27, 2024
1 parent 252b359 commit 06b26eb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.*
Expand Down Expand Up @@ -40,6 +41,7 @@ fun Project.installAndroidRun(dependsOnList: List<String>, 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
Expand Down Expand Up @@ -106,6 +108,7 @@ fun Project.installAndroidRun(dependsOnList: List<String>, direct: Boolean, isKo
dependsOn(ordered("createAndroidManifest", installAndroidTaskName))
finalizedBy(onlyRunAndroid)
}

}
}

Expand All @@ -125,6 +128,18 @@ fun Project.installAndroidRun(dependsOnList: List<String>, direct: Boolean, isKo
tasks.createTyped<AndroidAdbLogcatTask>("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() {
Expand Down

0 comments on commit 06b26eb

Please sign in to comment.