summaryrefslogtreecommitdiff
path: root/java/boot_jars.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2020-10-29 12:56:09 +0000
committer Paul Duffin <paulduffin@google.com> 2020-11-10 17:37:43 +0000
commit2d8e1a7e590417f7e96df3df72f45ccdd16dd513 (patch)
tree4d7f050d5f1bf1e5349f58ba36386d5a5aa89abf /java/boot_jars.go
parent99a762288538d8737492cf0235ae97e617222e25 (diff)
Switch boot jars package check to using dex jars
The switch to use dex jars instead of class jars means that a boot jar that is defined by a dex_import module will now be checked against the package_allowed_list.txt so it is possible that it will detect previously unreported problems. Test: m check-boot-jars - for failing and passing cases Bug: 171479578 Bug: 125517186 Change-Id: Ie614898dade0fb43c9418d7afb9138169db6f097
Diffstat (limited to 'java/boot_jars.go')
-rw-r--r--java/boot_jars.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/java/boot_jars.go b/java/boot_jars.go
index 900eb7adf..e70654781 100644
--- a/java/boot_jars.go
+++ b/java/boot_jars.go
@@ -87,6 +87,7 @@ func (b *bootJarsSingleton) GenerateBuildActions(ctx android.SingletonContext) {
rule := android.NewRuleBuilder()
checkBootJars := rule.Command().BuiltTool(ctx, "check_boot_jars").
+ Input(ctx.Config().HostToolPath(ctx, "dexdump")).
Input(android.PathForSource(ctx, "build/soong/scripts/check_boot_jars/package_allowed_list.txt"))
// If this is not an unbundled build and missing dependencies are not allowed
@@ -96,14 +97,9 @@ func (b *bootJarsSingleton) GenerateBuildActions(ctx android.SingletonContext) {
// Iterate over the module names on the boot classpath in order
for _, name := range android.SortedStringKeys(moduleToApex) {
if apexVariant, ok := nameToApexVariant[name]; ok {
- if dep, ok := apexVariant.(Dependency); ok {
- // Add the implementation jars for the module to be checked. This uses implementation
- // and resources jar as that is what the previous make based check uses.
- for _, jar := range dep.ImplementationAndResourcesJars() {
- checkBootJars.Input(jar)
- }
- } else if _, ok := apexVariant.(*DexImport); ok {
- // TODO(b/171479578): ignore deximport when doing package check until boot_jars.go can check dex jars.
+ if dep, ok := apexVariant.(interface{ DexJarBuildPath() android.Path }); ok {
+ // Add the dex implementation jar for the module to be checked.
+ checkBootJars.Input(dep.DexJarBuildPath())
} else {
ctx.Errorf("module %q is of type %q which is not supported as a boot jar", name, ctx.ModuleType(apexVariant))
}