Carthage 常用命令

  • 安裝carthage:brew install carthage
  • 查看版本: carthage version
  • 創建Cartfile文件:touch Cartfile
  • 編輯Cartfile文件

//版本4.4以上,5.0以下

github "Alamofire/Alamofire" ~> 4.8.0

//版本4.8.0以上

github "Alamofire/Alamofire" >= 4.8.0

//指定版本 4.8.0

github "Alamofire/Alamofire" >= 4.8.0

//最新版本

github "Alamofire/Alamofire"

//指定 Git branch

github "Alamofire/Alamofire" "branch"

//其他 Git倉庫

git  "https://gitee.com/Alamofire/Alamofire.git"

//本地倉庫

git "file:///desktop/project"

  • 更新:

//全部更新 --platform iOS 只編譯iOS平臺

carthage update --platform iOS

//更新某個庫

carthage update Alamofire/Alamofire --platform iOS 

//指定多個(逗號隔開)

carthage update Alamofire,SwiftyJSON --platform iOS 

//如果有其它用戶要使用你的project,如果你沒有在code中提交已構建好的framework

 carthage bootstrap

  • 使用

Build\iOS文件下的framework,拖動到Linked Frameworks and Libraries

Build Phases 中,添加一個新的Run Script:

    /usr/local/bin/carthage copy-frameworks

Input Files中,爲每個framework添加一個entry:

    $(SRCROOT)/Carthage/Build/iOS/Alamofire.framework

    

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章