How to use the pbxproj.pbxnode.PBXNode function in pbxproj

To help you get started, we’ve selected a few pbxproj examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
node = getattr(sys.modules[__name__], isa)(isa, guid)
			except Exception, e:
				utils.logger.Logger().error('PBXNode: "%s" is not supported yet: %s' % (isa, e))
				return None
			selfVars = vars(node).keys()
			for k, v in dic.items():
				if k in selfVars:
					setattr(node, k, v)
				else:
					utils.logger.Logger().warn('property:"%s" is not supported by PBXNode:%s yet' % (k, type(node)))
			node._internalInit()
			return node
		return None


class PBXBuildFile(PBXNode):
	def node(fileRef, guid=None):
		node = PBXBuildFile('PBXBuildFile', guid)
		node.fileRef = fileRef

	def __init__(self, isa=None, guid=None):
		super(PBXBuildFile, self).__init__('PBXBuildFile', guid)
		self.settings = {}
		self.fileRef = None

	def _contentDict(self):
		dic = super(PBXBuildFile, self)._contentDict()
		if self.fileRef is not None:
			dic['fileRef'] = self.fileRef
		if type(self.settings) is dict and len(self.settings) > 0:
			dic['settings'] = self.settings
		return dic
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
self.dependencies = []
		self.name = None
		self.productName = None

	def _contentDict(self):
		dic = super(PBXAggregateTarget, self)._contentDict()
		return dict(objectToDict(self, {
			'buildConfigurationList',
			'buildPhases',
			'dependencies',
			'name',
			'productName'
			}), **dic)


class PBXLegacyTarget(PBXNode):
	"""docstring for PBXLegacyTarget"""
	def __init__(self, isa=None, guid=None):
		super(PBXLegacyTarget, self).__init__('PBXLegacyTarget', guid)


class PBXNativeTarget(PBXNode):
	"""docstring for PBXNativeTarget"""
	def __init__(self, isa=None, guid=None):
		super(PBXNativeTarget, self).__init__('PBXNativeTarget', guid)
		self.buildConfigurationList = None
		self.buildPhases = []
		self.dependencies = []
		self.name = None
		self.productInstallPath = None
		self.productName = None
		self.productReference = None
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
def __init__(self, isa=None, guid=None):
		super(PBXBuildFile, self).__init__('PBXBuildFile', guid)
		self.settings = {}
		self.fileRef = None

	def _contentDict(self):
		dic = super(PBXBuildFile, self)._contentDict()
		if self.fileRef is not None:
			dic['fileRef'] = self.fileRef
		if type(self.settings) is dict and len(self.settings) > 0:
			dic['settings'] = self.settings
		return dic


class PBXContainerItemProxy(PBXNode):
	def node(self, guid=None):
		return PBXContainerItemProxy('PBXContainerItemProxy', guid)

	def __init__(self, isa=None, guid=None):
		super(PBXContainerItemProxy, self).__init__('PBXContainerItemProxy', guid)
		self.containerPortal = None  # Project object
		self.proxyType = None
		self.remoteGlobalIDString = None
		self.remoteInfo = None

	def _contentDict(self):
		dic = super(PBXContainerItemProxy, self)._contentDict()
		myVars = {'containerPortal', 'proxyType', 'remoteGlobalIDString', 'remoteInfo'}
		dic1 = objectToDict(self, myVars)
		return dict(dic, **dic1)  # merge dict
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
class XCVersionGroup(PBXGroup):
	"""docstring for XCVersionGroup"""
	def __init__(self, isa=None, guid=None):
		super(XCVersionGroup, self).__init__('XCVersionGroup', guid)
		self.currentVersion = None
		self.versionGroupType = None

	def _contentDict(self):
		dic = super(XCVersionGroup, self)._contentDict()
		return dict(objectToDict(self, {'currentVersion', 'versionGroupType'}), **dic)


### PBXBuildPhases ###
class PBXBuildPhase(PBXNode):
	"""base class of build phase node"""
	def __init__(self, isa, guid=None):
		super(PBXBuildPhase, self).__init__(isa, guid)
		self.files = []
		self.buildActionMask = 2147483647
		self.runOnlyForDeploymentPostprocessing = 0
		self.name = None
		self._al_displayName = None

	def node(self, isa, files=(), guid=None):
		node = PBXBuildPhase(isa, guid)
		node.files = list(files)
		return node

	def _contentDict(self):
		dic = super(PBXBuildPhase, self)._contentDict()
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
def __init__(self, isa=None, guid=None):
		super(PBXTargetDependency, self).__init__('PBXTargetDependency', guid)
		self.target = None
		self.targetProxy = None
		self.name = None

	def _contentDict(self):
		dic = super(PBXTargetDependency, self)._contentDict()
		return dict(objectToDict(self, {
			'target',
			'targetProxy',
			'name'
			}), **dic)


