91

我的 Cartfile 有很多库。当我这样做carthage update时,它会遍历所有库。这可能需要很长时间。

有没有办法用迦太基更新一个图书馆?像这样的东西?(这行不通)

carthage update "evgenyneu/moa"
4

9 回答 9

162

0.12 版本 build开始,checkout, 并update采用可选的空格分隔的依赖项列表

对于像下面这样的 Cartfile

github "Alamofire/Alamofire"
github "ReactiveX/RxSwift"

您可以选择更新一个依赖项

carthage update Alamofire

或多个依赖项

carthage update Alamofire RxSwift

如果需要添加标志,请最后添加:

carthage update Alamofire --platform iOS
于 2016-04-05T08:47:37.627 回答
13

Carthage 现在支持更新单个依赖项。如果您的 Cartfile 中有这样的内容:

github "bitstadium/HockeySDK-iOS"

然后你可以通过运行只更新这个依赖项

carthage update HockeySDK-iOS
于 2016-07-05T11:43:46.697 回答
9

现在答案是否定的......如果你的跑步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 上打开一个问题,要求支持它。

于 2015-06-19T04:28:44.860 回答
9

如果框架未存储在 GitHub 中,或者您正在使用git标识符,并且您的cartfile外观如下所示:

git "ssh://git@bitbucket.org/teamname/repo-name.git" ~> 1.0

那么您只能更新运行以下命令的那个

carthage update repo-name
于 2017-08-11T19:53:37.793 回答
7

我尝试了所有答案,对我来说只是暂时删除评论存储库并在运行后

carthage update --platform ios

在我将 Catfile 恢复到以前的状态之后

于 2018-10-08T23:30:39.323 回答
5

我最终编写了自己的脚本,为我构建了一个依赖项并将其与我现有的依赖项合并。您可以在https://github.com/ruipfcosta/carthage-workarounds找到它。

于 2015-11-25T22:27:39.723 回答
1

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)步骤,因为:

  1. carthage build生成fat binary使用lipo[关于]构建的

  2. Carthage 构建shared frameworks schemes了一个项目。如果您知道您需要哪个模式,您可以:

    • [UI] 从文件夹打开构建的项目Carthage/Checkouts-> 管理方案... -> 检查特定方案

    • [手动] 将特定方案保留在xcschemes文件夹中.../Carthage/Checkouts/<dependency>/<project>.xcodeproj/xcshareddata/xcschemes/<schema>.xcscheme

[迦太基 --no-use-binaries]

于 2020-04-24T12:16:43.017 回答
0

斯威夫特 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
于 2020-02-28T05:57:59.467 回答
0

看起来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并且只添加一个依赖项。

于 2020-10-28T13:56:29.117 回答