From 3df8b79502df992b35389e9da6f02cc60e26c5cb Mon Sep 17 00:00:00 2001 From: Jonathan MacMillan Date: Fri, 24 Jul 2015 00:24:24 -0400 Subject: [PATCH 1/2] Update build-mogenerator-Info.plist.sh to use DERIVED_FILE_DIR instead of TMPDIR. TMPDIR is not well-defined, but DERIVED_FILE_DIR is during an Xcode build. Also, make sure paths are quoted. --- build-mogenerator-Info-plist.sh | 5 +++-- mogenerator.xcodeproj/project.pbxproj | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build-mogenerator-Info-plist.sh b/build-mogenerator-Info-plist.sh index 6d4284ca..0bd7e55f 100644 --- a/build-mogenerator-Info-plist.sh +++ b/build-mogenerator-Info-plist.sh @@ -1,4 +1,5 @@ -rm -f $TMPDIR/mogenerator-Info.plist +TMPDIR=${DERIVED_FILE_DIR} +rm -f "${TMPDIR}/mogenerator-Info.plist" /usr/libexec/PlistBuddy \ -c "Clear" \ -c "Import :human.h.motemplate templates/human.h.motemplate" \ @@ -7,4 +8,4 @@ rm -f $TMPDIR/mogenerator-Info.plist -c "Import :machine.h.motemplate templates/machine.h.motemplate" \ -c "Import :machine.m.motemplate templates/machine.m.motemplate" \ -c "Import :machine.swift.motemplate templates/machine.swift.motemplate" \ - $TMPDIR/mogenerator-Info.plist + "${TMPDIR}/mogenerator-Info.plist" diff --git a/mogenerator.xcodeproj/project.pbxproj b/mogenerator.xcodeproj/project.pbxproj index 61695a58..12f9ad06 100644 --- a/mogenerator.xcodeproj/project.pbxproj +++ b/mogenerator.xcodeproj/project.pbxproj @@ -531,7 +531,7 @@ "-sectcreate", __TEXT, __info_plist, - "$TMPDIR/mogenerator-Info.plist", + "$(DERIVED_FILE_DIR)/mogenerator-Info.plist", ); PRODUCT_NAME = mogenerator; WARNING_CFLAGS = "-Wall"; @@ -552,7 +552,7 @@ "-sectcreate", __TEXT, __info_plist, - "$TMPDIR/mogenerator-Info.plist", + "$(DERIVED_FILE_DIR)/mogenerator-Info.plist", ); PRODUCT_NAME = mogenerator; WARNING_CFLAGS = "-Wall"; From 0a73545d0c0b12883649413a28add9ea87a10b49 Mon Sep 17 00:00:00 2001 From: Jonathan MacMillan Date: Fri, 24 Jul 2015 01:46:12 -0400 Subject: [PATCH 2/2] Add inputs and outputs to the script. xcodebuild fails if these aren't set. --- mogenerator.xcodeproj/project.pbxproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mogenerator.xcodeproj/project.pbxproj b/mogenerator.xcodeproj/project.pbxproj index 12f9ad06..367e8b18 100644 --- a/mogenerator.xcodeproj/project.pbxproj +++ b/mogenerator.xcodeproj/project.pbxproj @@ -439,8 +439,15 @@ files = ( ); inputPaths = ( + "$(SRCROOT)/templates/human.m.motemplate", + "$(SRCROOT)/templates/human.h.motemplate", + "$(SRCROOT)/templates/human.swift.motemplate", + "$(SRCROOT)/templates/machine.h.motemplate", + "$(SRCROOT)/templates/machine.m.motemplate", + "$(SRCROOT)/templates/machine.swift.motemplate", ); outputPaths = ( + "$(DERIVED_FILE_DIR)/motemplate-Info.plist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh;