我正在努力创建一个私人cocoapod,我已经完成了大部分工作。但是,我的项目要求我在编译源中的单个文件上禁用ARC。
我发现了这个
CocoaPods: no_arc a single file
但它似乎无法解决我的问题。我发现no_arc_files
后,pod install
引用的文件不会显示在新工作区中。Pod::Spec.new do |s|
s.name = "MyPrivateProject"
s.version = "1.0.1"
s.summary = "DataModel Library for Doordash"
s.homepage = "http://EXAMPLE/MyPrivateProject.podspec"
s.license = "MIT"
s.author = { "First Last" => "first.last@gmail.com" }
s.platform = :ios, "7.0"
s.source = { :git => "https://username@bitbucket.org/username/myproject.git", :tag => "v1.1" }
non_arc_files = "MyPrivateProject/Lib/GoogleToolbox/*.{h,m}"
s.source_files = "MyPrivateProject", "MyPrivateProject/**/*.{h,m}"
s.public_header_files = "MyPrivateProject/**/*.h"
s.exclude_files = non_arc_files
s.requires_arc = true
s.dependency "AFNetworking", "~> 2.0"
s.dependency "Google-Maps-iOS-SDK", "~> 1.6.0"
s.subspec 'IgnoreARC' do |ss|
ss.requires_arc = false
ss.source_files = non_arc_files
ss.public_header_files = "MyPrivateProject/Lib/GoogleToolbox/*.h"
end
end
。这是我的pod规范的样子:
non_arc_files
任何人都可以给我任何可能出错的提示吗?谢谢!
更新
为了澄清,我试图通过使用子规则将单独的配置应用于{{1}}来解决我的问题(无法将-fno-objc-arc添加到单个文件中)。