Merge pull request #1736 from android/av/lazy-aapt2-executable

Replace aapt2 executable with lazy property
pull/1753/head
Don Turner 1 week ago committed by GitHub
commit c890f7b544
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -39,8 +39,6 @@ import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.register import org.gradle.kotlin.dsl.register
import org.gradle.language.base.plugins.LifecycleBasePlugin import org.gradle.language.base.plugins.LifecycleBasePlugin
import org.gradle.process.ExecOperations import org.gradle.process.ExecOperations
import java.io.File
import java.util.Locale
import javax.inject.Inject import javax.inject.Inject
@CacheableTask @CacheableTask
@ -123,15 +121,17 @@ fun Project.configureBadgingTasks(
val generateBadging = val generateBadging =
tasks.register<GenerateBadgingTask>(generateBadgingTaskName) { tasks.register<GenerateBadgingTask>(generateBadgingTaskName) {
apk = variant.artifacts.get(SingleArtifact.APK_FROM_BUNDLE) apk = variant.artifacts.get(SingleArtifact.APK_FROM_BUNDLE)
aapt2Executable.set(
aapt2Executable = File( // TODO: Replace with `sdkComponents.aapt2` when it's available in AGP
baseExtension.sdkDirectory, // https://issuetracker.google.com/issues/376815836
"${SdkConstants.FD_BUILD_TOOLS}/" + componentsExtension.sdkComponents.sdkDirectory.map { directory ->
"${baseExtension.buildToolsVersion}/" + directory.file(
SdkConstants.FN_AAPT2, "${SdkConstants.FD_BUILD_TOOLS}/" +
"${baseExtension.buildToolsVersion}/" +
SdkConstants.FN_AAPT2,
)
}
) )
badging = project.layout.buildDirectory.file( badging = project.layout.buildDirectory.file(
"outputs/apk_from_bundle/${variant.name}/${variant.name}-badging.txt", "outputs/apk_from_bundle/${variant.name}/${variant.name}-badging.txt",
) )

Loading…
Cancel
Save