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
This commit is contained in:
Colin Cross 2019-02-26 22:14:04 -08:00
parent 0b9f31fb08
commit 87ecbfe107
3 changed files with 4 additions and 19 deletions

View file

@ -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")

View file

@ -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")

View file

@ -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}")