From 0d3f8c0db6c86904cc15c1b9e52f3732f81827f3 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 24 Oct 2017 10:51:45 -0700 Subject: [PATCH] Use prebuilt dx for PDK builds The source for dx may not be available in PDK builds, use the prebuilt one from prebuilts/build-tools instead. Bug: 67663308 Test: m TARGET_BUILD_PDK=true Change-Id: I9090b5190539f901fc05264a472133c12d4ea2a1 --- android/config.go | 4 ++++ java/config/config.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/android/config.go b/android/config.go index dca998f5a..d83bf0a9e 100644 --- a/android/config.go +++ b/android/config.go @@ -496,6 +496,10 @@ func (c *config) UnbundledBuild() bool { return Bool(c.ProductVariables.Unbundled_build) } +func (c *config) IsPdkBuild() bool { + return Bool(c.ProductVariables.Pdk) +} + func (c *config) DevicePrefer32BitExecutables() bool { return Bool(c.ProductVariables.DevicePrefer32BitExecutables) } diff --git a/java/config/config.go b/java/config/config.go index 6509d80ae..94dfa19f1 100644 --- a/java/config/config.go +++ b/java/config/config.go @@ -83,7 +83,7 @@ func init() { if config.(android.Config).Getenv("USE_D8") == "true" { dexer = "d8" } - if config.(android.Config).UnbundledBuild() { + if config.(android.Config).UnbundledBuild() || config.(android.Config).IsPdkBuild() { return "prebuilts/build-tools/common/bin/" + dexer, nil } else { path, err := pctx.HostBinToolPath(config, dexer)