Bitrise and Carthage
10 Jul 2015 - Ricardo PereiraBitrise doesn’t have a task for Carthage, at least for now. Here is how you can add Carthage support on your workflow.
Bitrise is an iOS Continuous Integration and Delivery that allows you to manage each project workflow with some nice integrations:
- Deploy to Amazon S3
- Run CocoaPods install
- Fabric / Crashlytics deployer
- HockeyApp Deploy
- Send Email with Mailgun
- Deploy to iTunes Connect
- Send Push Notification with Parse
- Select Xcode version
- Send Slack message
- Twilio SMS Text Message Sender
- Xcode: Build
- Xcode: Unit Test
- FTP Upload
- Git Clone Repository
- Ruby Script runner
- …
You can customize your workflow with different tasks based on integrations. One of them is CocoaPods and before building the source, it will install all your pods like you do on your Mac.
Certainly, CocoaPods is a standard for 3rd party code but now we also have Carthage that give you the possibility to add dependencies and it’s intended to be the simplest way to add frameworks to your Cocoa application.
It doesn’t have Carthage build
task but we have Bash Script Runner
!
Perfect, so let’s do this.
Carthage build
You repository need a Brewfile
and make sure to commit your Cartfile.resolved
, because it is necessary to build the same framework versions.
Add this Brewfile
to your repository:
brew "carthage"
Now, go to your workflow and add a Bash Script Runner
after Git Clone Repository
:
Then add this script:
And you’re done. I hope that Bitrise team will add this integration because it will be needed many times for me…
##UPDATE
The Bitrise team is awesome and sent me some optimisations. It seems that homebrew/bundle was deprecated.
Here is the updated script (forget about the Brewfile, delete it):
Like Bitrise team says: Happy building!
Cheers,