aboutsummaryrefslogtreecommitdiffstats
path: root/java/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/config/config.go')
-rw-r--r--java/config/config.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/java/config/config.go b/java/config/config.go
index eb71ddb6..f4abd37d 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -77,7 +77,22 @@ func init() {
pctx.SourcePathVariable("JarArgsCmd", "build/soong/scripts/jar-args.sh")
pctx.HostBinToolVariable("SoongZipCmd", "soong_zip")
pctx.HostBinToolVariable("MergeZipsCmd", "merge_zips")
- pctx.HostBinToolVariable("DxCmd", "dx")
+ pctx.VariableFunc("DxCmd", func(config interface{}) (string, error) {
+ dexer := "dx"
+ if config.(android.Config).Getenv("USE_D8") == "true" {
+ dexer = "d8"
+ }
+ if config.(android.Config).UnbundledBuild() {
+ return "prebuilts/build-tools/common/bin/" + dexer, nil
+ } else {
+ path, err := pctx.HostBinToolPath(config, dexer)
+ if err != nil {
+ return "", err
+ }
+ return path.String(), nil
+ }
+ })
+
pctx.HostJavaToolVariable("JarjarCmd", "jarjar.jar")
pctx.HostJavaToolVariable("DesugarJar", "desugar.jar")