4
我有一個podspec我的共享代碼和我,包括所有語言環境,但隨後Podspec的用戶得到他們的應用程序本地化爲所有的語言時,他們只是想要一個子集。的CocoaPods添加subspecs的區域
我想,讓剛子集,例如只需英語的規範。但我似乎無法得到這種行爲的工作。有什麼建議?
SAMPE Podfile使用
# Just English languages
pod 'MyStuff', '2.4.0'
pod 'MyStuff/en', '2.4.0'
pod 'MyStuff/en-GB', '2.4.0'
樣品Podspec爲MyStuff.podspec
Pod::Spec.new do |s|
s.name = 'MyStuff'
s.version = '2.4.0'
s.summary = "MyStuff for iOS."
s.source = {
:git => 'somewhere',
:tag => s.version.to_s
}
s.public_header_files = ['**/**/MyView.h', ...]
s.source_files = ['MyStuff/*.{h,m}' ]
s.resources = ['MyStuff/Resources/*.{png,xib}',
'MyStuff/config.plist']
s.platform = :ios, '5.0'
s.requires_arc = true
s.frameworks = 'CoreGraphics', 'Foundation', 'QuartzCore', 'SystemConfiguration', 'UIKit'
# All locales
s.subspec "all" do |all|
all.resources = ['MyStuff/localization/**']
all.preserve_paths = ['MyStuff/localization/**']
end
# Just en locale
s.subspec "en" do |en|
en.resources = ['MyStuff/localization/en.lproj']
en.preserve_paths = ['MyStuff/localization/en.lproj']
end
# Just en-GB locale
s.subspec "en-GB" do |enGB|
enGB.resources = ['MyStuff/localization/en-GB.lproj']
enGB.preserve_paths = ['MyStuff/localization/en-GB.lproj']
end
# Just fr locale
s.subspec "fr" do |fr|
fr.resources = ['MyStuff/localization/fr.lproj']
fr.preserve_paths = ['MyStuff/localization/fr.lproj']
end
# I have many other locales left out here for brevity.
end