diff options
author | satayev <satayev@google.com> | 2021-03-22 12:45:29 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-03-22 12:45:29 +0000 |
commit | 670ae1967f623c0403bc295d6374b85cfb9c8c1c (patch) | |
tree | 9a4187b7cd7c1cc52771d113cad941641b1228bb /apex/apex_singleton.go | |
parent | 94acbb187527e7d24ee0678cf65684899cfcbadc (diff) | |
parent | 3c5d96925fbd2075e2d3eaa84d741f36fb71aa66 (diff) |
Merge changes from topic "move_allowed_deps_txt" am: 2b077baa5e am: 0ee372ad6f am: 3c5d96925f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645088
Change-Id: I568df8371fb3eab090d417469c9d78a27be9d527
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 f587c90d5..98238428e 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) } |