Carthage初试

一、下载安装-两种姿势
1).下载Carthage.pkg
https://github.com/Carthage/Carthage/releases
2).Homebrew安装
1.brew update
2.brew install carthage

二、开始尝试

1.vim Cartfile
目前只支持Github或者Github Enterprise中的repositories.
https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile
2.carthage update
...clone
...
...Downloading

3.完成后,会在更目录中生成Carthage文件夹以及Carthage.resolved文件,有点类似Cocoapods。

4.添加依赖Framework
在Build Setting中的Framework Search Path中添加:
$(SRCROOT)/Carthage/Build/iOS
或者在General中Embedded Binaries手动添加

其他:
1.在.gitignore添加Carthage文件
#Carthage
Carthage
2.只支持动态库,iOS8以及iOS8以上
3.设置platform
[--platform (platform)]
the platforms to build for (one of ‘all’, ‘Mac’, ‘iOS’, ‘watchOS’, 'tvOS', or comma-separated values of the formers except for ‘all’)
(ignored if --no-build option is present)
例如:iOS
carthage update --platform iOS

你可能感兴趣的:(Carthage初试)