-
Notifications
You must be signed in to change notification settings - Fork 419
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 10.1 + Carthage support #360
Conversation
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 it and it works for me. It stays in the same philosophy as the previous Carthage support, but this time it doesn't rely on an implementation detail of SwiftPM.
I had issues running the Pre-actions at first, because of swiftenv
. But I believe it is a weird behavior not coming from this PR. I filed it here on the swiftenv
repo.
Another solution may be to use XcodeGen instead of generating the xcodeproj through SwiftPM, but I did not manage to do it, so I would go for that in the meantime.
Note: it may not be compatible with Xcode 9, but that probably only means that people wanting it for Xcode 9 would have to use and older release, which I believe is acceptable.
Thanks a lot @byuarus for the work!
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.
Wow, thank you for this! It feels like a hack, and it sucks that we have to resort to this, but I guess that it’s the best way for a deterministically working Carthage support.
Looks good; just two nits. Also, are you (and or @JonasVautherin) willing to maintain this script in the future, in case it gets broken by future Swift or Carthage versions?
fix-carthage-paths.rb
Outdated
repoNameInXcodeproj = stringArray[0] | ||
|
||
if !repoNameInXcodeproj.nil? and repoNameInXcodeproj.include? ".git-" | ||
|
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.
Nit: extra newline
patch-carthage-project.rb
Outdated
|
||
swift_protobuf_target.new_shell_script_build_phase | ||
# 3) Adding to SwiftGRPC-Package.xcscheme a script to Pre-Actions of BuildAction. | ||
# Script will resolve SPM dependecies and will fix paths issues for SwiftGRPC-Carthage.xcodeproj before everytime before build action |
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.
nit: Could you fix the grammar of this sentence and explain that it fixes the issues by MOVING the existing files rather than changing the Xcode project?
The DronecodeSDK depends on grpc-swift, and supports Carthage. So we will be using that support for a while. Also, Carthage may support SwiftPM projects at some point 🤞 |
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.
Trying the suggestion feature of Github :-)
Co-Authored-By: byuarus <[email protected]>
Co-Authored-By: byuarus <[email protected]>
Co-Authored-By: byuarus <[email protected]>
@JonasVautherin , thank you for the suggestions! PS: Looks like the suggestion feature works :) |
Just built again with the new commits, and that's still working! |
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 this, I’m glad we now have a deterministic solution for Carthage!
Leaving the merge to @rebello95 or @timburks provided they approve as well :-)
Note: fixes #329. |
* XCode 10 support * Fixed Carthage support * Carthage support WIP * Moved the fix-carthage-paths script to pre-build actions * Fixed patch-carthage-project script to support carthage * Fix carthage build * Changing SPM dependencies-state.json * Recreated SwiftGRPC-Carthage.xcodeproj file with updated script * More fixes for Carthage * Code clean up * Update patch-carthage-project.rb Co-Authored-By: byuarus <[email protected]> * Update fix-carthage-paths.rb Co-Authored-By: byuarus <[email protected]> * Update patch-carthage-project.rb Co-Authored-By: byuarus <[email protected]>
I'm a newbie to working with Carthage and Github in general. I followed the steps outlined but I keep getting the error: Building scheme "SwiftGRPC-Package" in SwiftGRPC-Carthage.xcodeproj How do I make sure that the recreated |
@Renosi please create an issue in https://github.com/Dronecode/DronecodeSDK-Swift and paste all the output that you get in and quote the code with ```, thanks. |
Tested with:
Note:
SwiftGRPC-Package
scheme of theSwiftGRPC-Carthage.xcodeproj
:Script
fix-carthage-paths.rb
will fix paths to dependecies from./build
folder to match the paths in the SwiftGRPC-Carthage.xcodeproj file.patch-carthage-project.rb
so you can re created theSwiftGRPC-Carthage.xcodeproj
withmake project-carthage