CocoaPods/CocoaPods — pull request #1668 by nevyn (2013-12-10 14:34:32+00:00)
Title: WIP: Support for defining pods per build config

This is not even nearly functional, I'm just prodding pieces of code to see how it works.

Related issue: https://github.com/CocoaPods/CocoaPods/issues/731

My random notes:

Here's how I'm thinking it could be built:
1. Figure out which configurations we should provide xcconfig files for. Either:
a) Enumerate configs in target. Tricky: finding target, finding configs,
mapping them to configs in Podfile. Or:
b) Use the set of configurations mentioned in the Podfile. Easy and
straightforward. Have a "default" xcconfig for configurations not
explicitly mentioned in the Podfile.
(it seems that (a) is the right solution, since all_user_build_configurations exists)

2. Make each "pod instance" (called 'target'?) reply whether they should be
included in the given configuration. (this includes updating the Podfile parser, wherever that is)

3. Make public_pod_xcconfig.rb query the property from #2. And the aggregate target installer?
What's the difference between aggregate_xcconfig and public_xcconfig?

4. Generate multiple public xcconfig files based on #1.

Interesting pieces of code:
* Pod::AggregateTarget#xcconfig -> xcconfig_for_configuration
* Pod::Installer::UserProjectIntegrator::TargetIntegrator#add_xcconfig_base_configuration
calls xcconfig_for_configuration
* Pod::Installer::AggregateTargetInstaller#create_xcconfig_file creates
multiple config files.
* Pod::Installer::Analyzer::AnalysisResult#all_user_build_configurations looks useful

Random thoughts:
Hmm. For (1a), one way to forward those build configs is to make Pods.xcodeproj
have the same configs as the hosting project (only works when integrating) ----
woot, it does that already! :D

Notes from alloy:

So I imagine a Podfile DSL like this:
pod 'Reveal', :configurations => ['AdHoc', 'Debug']
And possibly:
pod 'Reveal', :configuration => 'Debug'

So for that screenshot, this is what the xcconfigs would look like:
# Pods.AdHoc.xcconfig

OTHER_LDFLAGS = lxml2 -lz -framework HockeySDK

# Pods.Debug.xcconfig

OTHER_LDFLAGS = lxml2 -lz -lSocketRocket -lPonyDebugger -licucore

# Pods.Release.xcconfig

OTHER_LDFLAGS = lxml2 -lz