From 87ecbfe1079b3cf99373b4ef0f1e1d8db8c1961e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 26 Feb 2019 22:14:04 -0800 Subject: [PATCH] Update manifest merger to use binary Manifest merger is now a java_binary instead of a collection of jars, it can use the single binary as the dependency. Bug: 112607039 Test: m checkbuild Change-Id: Iea6c97c99a3bb09952fed2b25437b644f4e863f8 --- java/android_manifest.go | 6 ++---- java/config/config.go | 13 +------------ java/config/makevars.go | 4 +--- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/java/android_manifest.go b/java/android_manifest.go index 3cca4f718..d72476d8f 100644 --- a/java/android_manifest.go +++ b/java/android_manifest.go @@ -21,7 +21,6 @@ import ( "github.com/google/blueprint" "android/soong/android" - "android/soong/java/config" ) var manifestFixerRule = pctx.AndroidStaticRule("manifestFixer", @@ -37,9 +36,8 @@ var manifestFixerRule = pctx.AndroidStaticRule("manifestFixer", var manifestMergerRule = pctx.AndroidStaticRule("manifestMerger", blueprint.RuleParams{ - Command: `${config.JavaCmd} -classpath ${config.ManifestMergerClasspath} com.android.manifmerger.Merger ` + - `--main $in $libs --out $out`, - CommandDeps: config.ManifestMergerClasspath, + Command: `${config.ManifestMergerCmd} --main $in $libs --out $out`, + CommandDeps: []string{"${config.ManifestMergerCmd}"}, }, "libs") diff --git a/java/config/config.go b/java/config/config.go index e607b1d55..2762a4d84 100644 --- a/java/config/config.go +++ b/java/config/config.go @@ -44,16 +44,6 @@ var ( "core-oj", "core-libart", } - - ManifestMergerClasspath = []string{ - "prebuilts/gradle-plugin/com/android/tools/build/manifest-merger/26.1.0/manifest-merger-26.1.0.jar", - "prebuilts/gradle-plugin/com/android/tools/common/26.1.0/common-26.1.0.jar", - "prebuilts/gradle-plugin/com/android/tools/sdk-common/26.1.0/sdk-common-26.1.0.jar", - "prebuilts/gradle-plugin/com/android/tools/sdklib/26.1.0/sdklib-26.1.0.jar", - "prebuilts/gradle-plugin/org/jetbrains/kotlin/kotlin-runtime/1.0.5/kotlin-runtime-1.0.5.jar", - "prebuilts/gradle-plugin/org/jetbrains/kotlin/kotlin-stdlib/1.1.3/kotlin-stdlib-1.1.3.jar", - "prebuilts/misc/common/guava/guava-21.0.jar", - } ) func init() { @@ -152,8 +142,7 @@ func init() { pctx.SourcePathVariable("ManifestFixerCmd", "build/soong/scripts/manifest_fixer.py") - pctx.SourcePathsVariable("ManifestMergerJars", " ", ManifestMergerClasspath...) - pctx.SourcePathsVariable("ManifestMergerClasspath", ":", ManifestMergerClasspath...) + pctx.HostBinToolVariable("ManifestMergerCmd", "manifest-merger") pctx.HostBinToolVariable("ZipAlign", "zipalign") diff --git a/java/config/makevars.go b/java/config/makevars.go index 30552da06..6881caff6 100644 --- a/java/config/makevars.go +++ b/java/config/makevars.go @@ -75,9 +75,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("MANIFEST_FIXER", "${ManifestFixerCmd}") - ctx.Strict("ANDROID_MANIFEST_MERGER_DEPS", "${ManifestMergerJars}") - ctx.Strict("ANDROID_MANIFEST_MERGER", - "${JavaCmd} -classpath ${ManifestMergerClasspath} com.android.manifmerger.Merger") + ctx.Strict("ANDROID_MANIFEST_MERGER", "${ManifestMergerCmd}") ctx.Strict("CLASS2GREYLIST", "${Class2Greylist}") ctx.Strict("HIDDENAPI", "${HiddenAPI}")