-
Notifications
You must be signed in to change notification settings - Fork 87
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
Replace CocoaPods with Carthage for demo project #100
Conversation
* Adds Carthage compatibility * Breaks demo-build because of missing Mapbox SDK (todo)
Get the Bitrise tests not executed for PRs? |
This will be difficult due to mapbox/mapbox-gl-native#1623. Instead, there would have to be a shell script to download the SDK manually.
I’ve reenabled PR builds for this repository. (We usually have them off because they make it more likely for this repo’s builds to hold up builds in the more fast-paced mapbox-gl-native repository.) |
Yeah, thought about the same. Can add a script tomorrow. However, I will be unable to test it ;-)
👍 |
I like Carthage as much as anyone, but the situation around mapbox/mapbox-gl-native#1623 unfortunately makes it harder to justify moving this project to Carthage. Is #88 the motivation for this PR? This framework, MapboxGeocoder.swift, and MapboxStatic.swift are supposed to work in both CocoaPods and Carthage already. Perhaps the fix for #88 is far simpler. |
CocoaPods has a build step which makes sure that the dependencies are satisfied. This can only be done (as far as I know) by running Another solution would be to have separate projects for the framework and the example App. The main project would have no dependency to mapbox-gl-native/CocoaPods and the example project could still use CocoaPods without interfering with the Carthage build process. This would save us from writing the script but would lead to two projects. What do you think? |
Yes, I think putting the example applications and frameworks in separate projects could work. We could still use CocoaPods to tie them together by putting a relative path in the Podfile. (That makes them “development pods”, which seems correct to me.) By the way, we plan on publishing one final Swift 2.3 release before merging #64 and making Swift 3 the main development branch. If you need Carthage compatibility soon, would you mind retargeting this PR at master? Then I can take care of merging to the swift3 branch. (Fun times!) Otherwise, targeting swift3 is fine, but it can’t land in master until we cut over to Swift 3 officially. What do you think, @incanus @friedbunny? We’d want to do exactly the same thing in MapboxGeocoder.swift and MapboxStatic.swift. |
I like the idea of splitting. In my mind, complicating the broad use case (the library) for the narrow one (maybe I need to see an example project) is not great—cleaning that up would be 👌. |
Sounds good. Will update my pull request. The reason I branched off |
Would it be a lot of work for you to implement #12? For running the tests |
Made the changes. Please have a look. |
Do you have any feedback for this PR? |
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.
Sorry for the delay – I’m a bit tied up with getting the iOS SDK out the door right now. This branch looks good, other than the one change that should be reverted. In the meantime, I’m working on reconfiguring the Bitrise bots to build the frameworks with Carthage and also look for the example projects in the right place.
@@ -5,7 +5,7 @@ import Mapbox | |||
|
|||
// A Mapbox access token is required to use the Directions API. | |||
// https://www.mapbox.com/help/create-api-access-token/ | |||
let MapboxAccessToken = "<# your Mapbox access token #>" | |||
let MapboxAccessToken = "pk.eyJ1IjoiY29iaS1iaWtlIiwiYSI6ImNpdmwwMnZ3ejAwODQyenA0cTMzanFiZjYifQ.Sbd_5nOiDjCKtr2ZYuKIFw" |
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.
Before we can merge this PR, this change needs to be reverted.
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.
Good catch! Removed the access token.
No worries. Sounds good! Thanks for your feedback |
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 iOS builds are failing because the Example (Swift) and Example (Objective-C) schemes went missing when you split out DirectionsExample.xcworkspace. You probably still have them in your workspace, but you need to mark them as shared so the Bitrise bots can find them.
Mhm, still one test failing. Can you forward the error message to me? |
Sure. The watchOS failure is a known issue that affects the master and swift3 branches, too, so I wouldn’t worry about it for now:
The iOS failure is strange – Bitrise is missing the details needed to clone your repository:
but the same step works fine in the other three Bitrise apps:
|
Checking out But it definitely has to do something with the configuration of the build server. So I don't think I can do something about it. |
Agreed, that was out of your control. I went ahead and pushed an identical
This is not my day. 😆 |
The iOS build is failing at the “Analyze Swift Example” step:
If we add a test bundle for the example applications and add it to the two schemes, we can replace that analyze step with a test step that’ll pass. A reminder to myself: before merging this PR, I need to map the swift3 branch to the carthage-integration workflow. |
done |
I can’t reproduce this error locally. If you set up a Bitrise account, I can give you access to the builds, although for some reason the iOS build only gets this far with push builds. I’ll keep at it. |
My Bitrise username is |
@1ec5 I'm not experienced with Bitrise. How does it come that the second build works (fails because of real test issues) and the first one cannot even be checked out ( |
I honestly don’t know what’s going on. It could be that I was fiddling with the iOS bot’s settings while you were pushing to the PR and that confused Bitrise. The GitHub webhooks are sending the same data to each bot. I’ve been tag-teaming with you, pushing each of your commits to this repository when I notice them. That’s why you sometimes see the /push builds that get a little further along. To save both of us some hassle, I’ve added you as a contributor to this repository as well. Thanks for your persistence! |
Ok, thank you. You are welcome. Is there something in the Bitrise workflow that satisfies the following assertion before running the tests? |
It doesn't make sense to use a real access token in unit tests, since we're using test fixtures and avoiding network requests anyways. So in the setUp method, we can set an environment variable to disable the access token check and modify the assertions to check for that environment variable. |
I solved it by running the tests in release mode. Since there no real test, it shouldn't make a difference with which configuration they are executed. |
This PR
Please note that it is based on the
swift3
branch.Open ToDos:
I'm on a bad network (for a longer time). Maybe someone else can support me with the last two ToDos?