Merge "Check for errors in preparer.sh" into main am: b284c72d66 am: c59e17131b

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2896202

Change-Id: I4995a6d4f2f9ff0cc08bea3daf94219efb5f482b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Cole Faust
2024-01-04 03:25:56 +00:00
committed by Automerger Merge Worker

View File

@@ -240,10 +240,14 @@ func (p *PackagingBase) GatherPackagingSpecs(ctx ModuleContext) map[string]Packa
// CopySpecsToDir is a helper that will add commands to the rule builder to copy the PackagingSpec
// entries into the specified directory.
func (p *PackagingBase) CopySpecsToDir(ctx ModuleContext, builder *RuleBuilder, specs map[string]PackagingSpec, dir WritablePath) (entries []string) {
if len(specs) == 0 {
return entries
}
seenDir := make(map[string]bool)
preparerPath := PathForModuleOut(ctx, "preparer.sh")
cmd := builder.Command().Tool(preparerPath)
var sb strings.Builder
sb.WriteString("set -e\n")
for _, k := range SortedKeys(specs) {
ps := specs[k]
destPath := filepath.Join(dir.String(), ps.relPathInPackage)