-
Notifications
You must be signed in to change notification settings - Fork 58
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
Use the same version as package.json
in XCFramework
#6101
Conversation
Thanks for taking my suggestion! What do you think about passing the version configurations to the xcodebuild command here? |
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.
The test plan succeeded for me. 🎉 Thanks!
Thanks @crazytonyli ! I think that would work and it looks better that using Am I missing something? |
The current solution looks good to me. But I'm not sure what responsibilities should the "scaffold" project holds. We now have build related tasks in both the BTW, I believe you can also pass build settings to fastlane actions too. Fastlane is usually backwards compatible with |
Okay. I can stand behind that 👍
Sure. I'm pretty sure that would be possible out of the box. My point was that with the settings in the xcodeproj they would automatically apply to a build call made from Fastlane. |
Previously it was done via a build phase. See this GitHub conversation for the rationale: #6101 (comment)
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
1 similar comment
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
@crazytonyli addressed your suggestion in e277e38 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.
Thanks for taking my suggestions! I have left a couple of comments which may help further simplify the solution.
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $version" "$plist" | ||
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" "$plist" | ||
fi | ||
done |
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 script is not used anymore, I think?
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! I had forgotten about that one.
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.
Done via 6d5a033
ios-xcframework/build.sh
Outdated
@@ -63,6 +66,9 @@ if [ ! -d $HERMES_XCFRAMEWORK ]; then | |||
exit 1 | |||
fi | |||
|
|||
# Fail early if cannot fetch version | |||
VERSION=$(./bin/get_gutenberg_version) |
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 we can use jq
to replace this custom JSON parsing script: jq -e -r '.version' ./package.json
?
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 considered it, but decided against it to avoid having to ensure the tool is available locally.
Having said that... I guess it's safe to assume that to be the case and it doesn't take much to fail the script early if that's not the case 🤔
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.
Addressed in 8779e2e
|
||
# get the path to the parent folder using Dir methods | ||
package_name = 'package.json' | ||
path_to_package_json = File.join(File.dirname(File.dirname(File.dirname(File.absolute_path(__FILE__)))), package_name) |
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.
What do think using File.expand_path
, instead of multiple dirname
calls?
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 elaborate on this suggestion?
The code uses File.dirname
to have a platform-independent ..
. That is go up three parent folders.
There's no need for this to be platform-independent to be fair, but I find it a good habit to get into 🤷♂️
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.
BTW, addressing this is no longer necessary since the automation uses jq
as of 8779e2e
See conversation with @crazytonyli at #6101 (comment)
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.
Previously it was done via a build phase. See this GitHub conversation for the rationale: #6101 (comment)
Via RuboCop: Style/StderrPuts: Use `warn` instead of `$stderr.puts` to allow such output to be disabled.
It became unused in e277e38
See conversation with @crazytonyli at #6101 (comment)
8779e2e
to
9cb9689
Compare
See @crazytonyli suggestion here: #5769 (comment)
To test: Check the value in the generated
Info.plist
, either by runningnpm run xcframework:build
locally or by downloading and inspecting the CI artifact:PR submission checklist: