aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Daniel Wagner-Hall <danielwh@google.com>2015-02-13 07:04:39 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-02-13 07:04:39 +0000
commit33d0368f977bc71b82c59cddd29cb556da37a97f (patch)
tree99cc2471c77b6eec551ca417e01f698859627eef
parent709b1afd5d4aea223de7b316264c775583215410 (diff)
Fix objc entitlements substitution on OSX
On BSD sed, the -e args need to go before the input file name -- MOS_MIGRATED_REVID=86246942
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ApplicationSupport.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ApplicationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ApplicationSupport.java
index 73554e5d90..67c6fcbf6d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ApplicationSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ApplicationSupport.java
@@ -482,15 +482,16 @@ public final class ApplicationSupport {
.addArgument("-c")
.addArgument("set -e && "
+ "PREFIX=\"$(cat " + prefix.getExecPathString() + ")\" && "
- + "sed " + in.getExecPathString() + " "
- // Replace .* from default entitlements file with bundle ID where suitable.
+ + "sed "
+ // Replace .* from default entitlements file with bundle ID where suitable.
+ "-e \"s#${PREFIX}\\.\\*#${PREFIX}." + escapedBundleId + "#g\" "
-
+
// Replace some variables that people put in their own entitlements files
+ "-e \"s#\\$(AppIdentifierPrefix)#${PREFIX}.#g\" "
+ "-e \"s#\\$(CFBundleIdentifier)#" + escapedBundleId + "#g\" "
- + "> " + out.getExecPathString())
+ + in.getExecPathString() + " "
+ + "> " + out.getExecPathString())
.addInput(in)
.addInput(prefix)
.addOutput(out)