Support jarjar sharding
- If the new option `jarjar_shards` is set, use this as the number
of shards and enable sharding.
- The plan is to use it on "big" jars such as framework-minus-apex, but
for now, we only use it in a "test" target,
`framework-minus-apex_jarjar-sharded`.
- Also add `framework-minus-apex_jarjar-sharded` to the various
hardcoded spacial cases.
Test: m framework-minus-apex framework-minus-apex_jarjar-sharded
and make sure the javac output jars have the same entries.
$ diff \
<(jar tf $ANDROID_BUILD_TOP/out/soong/.intermediates/frameworks/base/framework-minus-apex/android_common/jarjar/framework.jar \
| sort) \
<(jar tf $ANDROID_BUILD_TOP/out/soong/.intermediates/frameworks/base/framework-minus-apex_jarjar-sharded/android_common/jarjar/framework-minus-apex_jarjar-sharded.jar \
| sort)
(no output)
Bug: 383559945
Flag: EXEMPT New options are not used on production jars
Change-Id: I94c2ad978add25267f22b65c063e9148901b208b
diff --git a/android/container.go b/android/container.go
index 27b17ed..99e6a30 100644
--- a/android/container.go
+++ b/android/container.go
@@ -197,7 +197,10 @@
func determineUnstableModule(mctx ModuleContext) bool {
module := mctx.Module()
- unstableModule := module.Name() == "framework-minus-apex"
+
+ // TODO(b/383559945) Remove "framework-minus-apex_jarjar-sharded" once
+ // we remove this module.
+ unstableModule := module.Name() == "framework-minus-apex" || module.Name() == "framework-minus-apex_jarjar-sharded"
if installable, ok := module.(InstallableModule); ok {
for _, staticDepTag := range installable.StaticDependencyTags() {
mctx.VisitDirectDepsWithTag(staticDepTag, func(dep Module) {