Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
orta authored Nov 5, 2018
2 parents 03e49e9 + b9fcae3 commit 8abc29e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -39,6 +69,9 @@ Rome/
└── Alamofire.framework
```

## Advanced Usage


For your production builds, when you want dSYMs created and stored:

```ruby
Expand Down
15 changes: 12 additions & 3 deletions lib/cocoapods-rome/post_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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

0 comments on commit 8abc29e

Please sign in to comment.