summaryrefslogtreecommitdiff
path: root/android/defs.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/defs.go')
-rw-r--r--android/defs.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/android/defs.go b/android/defs.go
index 9f3fb1ee6..4dd267a89 100644
--- a/android/defs.go
+++ b/android/defs.go
@@ -51,6 +51,14 @@ var (
},
"cpFlags", "extraCmds")
+ // A copy rule wrapped with bash.
+ CpWithBash = pctx.AndroidStaticRule("CpWithBash",
+ blueprint.RuleParams{
+ Command: "/bin/bash -c \"rm -f $out && cp $cpFlags $cpPreserveSymlinks $in $out$extraCmds\"",
+ Description: "cp $out",
+ },
+ "cpFlags", "extraCmds")
+
// A copy rule that doesn't preserve symlinks.
CpNoPreserveSymlink = pctx.AndroidStaticRule("CpNoPreserveSymlink",
blueprint.RuleParams{
@@ -74,6 +82,14 @@ var (
},
"cpFlags", "extraCmds")
+ // A copy executable rule wrapped with bash
+ CpExecutableWithBash = pctx.AndroidStaticRule("CpExecutableWithBash",
+ blueprint.RuleParams{
+ Command: "/bin/bash -c \"(rm -f $out && cp $cpFlags $cpPreserveSymlinks $in $out ) && (chmod +x $out$extraCmds )\"",
+ Description: "cp $out",
+ },
+ "cpFlags", "extraCmds")
+
// A timestamp touch rule.
Touch = pctx.AndroidStaticRule("Touch",
blueprint.RuleParams{
@@ -89,6 +105,14 @@ var (
},
"fromPath")
+ // A symlink rule wrapped with bash
+ SymlinkWithBash = pctx.AndroidStaticRule("SymlinkWithBash",
+ blueprint.RuleParams{
+ Command: "/bin/bash -c \"rm -f $out && ln -sfn $fromPath $out\"",
+ Description: "symlink $out",
+ },
+ "fromPath")
+
ErrorRule = pctx.AndroidStaticRule("Error",
blueprint.RuleParams{
Command: `echo "$error" && false`,