Revert "Added EXTRA_ALLOWED_DEPS_TXT to allow arbitrary allowedlist text files that enforces min_sdk_version for apex dependencies to avoid regression"
This reverts commit 8609a5569c7d93efc983e7c5f091fbdd4f955567.
Reason for revert: Design change - not collecting dependencies of non-AOSP updatable APEX
Bug: 380222284
Bug: 383062486
Test: m nothing --no-skip-soong-tests
Change-Id: I4150848502fc1f172f88dc4f0d1e663ac5a8cfea
diff --git a/apex/apex_singleton.go b/apex/apex_singleton.go
index d46104e..7b3acb5 100644
--- a/apex/apex_singleton.go
+++ b/apex/apex_singleton.go
@@ -18,7 +18,6 @@
import (
"encoding/json"
- "strings"
"github.com/google/blueprint"
@@ -59,9 +58,9 @@
// Diff two given lists while ignoring comments in the allowed deps file.
diffAllowedApexDepsInfoRule = pctx.AndroidStaticRule("diffAllowedApexDepsInfoRule", blueprint.RuleParams{
- Description: "Diff ${allowed_deps_list} and ${new_allowed_deps}",
+ Description: "Diff ${allowed_deps} and ${new_allowed_deps}",
Command: `
- if grep -v -h '^#' ${allowed_deps_list} | sort -u -f| diff -B -u - ${new_allowed_deps}; then
+ if grep -v '^#' ${allowed_deps} | diff -B - ${new_allowed_deps}; then
touch ${out};
else
echo;
@@ -85,15 +84,10 @@
exit 1;
fi;
`,
- }, "allowed_deps_list", "new_allowed_deps")
+ }, "allowed_deps", "new_allowed_deps")
)
func (s *apexDepsInfoSingleton) GenerateBuildActions(ctx android.SingletonContext) {
- allowedDepsSources := []android.OptionalPath{android.ExistentPathForSource(ctx, "packages/modules/common/build/allowed_deps.txt")}
- extraAllowedDepsPath := ctx.Config().ExtraAllowedDepsTxt()
- if extraAllowedDepsPath != "" {
- allowedDepsSources = append(allowedDepsSources, android.ExistentPathForSource(ctx, extraAllowedDepsPath))
- }
updatableFlatLists := android.Paths{}
ctx.VisitAllModules(func(module android.Module) {
if binaryInfo, ok := module.(android.ApexBundleDepsInfoIntf); ok {
@@ -105,42 +99,37 @@
}
}
})
+
+ allowedDepsSource := android.ExistentPathForSource(ctx, "packages/modules/common/build/allowed_deps.txt")
newAllowedDeps := android.PathForOutput(ctx, "apex", "depsinfo", "new-allowed-deps.txt")
s.allowedApexDepsInfoCheckResult = android.PathForOutput(ctx, newAllowedDeps.Rel()+".check")
- hasOneValidDepsPath := false
- for _, allowedDepsSource := range allowedDepsSources {
- if allowedDepsSource.Valid() {
- hasOneValidDepsPath = true
- updatableFlatLists = append(updatableFlatLists, allowedDepsSource.Path())
- }
- }
- allowedDepsStrList := make([]string, len(allowedDepsSources))
- for _, value := range allowedDepsSources {
- allowedDepsStrList = append(allowedDepsStrList, value.String())
- }
- allowedDepsListString := strings.Join(allowedDepsStrList, " ")
- if !hasOneValidDepsPath {
+
+ if !allowedDepsSource.Valid() {
// Unbundled projects may not have packages/modules/common/ checked out; ignore those.
ctx.Build(pctx, android.BuildParams{
Rule: android.Touch,
Output: s.allowedApexDepsInfoCheckResult,
})
} else {
+ allowedDeps := allowedDepsSource.Path()
+
ctx.Build(pctx, android.BuildParams{
Rule: generateApexDepsInfoFilesRule,
- Inputs: updatableFlatLists,
+ Inputs: append(updatableFlatLists, allowedDeps),
Output: newAllowedDeps,
})
+
ctx.Build(pctx, android.BuildParams{
Rule: diffAllowedApexDepsInfoRule,
Input: newAllowedDeps,
Output: s.allowedApexDepsInfoCheckResult,
Args: map[string]string{
- "allowed_deps_list": allowedDepsListString,
- "new_allowed_deps": newAllowedDeps.String(),
+ "allowed_deps": allowedDeps.String(),
+ "new_allowed_deps": newAllowedDeps.String(),
},
})
}
+
ctx.Phony("apex-allowed-deps-check", s.allowedApexDepsInfoCheckResult)
}