Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variant groups #124

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pbxproj/pbxextensions/ProjectFiles.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ def _create_build_files(self, file_ref, attributes, build_phases):
results = []
# create the build file and add it to the phase
for target_build_phase in build_phases:
# check to see if we already have a PBXBuildFile for this file_ref in this phase, if so
# don't create another one
if any(str(self.objects[str(build_file)].fileRef) == file_ref.get_id() for build_file in target_build_phase.files):
continue

build_file = PBXBuildFile.create(file_ref, attributes)
self.objects[build_file.get_id()] = build_file
target_build_phase.add_build_file(build_file)
Expand Down
3 changes: 2 additions & 1 deletion pbxproj/pbxsections/PBXGroup.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pbxproj.PBXGenericObject import *
from pbxproj.pbxsections import *
from pbxproj.pbxsections.PBXVariantGroup import *


class PBXGroup(PBXGenericObject):
Expand Down Expand Up @@ -44,7 +45,7 @@ def has_child(self, child):

def add_child(self, child):
# if it's not the right type of children for the group
if not isinstance(child, PBXGroup) and not isinstance(child, PBXFileReference):
if not isinstance(child, PBXGroup) and not isinstance(child, PBXFileReference) and not isinstance(child, PBXVariantGroup):
return False

self.children.append(child.get_id())
Expand Down