Core
Core copied to clipboard
Add a Podfile option to reuse an external source specification
If a dependency was already defined using an external source, reuse that definition:
# define an external source
target 'TargetA' do
pod 'JSONKit', :podspec => 'https://example.com/JSONKit.podspec'
end
# reuse it
target 'TargetB' do
pod 'JSONKit', :use_previous_external_source => true
end
Why does this need to be an option? It seems like we can default to this . behavior?
Agreed. further more this can also be a method inside the Podfile
to simplify this?
@segiddins - Are we certain that this won't break any existing flow? @dnkoutso - Can you specify what kind of interface you're imagining?
def jsonkit_pod
pod 'JSONKit', :podspec => 'https://example.com/JSONKit.podspec'
end
And then use that method across targets?
That's what I'm using right now, but I thought a first-party way would be nicer for everyone.
I do think that @segiddins is right - it can be inferred and not need a separate option. What do you think?
Inferring sounds good.
Tried to hack it today, this seems non trivial.
I'll try to find time for it on the weekend.
Done, figured it out!
Some of the tests were failing because iterating over dependencies mutated the target definitions.
I've changed some of the getters on TargetDefinition
to not add a nil
value to the hash in the getter. This didn't break anything AFAIK but please review it thoroughly.