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
This commit is contained in:
satayev
2021-03-22 12:01:22 +00:00
committed by Automerger Merge Worker

View File

@@ -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)
}