Skip to content

Commit

Permalink
Add parameter code_signing_identity for CODE_SIGN_IDENTITY setting (#…
Browse files Browse the repository at this point in the history
…12326)

* Add parameter codesigning_identity for CODE_SIGN_IDENTITY setting

* Add parameter codesigning_identity for CODE_SIGN_IDENTITY setting

* Fix Style/NonNilCheck & Style/IdenticalConditionalBranches

* Change param name & using the better way to adjust other platforms

* Add if code_signing_identity to avoid cleared out if not specified
  • Loading branch information
HarrisHan authored and Josh Holtz committed May 18, 2018
1 parent 51c3758 commit ab13e6c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions fastlane/lib/fastlane/actions/update_project_provisioning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def self.run(params)

target_filter = params[:target_filter] || params[:build_configuration_filter]
configuration = params[:build_configuration]
code_signing_identity = params[:code_signing_identity]

# manipulate project file
UI.success("Going to update project '#{folder}' with UUID")
Expand All @@ -63,6 +64,13 @@ def self.run(params)
next
end

if code_signing_identity
codesign_build_settings_keys = build_configuration.build_settings.keys.select { |key| key.to_s.match(/CODE_SIGN_IDENTITY.*/) }
codesign_build_settings_keys.each do |setting|
build_configuration.build_settings[setting] = code_signing_identity
end
end

build_configuration.build_settings["PROVISIONING_PROFILE"] = data["UUID"]
build_configuration.build_settings["PROVISIONING_PROFILE_SPECIFIER"] = data["Name"]
end
Expand Down Expand Up @@ -129,7 +137,11 @@ def self.available_options
FastlaneCore::ConfigItem.new(key: :certificate,
env_name: "FL_PROJECT_PROVISIONING_CERTIFICATE_PATH",
description: "Path to apple root certificate",
default_value: "/tmp/AppleIncRootCertificate.cer")
default_value: "/tmp/AppleIncRootCertificate.cer"),
FastlaneCore::ConfigItem.new(key: :code_signing_identity,
env_name: "FL_PROJECT_PROVISIONING_CODE_SIGN_IDENTITY",
description: "Code sign identity for build configuration",
optional: true)
]
end

Expand All @@ -147,7 +159,8 @@ def self.example_code
xcodeproj: "Project.xcodeproj",
profile: "./watch_app_store.mobileprovision", # optional if you use sigh
target_filter: ".*WatchKit Extension.*", # matches name or type of a target
build_configuration: "Release"
build_configuration: "Release",
code_signing_identity: "iPhone Development" # optionally specify the codesigning identity
)'
]
end
Expand Down

0 comments on commit ab13e6c

Please sign in to comment.