From 797cde96493cd932d3231b9d6b70867a385eb14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20L=C3=A4tt?= Date: Mon, 17 Aug 2020 17:23:26 +0300 Subject: [PATCH] Improvement: Attempt to parse product bundle identifier from root project (#43) * Add fallback to parse bundle id from root project build configuration * Bump version and update changelog --- CHANGELOG.md | 7 +++++++ bin/code_signing_manager.rb | 19 +++++++++++++++++-- src/codemagic/__version__.py | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a85c727a..808eb962 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Version 0.2.5 +------------- + +**Improvements** + +- Bugfix: Improve product bundle identifier resolving for settings code signing settings. + Version 0.2.4 ------------- diff --git a/bin/code_signing_manager.rb b/bin/code_signing_manager.rb index e9a956c2..999bc1d3 100755 --- a/bin/code_signing_manager.rb +++ b/bin/code_signing_manager.rb @@ -321,10 +321,25 @@ def get_bundle_id(target, build_configuration) resolver.resolve('PRODUCT_BUNDLE_IDENTIFIER', bundle_id) end + def get_bundle_id_from_root_project(build_configuration_name) + Log.info 'Attempt to obtain bundle id value from root object build configuration' + root_configurations = @project.root_object.build_configuration_list + unless root_configurations + Log.info 'Did not find root configurations from project' + return + end + root_configuration_settings = root_configurations.build_settings build_configuration_name + unless root_configuration_settings + Log.info "Did not find root configurations for configuration #{build_configuration_name}" + return + end + root_configuration_settings["PRODUCT_BUNDLE_IDENTIFIER"] + end + def get_bundle_id_from_base_conf(build_configuration) base_configuration_reference = build_configuration.base_configuration_reference if base_configuration_reference.nil? - return + return get_bundle_id_from_root_project build_configuration.name end unless File.exist?(base_configuration_reference.real_path) return @@ -354,7 +369,7 @@ def get_cf_bundle_identifier(build_configuration, target) resolver = VariableResolver.new(target, build_configuration) infoplist_file = resolver.resolve('INFOPLIST_FILE', infoplist_file) - Log.info "Build configuration #{build_configuration.name} INFOPLIST_FILE is '#{infoplist_file}" + Log.info "Build configuration #{build_configuration.name} INFOPLIST_FILE is '#{infoplist_file}'" if !infoplist_file _value = get_bundle_id_from_base_conf(build_configuration) else diff --git a/src/codemagic/__version__.py b/src/codemagic/__version__.py index 02a0832d..47ff6ce8 100644 --- a/src/codemagic/__version__.py +++ b/src/codemagic/__version__.py @@ -1,5 +1,5 @@ __title__ = "codemagic-cli-tools" __description__ = "CLI tools used in Codemagic builds" -__version__ = "0.2.4" +__version__ = "0.2.5" __url__ = 'https://github.com/codemagic-ci-cd/cli-tools' __licence__ = 'GNU General Public License v3.0'