2016-11-27 8 views
0

xcconfigファイルが#include dであるべきことをPodfileに指定する方法はありますか?Cocoapodsによって生成されたファイルですか?Cocoapodsを使用するときに自分のxcconfigsを含めるにはどうすればいいですか?

#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 
+0

#includeは正確に何をしますか? – Larme

+0

@Larme例を追加しました。 – ray

+0

あなたは 'post_install'を使ってそれをあなたのpodfileで行うことができます:(同僚は私たちのプロジェクトの1つでそれを行いました)' post_install do | installer | installer.pods_project.targets.each do | target | target.build_configurations.each do | config | xcconfig_path = config.base_configuration_reference.real_path put xcconfig_path xcconfig = File.read(xcconfig_path)common_xcconfig = '#include "my_other_config.xcconfig"' File.open(xcconfig_path、 "w"){|ファイル|ファイル<< common_xcconfig file.putsファイル<< xcconfig} end end end' – Larme

答えて

0

はあなたのデバッグに次の行を含め、それぞれのファイルをxcconfigリリース:

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

を次に、あなたをクリックしてください左側の詳細ナビゲーションバーで、現在のターゲットからプロジェクトに切り替わり、上部の[情報]を選択します。ベース/共有設定ファイルを使用するようにプロジェクトを設定し、xcconfigファイルを指すようにDebug/Releaseを設定します。

関連する問題