diff --git a/README.md b/README.md index e67d734..4b8fbf8 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,15 @@ Xcode, e.g. for a Swift script. $ gem install cocoapods-rome ``` -## Usage +## Important -Write a simple Podfile like this: +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. + +## Usage + +Write a simple Podfile, like this: + +### MacOS ```ruby platform :osx, '10.10' @@ -25,6 +31,30 @@ target 'caesar' do end ``` +### iOS + +```ruby +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: ```bash @@ -39,6 +69,9 @@ Rome/ └── Alamofire.framework ``` +## Advanced Usage + + For your production builds, when you want dSYMs created and stored: ```ruby diff --git a/lib/cocoapods-rome/post_install.rb b/lib/cocoapods-rome/post_install.rb index b8e6233..8654d42 100644 --- a/lib/cocoapods-rome/post_install.rb +++ b/lib/cocoapods-rome/post_install.rb @@ -94,6 +94,9 @@ def copy_dsym_files(dsym_destination, configuration) # can get upset about Info.plist containing references to the simulator SDK frameworks = Pathname.glob("build/*/*/*.framework").reject { |f| f.to_s =~ /Pods[^.]+\.framework/ } frameworks += Pathname.glob("build/*.framework").reject { |f| f.to_s =~ /Pods[^.]+\.framework/ } + + resources = [] + Pod::UI.puts "Built #{frameworks.count} #{'frameworks'.pluralize(frameworks.count)}" destination.rmtree if destination.directory? @@ -104,19 +107,25 @@ def copy_dsym_files(dsym_destination, configuration) file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(spec.root.name), consumer) frameworks += file_accessor.vendored_libraries frameworks += file_accessor.vendored_frameworks + resources += file_accessor.resources end end frameworks.uniq! + resources.uniq! Pod::UI.puts "Copying #{frameworks.count} #{'frameworks'.pluralize(frameworks.count)} " \ "to `#{destination.relative_path_from Pathname.pwd}`" - frameworks.each do |framework| - FileUtils.mkdir_p destination - FileUtils.cp_r framework, destination, :remove_destination => true + FileUtils.mkdir_p destination + (frameworks + resources).each do |file| + FileUtils.cp_r file, destination, :remove_destination => true end copy_dsym_files(sandbox_root.parent + 'dSYM', configuration) if enable_dsym build_dir.rmtree if build_dir.directory? + + if user_options["post_compile"] + user_options["post_compile"].call(installer_context) + end end