cocoapods - 使用 Cocoapods 时如何包含我自己的 xcconfigs?

标签 cocoapods xcode8 xcconfig podfile

有没有办法在 Podfile 中指定那个 xcconfig文件应该是 #include d 在 Cocoapods 生成的那个?

是否有公开的方法/变量用于附加此 #include还是我需要阅读生成的 xcconfig并用附加文本反刍它?

例如,在生成的 Pods-SomeTarget.[configuration].xcconfig 中, 我倒要看看:

#include "my_other_config.xcconfig" //<-- I want this to be inserted

FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics" "${PODS_ROOT}/Fabric" "${PODS_ROOT}/Google-Mobile-Ads-SDK/Frameworks" "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK-For-AdMob/GoogleInteractiveMediaAds/GoogleInteractiveMediaAds-GoogleIMA3ForAdMob" "${PODS_ROOT}/NewRelicAgent/NewRelicAgent" "${PODS_ROOT}/TwitterCore/iOS" "${PODS_ROOT}/TwitterKit/iOS"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1

最佳答案

在您的调试和发布 xcconfig 文件中分别包含这些行:

#include "Pods/Target Support Files/Pods-Used/Pods-Used.debug.xcconfig"
#include "Pods/Target Support Files/Pods-Used/Pods-Used.release.xcconfig"

然后单击您的项目并在左侧的详细信息导航栏中从当前目标切换到您的项目并选择顶部的信息。将项目设置为使用您的基本/共享配置文件和 Debug/Release 以指向您的 xcconfig 文件。

关于cocoapods - 使用 Cocoapods 时如何包含我自己的 xcconfigs?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40834468/

相关文章:

ios - 尝试使用 CocoaPods 0.38 关闭 MagicalRecord 登录时出错

xcode - zsh : command not found: pod

ios - xcode 8 不支持 iOS 8 中的 indexPathsForVisibleRows

Xcode:如何使用多个 xcconfig 文件设置调试环境?

ruby - 更新 cocoapod 时如何避免这种 ruby​​ 非法指令错误?

ios - 使用滑动手势在标签栏之间导航

ios - 使用 swift3 在​​ ios 中单击时更改按钮上的文本

objective-c - iOS:通过目标在 .xcconfig 文件中指定代码签名标识

xcode - 在工作区中的多个项目之间共享 xcconfig 文件

ios - pod spec lint 失败并返回 400