I have a private pod with two subspecs. One of those subspace's has a dependency on another pod. The other has no dependencies.
Only the subspec in my Podfile would be installed.
Only the source files for the subspec that I listed in my Podfile聽were installed, but another pod that was a dependency of the unincluded subspec was also installed into my project.
Pod::Spec.new do |s|
s.platform = :ios
s.ios.deployment_target = '8.0'
s.name = "MyPrivatePod"
s.version = "2.4.6"
s.summary = "Private Pod With 2 Subspecs"
s.source = { :git => "https://bitbucket.org/AnthonyMDev/myprivatepod.git",
:tag => "#{s.version}"}
s.module_name = 'MyPrivatePod'
s.requires_arc = true
s.subspec 'Core' do |ss|
s.source_files = "MyPrivatePod/*.{swift,h,m}"
s.resource_bundles = {
'MyPrivatePod' => 'MyPrivatePod/Resources/*.png'
}
s.dependency 'Alamofire', '~> 3.0'
end
s.subspec 'SubspecWithNoDependencies' do |ss|
ss.source_files = "MyPrivatePod/Subspec/*.{swift,h,m}"
ss.resource_bundles = {
'MyPrivatePodSubspec' => 'MyPrivatePod/Subspec/Resources/*.xib'
}
end
end
platform :ios, '9.0'
source 'https://bitbucket.org/AnthonyMDev/private-spec-repo.git'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
inhibit_all_warnings!
pod "MyPrivatePod/SubspecWithNoDependencies", :path => "../../MyPrivatePod"
target 'MyProject' do
end
target 'MyProject_Tests' do
pod 'Nimble', '~> 4.0'
end
Immediately after posting this, I realized that in my Core subspec I was declaring my dependencies with s.dependency rather than ss.dependency. Changing that fixed the problem. Sorry!
Most helpful comment
Immediately after posting this, I realized that in my
Coresubspec I was declaring my dependencies withs.dependencyrather thanss.dependency. Changing that fixed the problem. Sorry!