改变Carthage Swift版本 [英] Change Carthage Swift version

查看:848
本文介绍了改变Carthage Swift版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Is it possible to change Carthage Swift version used to build the frameworks?

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

I'm trying to migrate my project to swift 3 (on Xcode 8 beta), and the third party libraries are the only thing that stops my project from compiling. While using specific branches for swift 3, Carthage throws errors about the new Swift syntax.

任何帮助都将不胜感激!

Any help will be appreciated!

推荐答案

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

Carthage uses the command line tool xcodebuild to build the frameworks. The version of Xcode used by the command line system is determined by the value selected by the tool 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 来检查它当前指向的位置。

It needs to point to the Developer SDK directory, so you can use --print-path to check where it's currently pointing.

xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

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

这篇关于改变Carthage Swift版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