我的 Cartfile 有很多库。当我这样做carthage update
时,它会遍历所有库。这可能需要很长时间。
有没有办法用迦太基更新一个图书馆?像这样的东西?(这行不通)
carthage update "evgenyneu/moa"
我的 Cartfile 有很多库。当我这样做carthage update
时,它会遍历所有库。这可能需要很长时间。
有没有办法用迦太基更新一个图书馆?像这样的东西?(这行不通)
carthage update "evgenyneu/moa"
从0.12 版本 build
开始,checkout
, 并update
采用可选的空格分隔的依赖项列表
对于像下面这样的 Cartfile
github "Alamofire/Alamofire"
github "ReactiveX/RxSwift"
您可以选择更新一个依赖项
carthage update Alamofire
或多个依赖项
carthage update Alamofire RxSwift
如果需要添加标志,请最后添加:
carthage update Alamofire --platform iOS
Carthage 现在支持更新单个依赖项。如果您的 Cartfile 中有这样的内容:
github "bitstadium/HockeySDK-iOS"
然后你可以通过运行只更新这个依赖项
carthage update HockeySDK-iOS
现在答案是否定的......如果你的跑步carthage help update
你会看到
Update and rebuild the project's dependencies
[--configuration Release]
the Xcode configuration to build (ignored if --no-build option is present)
[--platform all]
the platform to build for (ignored if --no-build option is present)
[--verbose]
print xcodebuild output inline (ignored if --no-build option is present)
[--no-build]
skip the building of dependencies after updating
[--use-ssh]
use SSH for downloading GitHub repositories
[--use-submodules]
add dependencies as Git submodules
[--no-use-binaries]
check out dependency repositories even when prebuilt frameworks exist (ignored if --no-build option is present)
[--color auto]
whether to apply color and terminal formatting (one of ‘auto’, ‘always’, or ‘never’)
[/path/to/your/app]
the directory containing the Carthage project
如您所见,没有提及仅指定一个要更新的依赖项的选项。
您应该在项目 repo 上打开一个问题,要求支持它。
如果框架未存储在 GitHub 中,或者您正在使用git
标识符,并且您的cartfile
外观如下所示:
git "ssh://git@bitbucket.org/teamname/repo-name.git" ~> 1.0
那么您只能更新运行以下命令的那个
carthage update repo-name
我尝试了所有答案,对我来说只是暂时删除或评论存储库并在运行后
carthage update --platform ios
在我将 Catfile 恢复到以前的状态之后
我最终编写了自己的脚本,为我构建了一个依赖项并将其与我现有的依赖项合并。您可以在https://github.com/ruipfcosta/carthage-workarounds找到它。
Carthage --no-use-binaries 和特定模式
carthage [update|bootstrap|checkout|build] [dependency1] [dependency2] [--no-use-binaries] [--platform <name>]
//--no-use-binaries - does not use prebuild binary and use source code
//--platform - specify a platform
最长的阶段是carthage build
(xcodebuild)步骤,因为:
carthage build
生成fat binary
使用lipo
[关于]构建的
Carthage 构建shared frameworks schemes
了一个项目。如果您知道您需要哪个模式,您可以:
[UI] 从文件夹打开构建的项目Carthage/Checkouts
-> 管理方案... -> 检查特定方案
[手动] 将特定方案保留在xcschemes
文件夹中.../Carthage/Checkouts/<dependency>/<project>.xcodeproj/xcshareddata/xcschemes/<schema>.xcscheme
斯威夫特 5
//MARK:- Step 1
carthage update KeychainAccess --platform iOS
carthage update SDKNAME(like i mention KeychainAccess upper) --platform iOS
如果你遇到这样的错误
//MARK:- If this error occur
error: unable to find utility "xcodebuild", not a developer tool or in PATH
然后再次在终端中使用第 1 部分
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
然后再次
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
看起来carthage update repo-name
不起作用Carthage 0.36.0
。我通过手动更新解决了这个问题Carthage.resolved
。例如,添加到Cartfile
一个新的依赖项:
github "konkab/AlamofireNetworkActivityLogger" ~> 3.0.0
手动添加到Cartfile.resolved
新依赖项:
github "konkab/AlamofireNetworkActivityLogger" "3.0.0"
然后carthage bootstrap
只更新一个依赖项:
carthage bootstrap
它将使用Carthage.resolved
并且只添加一个依赖项。