在使用 Carthage 時, 寫 Cartfile
.
在工程中, 需要建立腳本內容:
/usr/local/bin/carthage copy-frameworks
其中 inputfile 像這樣格式:
$(SRCROOT)/Carthage/Build/iOS/RxSwift.framework
outputfile 像這樣的格式:
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxSwift.framework
可以在工程根目錄建立一個腳本來控制 Carthage 的執(zhí)行:
#!/bin/sh
carthage update --platform iOS --cache-builds --no-use-binaries
swiftlint 腳本相對簡單:
if which swiftlint >/dev/null; then
swiftlint autocorrect
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi