改变迦太基Swift版本

是否有可能改变用于构build框架的Carthage Swift版本?

我试图将我的项目迁移到Swift 3(在Xcode 8testing版上),而第三方库是阻止我的项目编译的唯一的东西。 在使用swift 3的特定分支时,Carthage会抛出新的Swift语法的错误。

任何帮助将不胜感激!

迦太基使用命令行工具xcodebuild来构build框架。 命令行系统使用的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

有关迦太基的GitHub关于XCode 8和兼容性的错误报告。 您可能想在他们的回购中关注该问题的主题:

https://github.com/Carthage/Carthage/issues/1440

迦太基回购的另一个相关报道问题是: https : //github.com/Carthage/Carthage/issues/1445