本文整理汇总了Python中pbxproj.XcodeProject.add_folder方法的典型用法代码示例。如果您正苦于以下问题:Python XcodeProject.add_folder方法的具体用法?Python XcodeProject.add_folder怎么用?Python XcodeProject.add_folder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbxproj.XcodeProject
的用法示例。
在下文中一共展示了XcodeProject.add_folder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testAddFolderNonRecursive
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
def testAddFolderNonRecursive(self):
project = XcodeProject(self.obj)
project.add_folder('samples/', recursive=False)
# should add test.framework and testLibrary.a and 2 groups, samples, dirA
samples = project.get_groups_by_name('samples')
dirA = project.get_groups_by_name('dirA')
dirB = project.get_groups_by_name('dirB')
self.assertNotEqual(samples, [])
self.assertNotEqual(dirA, [])
self.assertEqual(dirB, [])
self.assertEqual(samples[0].children.__len__(), 3) # dirA, test.framework, testLibrary.a
self.assertEqual(dirA[0].children.__len__(), 0)
示例2: testAddFolderWithExclusions
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
def testAddFolderWithExclusions(self):
project = XcodeProject(self.obj)
project.add_folder('samples', excludes=['file.\\.m', 'test.*'])
# should add test.framework and testLibrary.a and 2 groups, samples, dirA
samples = project.get_groups_by_name('samples')
dirA = project.get_groups_by_name('dirA')
dirB = project.get_groups_by_name('dirB')
self.assertNotEqual(samples, [])
self.assertNotEqual(dirA, [])
self.assertNotEqual(dirB, [])
self.assertEqual(samples[0].children.__len__(), 1) # dirA, -test.framework, -testLibrary.a
self.assertEqual(dirA[0].children.__len__(), 1) # dirB, -fileA.m
self.assertEqual(dirB[0].children.__len__(), 0) # -fileB.m
示例3: testAddFolderAsReference
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
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: testAddFolderRecursive
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
def testAddFolderRecursive(self):
project = XcodeProject(self.obj)
result = project.add_folder('samples')
# should add test.framework and testLibrary.a and 2 groups, samples, dirA
samples = project.get_groups_by_name('samples')
dirA = project.get_groups_by_name('dirA')
dirB = project.get_groups_by_name('dirB')
self.assertNotEqual(samples, [])
self.assertNotEqual(dirA, [])
self.assertNotEqual(dirB, [])
self.assertEqual(samples[0].children.__len__(), 3) # dirA, test.framework, testLibrary.a
self.assertEqual(dirA[0].children.__len__(), 2) # dirB, fileA.m
self.assertEqual(dirB[0].children.__len__(), 1) # fileB.m
示例5: testAddFolderNotAFolder
# 需要导入模块: from pbxproj import XcodeProject [as 别名]
# 或者: from pbxproj.XcodeProject import add_folder [as 别名]
def testAddFolderNotAFolder(self):
project = XcodeProject(self.obj)
result = project.add_folder('samples/testLibrary.a')
self.assertIsNone(result)