diff options
author | Alan Leung <acleung@google.com> | 2017-10-17 18:50:50 -0700 |
---|---|---|
committer | Alan Leung <acleung@google.com> | 2017-10-19 16:27:42 -0700 |
commit | 1d476fcbeb8b6cb1d7643e8673930bffa664685e (patch) | |
tree | cedf093362ff14aa419d58f15a485b40df110380 /java/config/config.go | |
parent | 31b59cf6041fa8c6d7c8a74ebec14c6618bc49ae (diff) | |
download | build_soong-1d476fcbeb8b6cb1d7643e8673930bffa664685e.tar.gz build_soong-1d476fcbeb8b6cb1d7643e8673930bffa664685e.tar.bz2 build_soong-1d476fcbeb8b6cb1d7643e8673930bffa664685e.zip |
Add D8 support
Bug: 67754178
Test: m -j32 checkbuild && USE_D8=true m -j32 checkbuild
Change-Id: If63afc10ceb5e753bbb7f195bb8a895eaef10775
Diffstat (limited to 'java/config/config.go')
-rw-r--r-- | java/config/config.go | 17 |
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") |