-
Notifications
You must be signed in to change notification settings - Fork 7
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 lane to fetch/update dev certificates #16
Conversation
@@ -37,6 +37,8 @@ USER_ENV_FILE_PATH = File.join(Dir.home, '.a8c-apps', ENV_FILE_NAME) | |||
import 'lib/helpers.rb' | |||
|
|||
before_all do | |||
setup_ci if runner.current_platform == :ios |
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.
As far as I know, we are only using iOS at the moment.
But given the app is built with React Native, this will save us a warning/error if we'll ever run with platform :android
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 tested the signing lanes and they worked as expected 👍
I just had one curiosity question about the naming of the methods.
fastlane/Fastfile
Outdated
_set_up_code_signing(type: 'development', readonly: readonly) | ||
end | ||
|
||
def _set_up_code_signing(type:, readonly: true) |
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.
Is the underscore meant to signify that this method shouldn't be called directly?
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.
Actually... 🤔 My original intention was do distinguish the name of the method from the name of the lane, but there is no set_up_code_signing
lane so this approach is redundant.
Prefixing names with underscore is a convention in some environments to mark the prefixed thing as private, e.g. https://stackoverflow.com/a/15072306/809944
But your question made me wonder whether my assumption that a lane and a method with the same name cannot coexist is correct. Turns out it isn't. I created a set_up_code_signing
lane to verify it, see 2bfad90, which is also handy to regenerate all certs and profiles if need be.
Clearly the Fastlane DSL parser can distinguish between lanes and methods 😅
Furthermore, I added this to Fastfile
+
+lane :test_lane do
+ puts 'hi'
+ test_lane
+end
+
+def test_lane
+ puts 'hello'
+end
And I got this output
[20:49:06]: ------------------------------
[20:49:06]: --- Step: default_platform ---
[20:49:06]: ------------------------------
[20:49:06]: Driving the lane 'test_lane' 🚀
[20:49:06]: hi
[20:49:06]: hello
[20:49:06]: fastlane.tools finished successfully 🎉
Finally, it looks like Fastlane will give precedence to methods when running into a name clash
lane :other do
test_lane # which will it call? the method or the lane?
end
[20:52:18]: ------------------------------
[20:52:18]: --- Step: default_platform ---
[20:52:18]: ------------------------------
[20:52:18]: Driving the lane 'other' 🚀
[20:52:18]: hello
[20:52:18]: fastlane.tools finished successfully 🎉
What it says on the title 😄
Internal ref: https://a8c.slack.com/archives/CC7L49W13/p1719944861778989?thread_ts=1717565067.749429&cid=CC7L49W13