Carthage0.7.1でプロジェクトを配布する

May 10, 2015

Carthage/Carthageでプロジェクトを配布するのはとても簡単です。

0. ルートのディレクトリにプロジェクトを作る

. ├── CarthageSample ├── CarthageSample.xcodeproj └── CarthageSample.xcworkspace

1. Xcodeにフレームワーク用のターゲットを追加する

00 framework

2. SchemeをSharedにする

01 manage schemes

03 shared

3. ビルドチェック

$ carthage build —no-skip-current

コマンドでビルドします。その後、Carthage/Biuldディレクトリに出来上がったフレームワークを確認します。

4. git push

問題がなさそうならば、githubにpushします。

5. tag

04 release

release タブをクリックして、新しいtagを付けます。

6. Done

他のプロジェクトから、利用してみましょう

サンプルプロジェクト

後記

今回、既にCocoapodsで配布済みのプロジェクトもCarthageで配布しようと思ったのですが、Xcodeに起因するバグでCarthageコマンドがうまく動かないケースが多くありそうなのでやめています。早く安定するといいなぁ。

参考: Xcode 6.3.1でCarthageを利用する際にSimVerifier returned error: Simulator verification failed.エラー | Morizotter Blog


Profile picture

Written by morizotter who lives and works in Tokyo building useful things. You should follow them on Twitter