You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/04/06 02:13:12 UTC

[1/2] ios commit: Fixed CB-377 - add a check for PM_APP, XC_APP, and DEVELOPER in the Makefile

Updated Branches:
  refs/heads/master 2bac46cef -> 3a48e6325


Fixed CB-377 - add a check for PM_APP,  XC_APP, and DEVELOPER in the Makefile


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/3a48e632
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/3a48e632
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/3a48e632

Branch: refs/heads/master
Commit: 3a48e6325c6ac5a157347d14142b093d7d60c992
Parents: 381e6a4
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu Apr 5 17:13:02 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Apr 5 17:13:02 2012 -0700

----------------------------------------------------------------------
 Makefile |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/3a48e632/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index d019613..4020752 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,13 @@
 # under the License.
 #
 
+##   You can set these environment variables: 
+##         XC_APP (path to your Xcode.app)
+##         PM_APP (path to your PackageMaker app)
+##         DEVELOPER (path to your Developer folder)
+##              - don't need to set this if  you use 'xcode-select'
+##              - in Xcode 4.3, this is within your app bundle: Xcode.app/Contents/Developer
+
 SHELL = /bin/bash
 CHMOD = chmod
 CP = cp
@@ -40,9 +47,9 @@ CONVERTPDF = /System/Library/Printers/Libraries/convert
 COMBINEPDF = /System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py
 DOXYGEN = 
 IPHONE_DOCSET_TMPDIR = docs/iphone/tmp
-XC_AVAILABLE = '$(shell mdfind "kMDItemFSName=='Xcode.app' && kMDItemKind=='Application'" | head -1)'
-DEVELOPER = '$(shell xcode-select -print-path)'
-PM_APP = '$(shell mdfind "kMDItemFSName=='PackageMaker.app' && kMDItemKind=='Application'" | head -1)'
+DEVELOPER ?= '$(shell xcode-select -print-path)'
+PM_APP ?= '$(shell mdfind "kMDItemFSName=='PackageMaker.app' && kMDItemKind=='Application'" | head -1)'
+XC_APP ?= '$(shell mdfind "kMDItemFSName=='Xcode.app' && kMDItemKind=='Application'" | head -1)'
 PACKAGEMAKER = '$(PM_APP)/Contents/MacOS/PackageMaker'
 XC = $(DEVELOPER)/usr/bin/xcodebuild
 CDV_VER = $(shell head -1 CordovaLib/VERSION)
@@ -156,15 +163,16 @@ check-os:
 	@if [ "$$OSTYPE" != "darwin11" ]; then echo "Error: You need to package the installer on a Mac OS X 10.7 Lion system."; exit 1; fi
 
 check-utils:
-		@if [ $(XC_AVAILABLE) == '' ] ; then \
-			echo -e '\033[31mError: Xcode.app was not found. Please download from the Mac App Store.\033[m'; exit 1;  \
+		@if [[ ! -e $(XC_APP) ]]; then \
+			echo -e '\033[31mError: Xcode.app at "$(XC_APP)" was not found. Please download from the Mac App Store.\033[m'; exit 1;  \
 		fi
 		@if [[ ! -d $(DEVELOPER) ]]; then \
-			echo -e '\033[31mError: The Xcode folder at $(DEVELOPER) was not found. Please set it to the proper one using xcode-select. For Xcode >= 4.3.1, set it using "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer"\033[m'; exit 1;  \
+			echo -e '\033[31mError: The Xcode folder at "$(DEVELOPER)" was not found. Please set it to the proper one using xcode-select. For Xcode >= 4.3.1, set it using "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer".\033[m'; exit 1;  \
 		fi
-		@if [ $(PM_APP) == '' ] ; then \
+		@if [[ ! -e $(PM_APP) ]]; then \
 			echo -e '\033[31mError: PackageMaker.app was not found. You need to download the Xcode Auxiliary Tools: https://developer.apple.com/downloads/index.action?name=auxiliary\033[m'; exit 1; \
 		fi
+		@echo -e "Xcode.app: \t\t\033[33m$(XC_APP)\033[m";
 		@echo -e "Using Developer folder: \033[33m$(DEVELOPER)\033[m";
 		@echo -e "Using PackageMaker app: \033[33m$(PM_APP)\033[m";