本文整理汇总了Python中pbxproj.XcodeProject类的典型用法代码示例。如果您正苦于以下问题:Python XcodeProject类的具体用法?Python XcodeProject怎么用?Python XcodeProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XcodeProject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testEmbedFrameworkInRightCopySection
def testEmbedFrameworkInRightCopySection(self):
project = XcodeProject(self.obj)
self.assertEqual(project.objects.get_objects_in_section(u'PBXCopyFilesBuildPhase').__len__(), 1)
project.add_file('X.framework', file_options=FileOptions(embed_framework=True))
self.assertEqual(project.objects.get_objects_in_section(u'PBXCopyFilesBuildPhase').__len__(), 3)
示例2: testAddFileUnknownAllowed
def testAddFileUnknownAllowed(self):
project = XcodeProject(self.obj)
build_file = project.add_file("file.unknowntype", file_options=FileOptions(ignore_unknown_type=True))
# unknown files are added as resources
self.assertEqual(project.objects.get_objects_in_section(u'PBXResourcesBuildPhase').__len__(), 2)
self.assertEqual(build_file.__len__(), 2)
示例3: testAddFolderAsReference
def testAddFolderAsReference(self):
project = XcodeProject(self.obj,path="tests/project.pbxproj")
build_file = project.add_folder('samples', create_groups=False)
self.assertListEqual(project.get_groups_by_name('samples'), [])
self.assertEqual(project.objects.get_objects_in_section(u'PBXResourcesBuildPhase').__len__(), 2)
self.assertEqual(build_file.__len__(), 2)
示例4: testAddCodeSignAllTargetAllConfigurations
def testAddCodeSignAllTargetAllConfigurations(self):
project = XcodeProject(self.obj)
project.add_code_sign('iPhone Distribution', 'MYTEAM', '0x0x0x0x0', 'Provisioning name')
self.assertEqual(project.objects['0'].attributes.TargetAttributes[u'1'].ProvisioningStyle, PBXProvioningTypes.MANUAL)
self.assertEqual(project.objects['0'].attributes.TargetAttributes[u'2'].ProvisioningStyle,
PBXProvioningTypes.MANUAL)
self.assertEqual(project.objects['5'].buildSettings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'], 'iPhone Distribution')
self.assertEqual(project.objects['6'].buildSettings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'], 'iPhone Distribution')
self.assertEqual(project.objects['7'].buildSettings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'], 'iPhone Distribution')
self.assertEqual(project.objects['8'].buildSettings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'], 'iPhone Distribution')
self.assertEqual(project.objects['5'].buildSettings['DEVELOPMENT_TEAM'], 'MYTEAM')
self.assertEqual(project.objects['6'].buildSettings['DEVELOPMENT_TEAM'], 'MYTEAM')
self.assertEqual(project.objects['7'].buildSettings['DEVELOPMENT_TEAM'], 'MYTEAM')
self.assertEqual(project.objects['8'].buildSettings['DEVELOPMENT_TEAM'], 'MYTEAM')
self.assertEqual(project.objects['5'].buildSettings['PROVISIONING_PROFILE'], '0x0x0x0x0')
self.assertEqual(project.objects['6'].buildSettings['PROVISIONING_PROFILE'], '0x0x0x0x0')
self.assertEqual(project.objects['7'].buildSettings['PROVISIONING_PROFILE'], '0x0x0x0x0')
self.assertEqual(project.objects['8'].buildSettings['PROVISIONING_PROFILE'], '0x0x0x0x0')
self.assertEqual(project.objects['5'].buildSettings['PROVISIONING_PROFILE_SPECIFIER'], 'Provisioning name')
self.assertEqual(project.objects['6'].buildSettings['PROVISIONING_PROFILE_SPECIFIER'], 'Provisioning name')
self.assertEqual(project.objects['7'].buildSettings['PROVISIONING_PROFILE_SPECIFIER'], 'Provisioning name')
self.assertEqual(project.objects['8'].buildSettings['PROVISIONING_PROFILE_SPECIFIER'], 'Provisioning name')
示例5: testAddFileSource
def testAddFileSource(self):
project = XcodeProject(self.obj)
build_file = project.add_file("file.m")
# 2 source files are created 1 x target
self.assertEqual(project.objects.get_objects_in_section(u'PBXSourcesBuildPhase').__len__(), 2)
self.assertEqual(build_file.__len__(), 2)
示例6: testAddLibrarySearchPaths
def testAddLibrarySearchPaths(self):
project = XcodeProject(self.obj)
project.add_library_search_paths('path/to/search')
self.assertEqual(project.objects['5'].buildSettings.LIBRARY_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['6'].buildSettings.LIBRARY_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['7'].buildSettings.LIBRARY_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['8'].buildSettings.LIBRARY_SEARCH_PATHS, 'path/to/search/**')
示例7: testAddHeaderSearchPaths
def testAddHeaderSearchPaths(self):
project = XcodeProject(self.obj)
project.add_header_search_paths('path/to/search')
self.assertEqual(project.objects['5'].buildSettings.HEADER_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['6'].buildSettings.HEADER_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['7'].buildSettings.HEADER_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['8'].buildSettings.HEADER_SEARCH_PATHS, 'path/to/search/**')
示例8: testAddOtherLDFlags
def testAddOtherLDFlags(self):
project = XcodeProject(self.obj)
project.add_other_ldflags('-ObjC')
self.assertEqual(project.objects['5'].buildSettings.OTHER_LDFLAGS, '-ObjC')
self.assertEqual(project.objects['6'].buildSettings.OTHER_LDFLAGS, '-ObjC')
self.assertEqual(project.objects['7'].buildSettings.OTHER_LDFLAGS, '-ObjC')
self.assertEqual(project.objects['8'].buildSettings.OTHER_LDFLAGS, '-ObjC')
示例9: testAddFlags
def testAddFlags(self):
project = XcodeProject(self.obj)
project.add_flags('flag', '-flag')
self.assertEqual(project.objects['5'].buildSettings.flag, '-flag')
self.assertEqual(project.objects['6'].buildSettings.flag, '-flag')
self.assertEqual(project.objects['7'].buildSettings.flag, '-flag')
self.assertEqual(project.objects['8'].buildSettings.flag, '-flag')
示例10: testAddFrameworkSearchPaths
def testAddFrameworkSearchPaths(self):
project = XcodeProject(self.obj)
project.add_framework_search_paths('path/to/search')
self.assertEqual(project.objects['5'].buildSettings.FRAMEWORK_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['6'].buildSettings.FRAMEWORK_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['7'].buildSettings.FRAMEWORK_SEARCH_PATHS, 'path/to/search/**')
self.assertEqual(project.objects['8'].buildSettings.FRAMEWORK_SEARCH_PATHS, 'path/to/search/**')
示例11: testAddProjectNotForced
def testAddProjectNotForced(self):
project = XcodeProject(self.obj)
_ = project.add_project('samplescli/dependency.xcodeproj', file_options=FileOptions(create_build_files=False))
reference_proxies = project.add_project('samplescli/dependency.xcodeproj', force=False,
file_options=FileOptions(create_build_files=False))
self.assertListEqual(reference_proxies, [])
示例12: testGetGroupsByPathFromParent
def testGetGroupsByPathFromParent(self):
project = XcodeProject(self.obj)
groups = project.get_groups_by_path('..', parent=project.objects['1p'])
self.assertIn(project.objects['2p'], groups)
self.assertIn(project.objects['3p'], groups)
self.assertNotIn(project.objects['5p'], groups)
self.assertNotIn(project.objects['6p'], groups)
示例13: testRemoveByIdRecursivelyWithFiles
def testRemoveByIdRecursivelyWithFiles(self):
project = XcodeProject(self.obj)
result = project.remove_group_by_id('a')
self.assertTrue(result)
self.assertIsNone(project.objects['a'])
self.assertIsNone(project.objects['b'])
self.assertIsNone(project.objects['c'])
示例14: testAddFileWithAbsolutePathOnUnknownTree
def testAddFileWithAbsolutePathOnUnknownTree(self):
project = XcodeProject(self.obj)
build_file = project.add_file(os.path.abspath("samples/test.framework"), tree='DEVELOPER_DIR')
self.assertEqual(project.objects[build_file[0].fileRef].sourceTree, '<absolute>')
self.assertEqual(project.objects[build_file[1].fileRef].sourceTree, '<absolute>')
self.assertEqual(project.objects[build_file[2].fileRef].sourceTree, '<absolute>')
self.assertEqual(project.objects[build_file[3].fileRef].sourceTree, '<absolute>')
示例15: testGetGroupsByNameFromParent
def testGetGroupsByNameFromParent(self):
project = XcodeProject(self.obj)
groups = project.get_groups_by_name('app', parent=project.objects['1'])
self.assertIn(project.objects['2'], groups)
self.assertIn(project.objects['3'], groups)
self.assertNotIn(project.objects['5'], groups)
self.assertNotIn(project.objects['6'], groups)