diff options
| author | 2021-03-22 10:48:45 +0000 | |
|---|---|---|
| committer | 2021-03-22 10:48:45 +0000 | |
| commit | 2b077baa5e4472b3966e33f96a925fd7a0ef543e (patch) | |
| tree | 2837d5833385ea3d770d49963e326d10afbf2c57 /apex/apex_singleton.go | |
| parent | 3d5f6a1034d0c2e864d9819b9dd4eab57cdb09be (diff) | |
| parent | b77b0c5e05a1e16fd959bc9be5a89d238924ac53 (diff) | |
Merge changes from topic "move_allowed_deps_txt"
* changes:
Treat allowed_deps.txt source file as optional.
Move allowed_deps.txt to packages/modules/common.
Diffstat (limited to 'apex/apex_singleton.go')
| -rw-r--r-- | apex/apex_singleton.go | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/apex/apex_singleton.go b/apex/apex_singleton.go index ee9fc8115..0ed94afdb 100644 --- a/apex/apex_singleton.go +++ b/apex/apex_singleton.go @@ -58,8 +58,8 @@ var ( echo "ERROR: go/apex-allowed-deps-error"; echo "******************************"; echo "Detected changes to allowed dependencies in updatable modules."; - echo "To fix and update build/soong/apex/allowed_deps.txt, please run:"; - echo "$$ (croot && build/soong/scripts/update-apex-allowed-deps.sh)"; + echo "To fix and update packages/modules/common/build/allowed_deps.txt, please run:"; + echo "$$ (croot && packages/modules/common/build/update-apex-allowed-deps.sh)"; echo "Members of mainline-modularization@google.com will review the changes."; echo -e "******************************\n"; exit 1; @@ -81,25 +81,35 @@ func (s *apexDepsInfoSingleton) GenerateBuildActions(ctx android.SingletonContex } }) - allowedDeps := android.ExistentPathForSource(ctx, "build/soong/apex/allowed_deps.txt").Path() - + allowedDepsSource := android.ExistentPathForSource(ctx, "packages/modules/common/build/allowed_deps.txt") newAllowedDeps := android.PathForOutput(ctx, "apex", "depsinfo", "new-allowed-deps.txt") - ctx.Build(pctx, android.BuildParams{ - Rule: generateApexDepsInfoFilesRule, - Inputs: append(updatableFlatLists, allowedDeps), - Output: newAllowedDeps, - }) - s.allowedApexDepsInfoCheckResult = android.PathForOutput(ctx, newAllowedDeps.Rel()+".check") - ctx.Build(pctx, android.BuildParams{ - Rule: diffAllowedApexDepsInfoRule, - Input: newAllowedDeps, - Output: s.allowedApexDepsInfoCheckResult, - Args: map[string]string{ - "allowed_deps": allowedDeps.String(), - "new_allowed_deps": newAllowedDeps.String(), - }, - }) + + 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: append(updatableFlatLists, allowedDeps), + Output: newAllowedDeps, + }) + + ctx.Build(pctx, android.BuildParams{ + Rule: diffAllowedApexDepsInfoRule, + Input: newAllowedDeps, + Output: s.allowedApexDepsInfoCheckResult, + Args: map[string]string{ + "allowed_deps": allowedDeps.String(), + "new_allowed_deps": newAllowedDeps.String(), + }, + }) + } ctx.Phony("apex-allowed-deps-check", s.allowedApexDepsInfoCheckResult) } |