-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Xcode 9: Automatically detect selected provisioning profiles of the Xcode project #9460
Conversation
…code project This way fastlane will just keep working with Xcode 9 even for setups that don't use _match_ (yet). Xcode 9 requires a mapping of bundle identifier and what provisioning profile to use. We use `xcodeproj` to find those values, but in a way that _gym_ doesn't break if we can't detect those things I also verified that things work fine if you pass non-existent bundle identifier/profiles, Xcode will just ignore them 👍
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! Just a couple of questions, but otherwise 💯
@@ -292,7 +292,7 @@ def build_xcodebuild_showbuildsettings_command | |||
end | |||
|
|||
# Get the build settings for our project | |||
# this is used to properly get the DerivedData folder | |||
# this is used e.g. to properly get the DerivedData folder |
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 line should be reworded to just say e.g. to properly get the DerivedData folder
gym/README.md
Outdated
@@ -174,6 +174,20 @@ export_options( | |||
) | |||
``` | |||
|
|||
Optional: To pass a mapping of bundle identifiers to provisioning profiles, use the following |
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.
Should we add another comment here about why someone would want to use this?
gym/lib/gym/error_handler.rb
Outdated
@@ -80,6 +80,10 @@ def handle_package_error(output) | |||
print "This means, the specified provisioning profile was not created using" | |||
print "the specified certificate." | |||
print "Run cert and sigh before gym to make sure to have all signing resources ready" | |||
when /requires a provisioning profile/ | |||
print "No provisioning profile provided" | |||
print "Make sure to pass a valid provisioning for each rquired target" |
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.
*required
gym/lib/gym/detect_values.rb
Outdated
end | ||
|
||
Gym.config[:export_options] ||= {} | ||
Gym.config[:export_options][:provisioningProfiles] = provisioning_profile_mapping |
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.
Does this overwrite any export options that are already set?
Adresses feedback @ohayon
Does this PR take care of this change too? #9449 |
Nice catch @ohayon, seems like it's the same thing, but with a different approach. Let's make sure we use the better one 👍 |
As I mentioned in #9449, I like combining both approaches as they do not seem contradictive of each other. I do want to report a small bug I encountered while testing this PR combined with mine: When using
|
@KrauseFx when do you believe I can expect this to be merged in? |
Whops, I thought this was already merged, thanks for pinging me. Looking into this now 👍 |
Thanks for letting me know re workspace, I can reproduce @igor-makarov 👍 |
@igor-makarov Would you mind giving it another shot for your workspace? |
Still not working on my config... Two issues:
Because of that, in my setup, However, attempting to use Xcodeproj method This seems to be a limitation of Xcodeproj and I don't know how easy it is to address it. Perhaps @dantoml can clarify what can be done about this? |
@KrauseFx any updates on getting this merged? |
Yeah, it would be awesome if you could provide a sample project that can reproduce the problem. @andrerfneves we'll merge as soon as it's ready 😉 it seems like we still have some problems with workspaces. I'm not gonna be online tomorrow (Monday), so realistically I'll have time to finish this PR on Tuesday 👍 |
For now, you can always manually pass the provisioning profile mapping as described in the docs @andrerfneves |
@KrauseFx Ah! wasn't aware I could do that. Also initially thought the EDIT: Where would one find |
Without a sample project to reproduce the issue, I'm having a hard time fixing the problem 😢 |
I can provide one. Any reason not to merge the pull request I submitted, by the way? It doesn't conflict with this one. |
I've created the demo project. You can find it at https://github.com/igor-makarov/DemoWorkspaceWithXCConfig Note that the issue I'm running into isn't related to workspaces. It's related to inherited Also, my other issue (Iterating on the workspace can produce groups other than a project) that I've mentioned above, still needs to be addressed. |
@igor-makarov Thanks for preparing the sample project, I gave it a try by changing the bundle identifier to my project one, and things are working without any problems.
I'll dive in further to figure out what it is. |
# Conflicts: # gym/lib/gym/detect_values.rb
Alright, seems like things work for me, we can do a follow-up patch if things end up not working |
It seems that it matched the profiles from the |
Hey @KrauseFx 👋 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.44.0 🚀 |
FYI I still think it would fail under my config when not using So I guess I'm commenting just in case someone googles xcconfig in the future. |
@KrauseFx I've noticed this still fails when either the provisioning profile or the app bundle ID are inherited from the project configuration (rather than being defined in the target) and are constructed using build setting $(VARIABLES) - this causes values to be missing from the in the generated plist. If I've not explained this well enough, please let me know and am happy to produce an example project tomorrow :). Cheers |
@mjholgate This is my setup exactly and I already linked to a demo before. |
Yes, I couldn't reproduce, if you let me know how I can reproduce the problem with the sample project, I can work on a fix 👍 |
@KrauseFx I've provided the sample project earlier. The reason you haven't encountered the problem when reproducing is because you have |
…code project (fastlane#9460) * Xcode 9: Automatically detect selected provisioning profiles of the Xcode project This way fastlane will just keep working with Xcode 9 even for setups that don't use _match_ (yet). Xcode 9 requires a mapping of bundle identifier and what provisioning profile to use. We use `xcodeproj` to find those values, but in a way that _gym_ doesn't break if we can't detect those things I also verified that things work fine if you pass non-existent bundle identifier/profiles, Xcode will just ignore them 👍 * Remove old comment * Skip setting of empty provisioning profile mapping * Improve spelling Adresses feedback @ohayon * Add support for workspaces
This way fastlane will just keep working with Xcode 9 even for setups that don't use match (yet).
Xcode 9 requires a mapping of bundle identifier and what provisioning profile to use. We use
xcodeproj
to find those values, but in a way that gym doesn't break if we can't detect those thingsI also verified that things work fine if you pass non-existent bundle identifier/profiles, Xcode will just ignore them 👍
Fixes #9380 even more
Output when running it:
Error message if it's not auto-detected, catching Xcode error, and linking to the new docs :)