Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I include my own xcconfigs when using Cocoapods?

Is there a way to specify in the Podfile that an xcconfig file should be #included in the the one generated by Cocoapods?

Is there an exposed method/variable for appending this #include or do I need to read the generated xcconfig and regurgitate it with the additional text?

For instance, in the generated Pods-SomeTarget.[configuration].xcconfig, I'd like to see:

#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
like image 273
ray Avatar asked Nov 27 '16 22:11

ray


People also ask

What is CocoaPods dependency?

Cocoapod is a package dependency manager for Objective-C and Swift projects with XCode. Those Languages are used to make applications that run iOS, macOS… Swift Objective-C xcode. Cocoapod is a package dependency manager for Objective-C and Swift projects with XCode.


1 Answers

Include these lines in your debug and release xcconfig files, respectively:

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

Then click on your project and in the detail navigation bar on the left switch from your current target to your project and select Info at the top. Set the project to use your base/shared config file and Debug/Release to point to your xcconfig files.

like image 141
AllHailMegatron Avatar answered Oct 12 '22 02:10

AllHailMegatron