incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: [CB-1456] bin/diagnose_project script prints Build Settings from the project settings, not the target settings
Date Fri, 14 Sep 2012 01:54:57 GMT
Updated Branches:
  refs/heads/master f03d50253 -> f187cdd74


[CB-1456] bin/diagnose_project script prints Build Settings from the project settings, not
the target settings


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/f187cdd7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/f187cdd7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/f187cdd7

Branch: refs/heads/master
Commit: f187cdd742ae179263192abad231f26d153e9be8
Parents: f03d502
Author: Shazron Abdullah <shazron@apache.org>
Authored: Thu Sep 13 18:54:22 2012 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Thu Sep 13 18:54:43 2012 -0700

----------------------------------------------------------------------
 bin/diagnose_project |   42 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 38 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/f187cdd7/bin/diagnose_project
----------------------------------------------------------------------
diff --git a/bin/diagnose_project b/bin/diagnose_project
index 810bb49..7e70ce6 100755
--- a/bin/diagnose_project
+++ b/bin/diagnose_project
@@ -37,7 +37,30 @@ def getXcodePlist(pbxPath):
 
 	return plistlib.readPlist( tmpfile )
 	
-def getXcodeBuildSettings(diagKeys, xcodePlist):
+def getTargetBuildSettings(diagKeys, xcodePlist):
+	allObjects = xcodePlist['objects']
+	rootObj = allObjects[ xcodePlist['rootObject'] ]
+	
+	buildSettings = {};
+	
+	targetguids = rootObj['targets']
+	for targetguid in targetguids:
+		target = allObjects[ targetguid ]
+		targetname = target['name']
+		targetSettings = {}
+		bclist = allObjects[ target['buildConfigurationList'] ]['buildConfigurations']
+		for conflist in bclist:
+			cl = allObjects[conflist];
+			clname = cl.get("name", 'no name')
+			targetSettings[clname] = {}
+			for key in diagKeys:
+				val = cl['buildSettings'].get(key, '(not found)')
+				targetSettings[clname][key] = val
+		buildSettings[targetname] = targetSettings
+
+	return buildSettings
+
+def getProjectBuildSettings(diagKeys, xcodePlist):
 	allObjects = xcodePlist['objects']
 	rootObj = allObjects[ xcodePlist['rootObject'] ]
 	
@@ -53,6 +76,16 @@ def getXcodeBuildSettings(diagKeys, xcodePlist):
 			buildSettings[clname][key] = val
 	
 	return buildSettings
+	
+def getXcodeBuildSettings(diagKeys, xcodePlist):
+	projectSettings = getProjectBuildSettings(diagKeys, xcodePlist)
+	targetSettings = getTargetBuildSettings(diagKeys, xcodePlist)
+
+	settings = {}
+	settings['Project'] = projectSettings
+	settings['Targets'] = targetSettings
+	
+	return settings
   
 def main(argv):
 	if len(argv) != 2:
@@ -118,16 +151,17 @@ def main(argv):
 	for sp in subprojValues:
 	  if cdvlibProjName in sp['path']:
 	  	if 'CORDOVALIB' in sp['sourceTree']:
-			print "Your project is using the CORDOVALIB Xcode variable (source tree)."
+			print "Your project *IS* using the CORDOVALIB Xcode variable (source tree)."
 	  		cdvlibPath = os.path.join( xcodeCordovaLib, cdvlibProjName)
 	  	else:
+			print "Your project is *NOT* using the CORDOVALIB Xcode variable (source tree)."
 	  		cdvlibPath = sp['path']
   	
-	print "Path is:", cdvlibPath, "\n"
-
 	cdvlibNormalizedPath = os.path.normpath( os.path.join(parent_project_path, cdvlibPath) )
 	cdvlibPbx = os.path.join( cdvlibNormalizedPath , 'project.pbxproj' )
 
+	print "Path is:", cdvlibNormalizedPath, "\n"
+
 	cdvPlist = getXcodePlist(cdvlibPbx)
 	cdvBuildSettingsKeys = ['PUBLIC_HEADERS_FOLDER_PATH', 'ARCHS', 'USER_HEADER_SEARCH_PATHS',
'IPHONEOS_DEPLOYMENT_TARGET', 'OTHER_LDFLAGS', 'GCC_VERSION']
 


Mime
View raw message