Fix objc entitlements substitution on OSX On BSD sed, the -e args need to go before the input file name -- MOS_MIGRATED_REVID=86246942
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 73554e5..67c6fcb 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 @@ .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)