swift - 如何指定哪个构建目标包含特定的 swift 包依赖项?
问题描述
使用 swift 包管理器,我的项目中包含一个 swift 包,我只希望它在测试目标和 ui 测试目标中可用。如何选择可以访问 swift 包的目标?
解决方案
最简单的方法是使用 cocoapods
你的 podfile 看起来像这样
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
target 'MyApp' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
#These are the main app frameworks
pod 'Alamofire'
# Pods for MyApp
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
# here would be your testing frameworks
pod 'MyTestFramework'
end
target 'MyAppUITests' do
# Pods for testing
# and here your UI tests framework
end
end
推荐阅读
- web-crawler - 用分号导出 Screaming Frog 数据
- here-api - 对交叉点进行反向地理编码
- python - Tensorflow:Blas GEMM 启动失败:a.shape=(2, 128), b.shape=(128, 44), m=2, n=44, k=128
- python - 初始化值没有用 super() 继承到另一个类
- sql - 我想从 db2 中的表中检索第二条记录
- c++ - 有没有办法将“QByteArray”变量数据直接放入“int”变量而不进行强制转换?
- java - 带有 InputFilter 的 android 自定义正则表达式
- buffer - 如何在 gltf 2.0 中使用多个缓冲区?
- sails.js - Sails.js - 服务与助手
- java - 我想用 Java 代码插入 Oracle 表,但在 PreparedStatement 上出现错误