Rome makes it easy to build a list of frameworks for consumption outside of Xcode, e.g. for a Swift script.
$ gem install cocoapods-rome
In the examples below the target 'caesar' could either be an existing target of a project managed by cocapods for which you'd like to run a swift script or it could be fictitious, for example if you wish to run this on a standalone Podfile and get the frameworks you need for adding to your xcode project manually.
Write a simple Podfile, like this:
platform :osx, '10.10'
plugin 'cocoapods-rome'
target 'caesar' do
pod 'Alamofire'
end
platform :ios, '8.0'
plugin 'cocoapods-rome',
:pre_compile => Proc.new { |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
installer.pods_project.save
},
:dsym => false,
:configuration => 'Release'
target 'caesar' do
pod 'Alamofire'
end
then run this:
pod install
and you will end up with dynamic frameworks:
$ tree Rome/
Rome/
└── Alamofire.framework
For your production builds, when you want dSYMs created and stored:
platform :osx, '10.10'
plugin 'cocoapods-rome',
:dsym => true,
:configuration => 'Release'
target 'caesar' do
pod 'Alamofire'
end
Resulting in:
$ tree dSYM/
dSYM/
├── iphoneos
│ └── Alamofire.framework.dSYM
│ └── Contents
│ ├── Info.plist
│ └── Resources
│ └── DWARF
│ └── Alamofire
└── iphonesimulator
└── Alamofire.framework.dSYM
└── Contents
├── Info.plist
└── Resources
└── DWARF
└── Alamofire
If you use interface builder, you may want to set the fix_interface_builder
flag. This will ensure swift files are marked as public headers, so that interface builder correctly shows @IBInspectable
s & @IBDesignable
s.
platform :osx, '10.10'
plugin 'cocoapods-rome',
:fix_interface_builder => true
target 'caesar' do
pod 'Alamofire'
end
You can set the force_bitcode
option to true
to ensure all dependencies are compiled with bitcode enabled.
platform :osx, '10.10'
plugin 'cocoapods-rome',
:force_bitcode => true
target 'caesar' do
pod 'Alamofire'
end
The plugin allows you to provides hooks that will be called during the installation process.
This hook allows you to make any last changes to the generated Xcode project before the compilation of frameworks begins.
It receives the Pod::Installer
as its only argument.
This hook allows you to run code after the compilation of the frameworks finished and they have been moved to the Rome
folder.
It receives the Pod::Installer
as its only argument.
Customising the Swift version of all pods
platform :osx, '10.10'
plugin 'cocoapods-rome',
:pre_compile => Proc.new { |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
installer.pods_project.save
},
:post_compile => Proc.new { |installer|
puts "Rome finished building all the frameworks"
}
target 'caesar' do
pod 'Alamofire'
end