[英]Swift package manager error: NoSources
I am adding a dependency Package, and I am getting this error at build time: 我添加了一个依赖包,并且在构建时遇到了这个错误:
error: NoSources("[...]/Tests/TestResources")
Please tell me how to get past this error. 请告诉我如何克服此错误。 Is there a way to instruct SPM not to go into the
Tests
for a specific dependency? 有没有一种方法可以指示SPM不要针对特定依赖项进入
Tests
? A package-specific exclude: []
statement or something. 特定于软件包的
exclude: []
语句或其他内容。
$ swift --version
Swift version 3.0-dev (LLVM b361b0fc05, Clang 11493b0f62, Swift 24a0c3de75)
Target: x86_64-unknown-linux-gnu
Thank you! 谢谢!
You have exclude
directive in Package.swift - https://github.com/apple/swift-package-manager/blob/master/Documentation/Package.swift.md 您在Package.swift中具有
exclude
指令-https: //github.com/apple/swift-package-manager/blob/master/Documentation/Package.swift.md
It seems you are using the snapshot of swift of March 1st, there is a defect in this version regarding excluding files in Tests https://bugs.swift.org/browse/SR-864 . 看来您使用的是3月1日的swift快照,此版本存在一个缺陷,涉及排除Tests https://bugs.swift.org/browse/SR-864中的文件。 It is solved in the later versions, so you can switch to a newer version, the last one is of 24-th of March.
在更高版本中已解决此问题,因此您可以切换到新版本,最后一个是3月24日。
As a temporarily workaround, if you still want to use your current version of swift, you can just move TestResources
out of Test
directory. 作为临时的解决方法,如果您仍然想使用当前版本的swift,可以将
TestResources
移出Test
目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.