Merge "Use aquery results to determine if a file should be executable" into main am: a4fc68a355
am: e304013941
am: 7f8b06bd98
am: a5e4c0d821
am: 48aeba86b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2736023 Change-Id: I767875e5f534a0468c0e3d2a2095d49fb647dd5b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1382,10 +1382,7 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) {
|
||||
WriteFileRuleVerbatim(ctx, out, "")
|
||||
case "FileWrite", "SourceSymlinkManifest":
|
||||
out := PathForBazelOut(ctx, buildStatement.OutputPaths[0])
|
||||
// TODO(b/297366783) This is a hack to make files from skylib's diff_test executable.
|
||||
// We need to update bazel to have aquery tell us whether a file is supposed to be
|
||||
// executable or not.
|
||||
if strings.HasSuffix(buildStatement.OutputPaths[0], "-test.sh") {
|
||||
if buildStatement.IsExecutable {
|
||||
WriteExecutableFileRuleVerbatim(ctx, out, buildStatement.FileContents)
|
||||
} else {
|
||||
WriteFileRuleVerbatim(ctx, out, buildStatement.FileContents)
|
||||
|
@@ -107,8 +107,8 @@ var (
|
||||
|
||||
Cat = pctx.AndroidStaticRule("Cat",
|
||||
blueprint.RuleParams{
|
||||
Command: "cat $in > $out",
|
||||
Description: "concatenate licenses $out",
|
||||
Command: "rm -f $out && cat $in > $out",
|
||||
Description: "concatenate files to $out",
|
||||
})
|
||||
|
||||
// ubuntu 14.04 offcially use dash for /bin/sh, and its builtin echo command
|
||||
@@ -116,7 +116,7 @@ var (
|
||||
// content to file.
|
||||
writeFile = pctx.AndroidStaticRule("writeFile",
|
||||
blueprint.RuleParams{
|
||||
Command: `/bin/bash -c 'echo -e -n "$$0" > $out' $content`,
|
||||
Command: `rm -f $out && /bin/bash -c 'echo -e -n "$$0" > $out' $content`,
|
||||
Description: "writing file $out",
|
||||
},
|
||||
"content")
|
||||
|
Reference in New Issue
Block a user