使用 SPM 在 XCode11 中添加本地依赖项 [英] Adding Local dependencies in XCode11 using SPM

查看:89
本文介绍了使用 SPM 在 XCode11 中添加本地依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 xcode 11 中将本地依赖项与 SPM 集成,文件 > Swift 包 > 添加包依赖...它似乎只填充并让我选择托管在 bitbucket 上的 git repos

Is it posible to integrate local dependencies with SPM in xcode 11, File > Swift Packages > Add Package dependency... It only seems to populate and let me select git repos hosted on bitbucket

我只是不确定我是否以正确的方式解决问题,也许我应该使用 Package.swift 文件?我在 Cocoapods 方面有很多经验,但我想扩展并尝试其他工具,特别是如果它们将在 xcode 中得到支持,因为它接缝 SPM 将是(我使用 xcode11 beta 5)

I am just not sure if I am approaching the issue the correct way, maybe I should be using a Package.swift file instead? I have a lot of experience with Cocoapods but I would like to branch out and try other tools, especially if they are going to be supported in xcode as it seams SPM will be (Im using xcode11 beta 5)

推荐答案

我就是这样做的:

  • 将您的包文件夹(在我的示例中为DataStructures")从查找器直接拖放到目标的框架组中.您将看到放置的项目采用棕色文件夹颜色(您可以使用箭头进入").
  • 转到您的项目目标页面,在框架和库"中单击+"按钮.您的包应作为库显示在工作区"区域中.
  • Drag and drop your package folder (in my example "DataStructures") from the finder directly into the Frameworks group of your target. You will see that the dropped item take a brown folder color (you can use the arrow to "get into it").
  • Go to your project target page, in the "Framework and Libraries" click the "+" button. Your package should show up in the "Workspace" area as a library.

这篇关于使用 SPM 在 XCode11 中添加本地依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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