是否可以更改用于构建框架的Carthage Swift版本?

我试图将我的项目迁移到Swift 3(在Xcode 8 beta上),并且第三方库是唯一阻止我的项目编译的东西。
在为swift 3使用特定分支时,迦太基会抛出有关新Swift语法的错误。

任何帮助将不胜感激!

最佳答案

迦太基使用命令行工具xcodebuild构建框架。命令行系统使用的Xcode版本由xcode-select工具选择的值确定

Usage: xcode-select [options]

Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example,
xcodebuild) as well as the BSD development commands (such as cc and make).

Options:
  -h, --help                  print this help message and exit
  -p, --print-path            print the path of the active developer directory
  -s <path>, --switch <path>  set the path for the active developer directory
  --install                   open a dialog for installation of the command line developer tools
  -v, --version               print the xcode-select version
  -r, --reset                 reset to the default command line tools path

它需要指向Developer SDK目录,因此您可以使用--print-path来检查其当前指向的位置。
xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

然后要更改它,只需运行sudo xcode-select --switch <path-to-beta-xcode>/Contents/Developer

关于ios - 更改迦太基Swift版本,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37867753/

10-14 19:59
查看更多