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

Bugfix: Configure code signing for iOS UI testing targets #258

Merged
merged 6 commits into from
Sep 5, 2022
Merged
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: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Version 0.31.4
Version 0.32.0
-------------

**Bugfixes**
- Configure proper signing info settings for Xcode UI testing targets with action `xcode-project use-profiles` provided that suitable signing files exist. [PR #258](https://github.com/codemagic-ci-cd/cli-tools/pull/258)

**Docs**
- Replace dead docstrings for `Profiles Profiles.list_device_ids`, `Profiles.list_certificate_ids`, `Profiles.get_bundle_id_resource_id` with pointers to the resources. Reported in [issue #237](https://github.com/codemagic-ci-cd/cli-tools/issues/237). [PR #259](https://github.com/codemagic-ci-cd/cli-tools/pull/259)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "codemagic-cli-tools"
version = "0.31.4"
version = "0.32.0"
description = "CLI tools used in Codemagic builds"
readme = "README.md"
authors = [
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.31.2.dev'
__version__ = '0.32.0.dev'
__url__ = 'https://github.com/codemagic-ci-cd/cli-tools'
__licence__ = 'GNU General Public License v3.0'
12 changes: 10 additions & 2 deletions src/codemagic/scripts/code_signing_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ def self.error(message)

class CodeSigningManager

UI_TESTING_PRODUCT_TYPE = "com.apple.product-type.bundle.ui-testing"

SKIP_SIGNING_PRODUCT_TYPES = [
"com.apple.product-type.bundle", # Product type Bundle
"com.apple.product-type.framework", # Product type Framework
"com.apple.product-type.bundle.ui-testing", # Product type UI test
"com.apple.product-type.bundle.unit-test", # Product type Unit Test
]

Expand Down Expand Up @@ -292,6 +293,13 @@ def set_configuration_build_settings(build_target, build_configuration)
return
end

if build_target.product_type == UI_TESTING_PRODUCT_TYPE
# Xcode 11+ appends `.xctrunner` suffix to UI testing target bundle identifier
# This shows an error in Xcode user interface, but is required for building
# tests bundle for on-device testing.
bundle_id = "#{bundle_id}.xctrunner"
end

Log.info "Resolved bundle id '#{bundle_id}' from #{source} for build configuration '#{build_configuration.name}'"
profile = nil
@profiles.each do |prov_profile|
Expand Down Expand Up @@ -336,7 +344,7 @@ def set_target_build_settings(target)

handle_target_dependencies(target)
if SKIP_SIGNING_PRODUCT_TYPES.include? target.product_type
Log.info("Will use empty code signing build settings for target '#{target}'")
Log.info("Will use empty code signing build settings for target '#{target}' or type #{target.product_type}")
skip_code_signing(target)
return
end
Expand Down