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
Add parameter code_signing_identity for CODE_SIGN_IDENTITY setting #12326
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
@googlebot |
CLAs look good, thanks! |
@@ -148,7 +160,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", | |||
codesigning_identity: "iPhone Development" #specified the codesigning identity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to be # optionally specify the codesigning identity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for ur advice I had update the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small nit picks 🙃
unless build_configuration.build_settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"].nil? | ||
build_configuration.build_settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = codesigning_identity | ||
end | ||
build_configuration.build_settings["CODE_SIGN_IDENTITY"] = codesigning_identity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the code in this unless
to be...
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] = codesigning_identity
end
so that it works with other platforms and not just iOS? Inspired by https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/automatic_code_signing.rb#L46-L49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea
@@ -130,7 +138,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: :codesigning_identity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also change this key to code_signing_identity
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for ur advice I had update the code
@HarrisHan Are you still interested in getting this merged in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshdholtz Thanks for your advice & I have update the code
unless build_configuration.build_settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"].nil? | ||
build_configuration.build_settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = codesigning_identity | ||
end | ||
build_configuration.build_settings["CODE_SIGN_IDENTITY"] = codesigning_identity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
CLAs look good, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have update the code
@@ -63,6 +64,11 @@ def self.run(params) | |||
next | |||
end | |||
|
|||
codesign_build_settings_keys = build_configuration.build_settings.keys.select { |key| key.to_s.match(/CODE_SIGN_IDENTITY.*/) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this need to be wrapped in a if code_signing_identity
otherwise things will get cleared out if not specified 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshdholtz Thx 😬 I have update the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thanks for the contribution ❤️
Hey @HarrisHan 👋 Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉 Please let us know if this change requires an immediate release by adding a comment here 👍 |
Congratulations! 🎉 This was released as part of fastlane 2.96.0 🚀 |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validMotivation and Context
When Release Archive a project with the
development
export methodThe Release XCBuildConfiguration's
CODE_SIGN_IDENTITY[sdk=iphoneos*]
defualt value is"iPhone Distribution"
This will cause the profile doesn't include distribution signing certificate
The same as the Debug Archive with
ad-hoc
export method for Debug XCBuildConfiguration'sCODE_SIGN_IDENTITY
defualt value isiPhone Developer
So I add a parameter for
update_project_provisioning
to change theCODE_SIGN_IDENTITY
inXCBuildConfiguration
so that the certificate will be findI use the changed
update_project_provisioning
action in my local project It worked wellDescription
Add parameter
codesigning_identity
for actionupdate_project_provisioning
which you can set toiPhone Developer
oriPhone Distribution
according to the demand