diff options
author | satayev <satayev@google.com> | 2021-03-22 12:01:22 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-03-22 12:01:22 +0000 |
commit | 3c5d96925fbd2075e2d3eaa84d741f36fb71aa66 (patch) | |
tree | ec7697347382e443442eae5825d9d7e191d1f393 /apex/apex_singleton.go | |
parent | e23b216079b302eeaf0014b5d7b4e97ab9695ed1 (diff) | |
parent | 0ee372ad6fa4f17fa643baeb563cdbb615f6bfd5 (diff) |
Merge changes from topic "move_allowed_deps_txt" am: 2b077baa5e am: 0ee372ad6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645088
Change-Id: Ia9e9f9458aaed90d994e6d4454c0c046ed75082a
Diffstat (limited to 'apex/apex_singleton.go')
-rw-r--r-- | apex/apex_singleton.go | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/apex/apex_singleton.go b/apex/apex_singleton.go index 4890ba45e..0ed94afdb 100644 --- a/apex/apex_singleton.go +++ b/apex/apex_singleton.go @@ -81,25 +81,35 @@ func (s *apexDepsInfoSingleton) GenerateBuildActions(ctx android.SingletonContex } }) - allowedDeps := android.ExistentPathForSource(ctx, "packages/modules/common/build/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) } |