有没有办法在 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/