Skip to content

Commit

Permalink
[action][update_code_signing_settings] add sdk key to update_code_s…
Browse files Browse the repository at this point in the history
…igning_settings (#20655)

* feat: add sdk param to update_code_signing_settings

* fix: add key config

* fix: build setting string
  • Loading branch information
gabimoncha committed Nov 12, 2022
1 parent 991ce9b commit 96e71d5
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions fastlane/lib/fastlane/actions/update_code_signing_settings.rb
Expand Up @@ -36,18 +36,22 @@ def self.run(params)
end

style_value = params[:use_automatic_signing] ? 'Automatic' : 'Manual'
development_team_setting = params[:sdk] ? "DEVELOPMENT_TEAM[sdk=#{params[:sdk]}]" : "DEVELOPMENT_TEAM"
code_sign_identity_setting = params[:sdk] ? "CODE_SIGN_IDENTITY[sdk=#{params[:sdk]}]" : "CODE_SIGN_IDENTITY"
provisioning_profile_setting = params[:sdk] ? "PROVISIONING_PROFILE_SPECIFIER[sdk=#{params[:sdk]}]" : "PROVISIONING_PROFILE_SPECIFIER"

set_build_setting(config, "CODE_SIGN_STYLE", style_value)

if params[:team_id]
set_build_setting(config, "DEVELOPMENT_TEAM", params[:team_id])
set_build_setting(config, development_team_setting, params[:team_id])
UI.important("Set Team id to: #{params[:team_id]} for target: #{target.name} for build configuration: #{config.name}")
end
if params[:code_sign_identity]
set_build_setting(config, "CODE_SIGN_IDENTITY", params[:code_sign_identity])
set_build_setting(config, code_sign_identity_setting, params[:code_sign_identity])
UI.important("Set Code Sign identity to: #{params[:code_sign_identity]} for target: #{target.name} for build configuration: #{config.name}")
end
if params[:profile_name]
set_build_setting(config, "PROVISIONING_PROFILE_SPECIFIER", params[:profile_name])
set_build_setting(config, provisioning_profile_setting, params[:profile_name])
UI.important("Set Provisioning Profile name to: #{params[:profile_name]} for target: #{target.name} for build configuration: #{config.name}")
end
if params[:entitlements_file_path]
Expand Down Expand Up @@ -129,6 +133,10 @@ def self.available_options
description: "Defines if project should use automatic signing",
type: Boolean,
default_value: false),
FastlaneCore::ConfigItem.new(key: :sdk,
env_name: "FASTLANE_BUILD_SDK",
optional: true,
description: "Build target SDKs (iphoneos*, macosx*, iphonesimulator*)"),
FastlaneCore::ConfigItem.new(key: :team_id,
env_name: "FASTLANE_TEAM_ID",
optional: true,
Expand Down Expand Up @@ -183,10 +191,12 @@ def self.example_code
)',
' # more advanced manual code signing
update_code_signing_settings(
use_automatic_signing: true,
use_automatic_signing: false,
path: "demo-project/demo/demo.xcodeproj",
team_id: "QABC123DEV",
bundle_identifier: "com.demoapp.QABC123DEV",
code_sign_identity: "iPhone Distribution",
sdk: "iphoneos*",
profile_name: "Demo App Deployment Profile",
entitlements_file_path: "Demo App/generated/New.entitlements"
)'
Expand Down

0 comments on commit 96e71d5

Please sign in to comment.