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

Implement support for projects using Swift Package Manager #59

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add processing for 'packageProductDependencies'
  • Loading branch information
JanNash committed Nov 12, 2020
commit 95331010b31fa5dce00ea3131f65932c0957ced2
16 changes: 16 additions & 0 deletions xUnique.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,15 @@ def __unique_target(self, target_hex):
current_node = self.nodes[target_hex]
bcl_hex = current_node['buildConfigurationList']
self.__unique_build_configuration_list(target_hex, bcl_hex)

try:
package_product_dependency_list = current_node['packageProductDependencies']
if package_product_dependency_list:
for package_product_dependency_hex in package_product_dependency_list:
self.__unique_package_product_dependency(target_hex, package_product_dependency_hex)
except KeyError:
pass

dependencies_list = current_node.get('dependencies')
if dependencies_list:
self.vprint('uniquify PBXTargetDependency')
Expand Down Expand Up @@ -431,6 +440,13 @@ def __unique_target_dependency(self, parent_hex, target_dependency_hex):
raise XUniqueExit('PBXTargetDependency item "', target_dependency_hex,
'" is invalid due to lack of "targetProxy" attribute')

def __unique_package_product_dependency(self, parent_hex, package_product_dependency_hex):
"""XCSwiftPackageProductDependency"""
self.vprint('uniquify XCSwiftPackageProductDependency')
cur_path_key = 'isa'
self.vprint(package_product_dependency_hex)
self.__set_to_result(parent_hex, package_product_dependency_hex, cur_path_key)

def __unique_container_item_proxy(self, parent_hex, container_item_proxy_hex):
"""PBXContainerItemProxy"""
self.vprint('uniquify PBXContainerItemProxy')
Expand Down