Skip to content

Commit

Permalink
Improvement: Attempt to parse product bundle identifier from root pro…
Browse files Browse the repository at this point in the history
…ject (#43)

* Add fallback to parse bundle id from root project build configuration

* Bump version and update changelog
  • Loading branch information
priitlatt authored Aug 17, 2020
1 parent bc545dc commit 797cde9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Version 0.2.5
-------------

**Improvements**

- Bugfix: Improve product bundle identifier resolving for settings code signing settings.

Version 0.2.4
-------------

Expand Down
19 changes: 17 additions & 2 deletions bin/code_signing_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/codemagic/__version__.py
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 797cde9

Please sign in to comment.