class XCBuildConfiguration(PBXNode):
	"""docstring for XCBuildConfiguration"""
	def __init__(self, isa=None, guid=None):
		super(XCBuildConfiguration, self).__init__('XCBuildConfiguration', guid)
		self.baseConfigurationReference = None
		self.buildSettings = {}
		self.name = None

	def _contentDict(self):
		dic = super(XCBuildConfiguration, self)._contentDict()
		resultDict = dict(objectToDict(self, {
			'baseConfigurationReference',
			'buildSettings',
			'name'
			}), **dic)
		if 'buildSettings' in resultDict and type(resultDict['buildSettings']) is dict:
			from collections import OrderedDict
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
def node(self, isa, guid=None):
		return PBXNode(isa, guid)
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
def __init__(self, isa, guid=None):
		super(PBXNode, self).__init__()
		self.isa = isa
		self.guid = PBXRefID(guid)
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
def _contentDict(self):
		dic = super(XCBuildConfiguration, self)._contentDict()
		resultDict = dict(objectToDict(self, {
			'baseConfigurationReference',
			'buildSettings',
			'name'
			}), **dic)
		if 'buildSettings' in resultDict and type(resultDict['buildSettings']) is dict:
			from collections import OrderedDict
			originalDict = resultDict['buildSettings']
			settingsDict = OrderedDict((k, originalDict[k]) for k in sorted(originalDict.keys()))
			resultDict['buildSettings'] = settingsDict
		return resultDict


class XCConfigurationList(PBXNode):
	"""docstring for XCConfigurationList"""
	def __init__(self, isa=None, guid=None):
		super(XCConfigurationList, self).__init__('XCConfigurationList', guid)
		self.buildConfigurations = []
		self.defaultConfigurationIsVisible = None
		self.defaultConfigurationName = None

	def _contentDict(self):
		dic = super(XCConfigurationList, self)._contentDict()
		return dict(objectToDict(self, {
			'buildConfigurations',
			'defaultConfigurationIsVisible',
			'defaultConfigurationName'
			}), **dic)
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
return dict(objectToDict(self, {
			'buildConfigurationList',
			'buildPhases',
			'dependencies',
			'name',
			'productName'
			}), **dic)


class PBXLegacyTarget(PBXNode):
	"""docstring for PBXLegacyTarget"""
	def __init__(self, isa=None, guid=None):
		super(PBXLegacyTarget, self).__init__('PBXLegacyTarget', guid)


class PBXNativeTarget(PBXNode):
	"""docstring for PBXNativeTarget"""
	def __init__(self, isa=None, guid=None):
		super(PBXNativeTarget, self).__init__('PBXNativeTarget', guid)
		self.buildConfigurationList = None
		self.buildPhases = []
		self.dependencies = []
		self.name = None
		self.productInstallPath = None
		self.productName = None
		self.productReference = None
		self.productType = None
		self.buildRules = []

	def _contentDict(self):
		dic = super(PBXNativeTarget, self)._contentDict()
		return dict(objectToDict(self, {
github alexlee002 / XcodeScripts / pbxproj / pbxnode.py View on Github external
dic = super(PBXShellScriptBuildPhase, self)._contentDict()
		return dict(objectToDict(self, {'inputPaths', 'outputPaths', 'shellPath', 'shellScript'}), **dic)


class PBXSourcesBuildPhase(PBXBuildPhase):
	"""docstring for PBXSourcesBuildPhase"""
	def __init__(self, isa=None, guid=None):
		super(PBXSourcesBuildPhase, self).__init__('PBXSourcesBuildPhase', guid)
		self._al_displayName = 'Sources'

	def node(self, files=(), guid=None):
		return super(PBXSourcesBuildPhase, self).node('PBXSourcesBuildPhase', files, guid)


### PBXTarget ###
class PBXAggregateTarget(PBXNode):
	"""docstring for PBXAggregateTarget"""
	def __init__(self, isa=None, guid=None):
		super(PBXAggregateTarget, self).__init__('PBXAggregateTarget', guid)
		self.buildConfigurationList = None
		self.buildPhases = []
		self.dependencies = []
		self.name = None
		self.productName = None

	def _contentDict(self):
		dic = super(PBXAggregateTarget, self)._contentDict()
		return dict(objectToDict(self, {
			'buildConfigurationList',
			'buildPhases',
			'dependencies',
			'name',