cocoapods-amimono 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8db2a3eed2c383d3eb046ee3c47af9bf80564719
4
- data.tar.gz: 7967b1b3bb40082178b294635b959e6608e7cfa1
3
+ metadata.gz: 84947eb0089e7f1d0f9bda450455abebb42e9a33
4
+ data.tar.gz: b763b27ea7c1a8ee647044a6bf5661580cbe981d
5
5
  SHA512:
6
- metadata.gz: 87eb480d8fa3cd6200ecdbb83a2a9d78fb4bbbfa97071a9cfc3e462399a72ecc0d8b9fbbf6b9ac675eaf04275f04568b34870403486808fafeccbb70b4239c13
7
- data.tar.gz: 6cc6d07c691b65572bec33fb825aec17855615322727dfd6641ef1db04fc2d324a682e88debd13158f94f82d64b71a29b568b3faea0b0e64e3f0b987ccaa0d79
6
+ metadata.gz: bed92bffa635f6ec1056a5d7eaf6f30fe6b8e8614e09fd97bb7e1504c42578d72c4b4fd43df2fea9bc47a808f1619db86d4313899d4a0a61b6f9691456fbb636
7
+ data.tar.gz: 691d1be66daee9184c9c9c63d6d3d18a2b816c36160e812d3cf6ade5bf43ac324457d6eeabbd90a3364791943c87a4630eb4239d823dc207ad417088630460e6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-amimono (0.0.7)
4
+ cocoapods-amimono (0.0.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -93,4 +93,4 @@ DEPENDENCIES
93
93
  rake
94
94
 
95
95
  BUNDLED WITH
96
- 1.14.1
96
+ 1.14.6
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # cocoapods-amimono
2
2
 
3
3
  <p align="center">
4
- <img src="https://dl.dropboxusercontent.com/u/12352209/GitHub/amimono.gif" alt="amimono"/>
4
+ <img src="https://raw.githubusercontent.com/Ruenzuo/res/master/amimono.gif" alt="amimono"/>
5
5
  </p>
6
6
 
7
7
  Move all dynamic frameworks symbols into the main executable.
@@ -21,7 +21,7 @@ This is hardly an option for some. If you think you might be in that group, then
21
21
 
22
22
  This plugin is based on [dyld-image-loading-performance](https://github.com/stepanhruda/dyld-image-loading-performance). In a nutshell, it copies all symbols of your CocoaPods dependencies into your main app executable, so the dynamic linker doesn't have to load the frameworks. You can verify this yourself by enabling
23
23
 
24
- ![log_setting_xcode.png](https://dl.dropboxusercontent.com/u/12352209/GitHub/log_setting_xcode.png)
24
+ ![log_setting_xcode.png](https://raw.githubusercontent.com/Ruenzuo/res/master/log_setting_xcode.png)
25
25
 
26
26
  and looking at the log output you shouldn't find any `dlopen` call of your CocoaPods frameworks.
27
27
 
@@ -1,11 +1,5 @@
1
1
  module Amimono
2
- class Integrator
3
-
4
- attr_reader :installer_context
5
-
6
- def initialize(installer_context)
7
- @installer_context = installer_context
8
- end
2
+ class BuildPhasesUpdater
9
3
 
10
4
  FILELIST_SCRIPT = <<-SCRIPT.strip_heredoc
11
5
  IFS=" " read -r -a SPLIT <<< "$ARCHS"
@@ -29,25 +23,7 @@ module Amimono
29
23
 
30
24
  AMIMONO_FILELIST_BUILD_PHASE = '[Amimono] Create filelist per architecture'
31
25
 
32
- def update_xcconfigs(aggregated_target_sandbox_path)
33
- path = aggregated_target_sandbox_path
34
- archs = ['armv7', 'armv7s', 'arm64', 'i386', 'x86_64']
35
- # Find all xcconfigs for the aggregated target
36
- Dir.entries(path).select { |entry| entry.end_with? 'xcconfig' }.each do |entry|
37
- full_path = path + entry
38
- xcconfig = Xcodeproj::Config.new full_path
39
- # Clear the -frameworks flag
40
- xcconfig.other_linker_flags[:frameworks] = Set.new
41
- # Add -filelist flag instead, for each architecture
42
- archs.each do |arch|
43
- config_key = "OTHER_LDFLAGS[arch=#{arch}]"
44
- xcconfig.attributes[config_key] = "$(inherited) -filelist \"$(OBJROOT)/Pods.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)-$(TARGET_NAME)-#{arch}.objects.filelist\""
45
- end
46
- xcconfig.save_as full_path
47
- end
48
- end
49
-
50
- def update_build_phases(aggregated_targets)
26
+ def update_build_phases(installer_context, aggregated_targets)
51
27
  # All user projects should be the same I hope
52
28
  user_project = aggregated_targets.first.user_project
53
29
  aggregated_targets.each do |aggregated_target|
@@ -56,7 +32,7 @@ module Amimono
56
32
  # Remove the `Embed Pods Frameworks` build phase
57
33
  remove_embed_pods_frameworks(user_target)
58
34
  # Create or update [Amimono] build phase
59
- create_or_update_amimono_phase(user_target, AMIMONO_FILELIST_BUILD_PHASE, generate_filelist_script(aggregated_target))
35
+ create_or_update_amimono_phase(user_target, AMIMONO_FILELIST_BUILD_PHASE, generate_filelist_script(installer_context, aggregated_target))
60
36
  puts "[Amimono] Build phases updated for target #{aggregated_target.cocoapods_target_label}"
61
37
  end
62
38
  user_project.save
@@ -78,7 +54,7 @@ module Amimono
78
54
  user_target.build_phases.uniq!
79
55
  end
80
56
 
81
- def generate_filelist_script(aggregated_target)
57
+ def generate_filelist_script(installer_context, aggregated_target)
82
58
  dependencies = []
83
59
  installer_context.pods_project.targets.select { |target| target.name == aggregated_target.cocoapods_target_label }.first.dependencies.each do |dependency|
84
60
  case dependency.target.product_type
@@ -1,3 +1,3 @@
1
1
  module CocoapodsAmimono
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'cocoapods/installer'
2
+ require 'cocoapods-amimono/xcconfig_updater'
2
3
 
3
4
  module Amimono
4
5
  # This class will patch your project's copy resources script to match the one that would be
@@ -6,12 +7,24 @@ module Amimono
6
7
  class Patcher
7
8
 
8
9
  def self.patch!(installer)
10
+ patch_xcconfig_files(installer)
9
11
  patch_copy_resources_script(installer)
10
12
  patch_vendored_build_settings(installer)
11
13
  end
12
14
 
13
15
  private
14
16
 
17
+ def self.patch_xcconfig_files(installer)
18
+ aggregated_targets = installer.aggregate_targets.reject { |target| target.label.include? 'Test' }
19
+ updater = XCConfigUpdater.new(installer)
20
+ aggregated_targets.each do |aggregated_target|
21
+ puts "[Amimono] Pods target found: #{aggregated_target.label}"
22
+ target_support = installer.sandbox.target_support_files_dir(aggregated_target.label)
23
+ updater.update_xcconfigs(aggregated_target, target_support)
24
+ puts "[Amimono] xcconfigs updated with filelist for target #{aggregated_target.label}"
25
+ end
26
+ end
27
+
15
28
  def self.patch_vendored_build_settings(installer)
16
29
  aggregated_targets = installer.aggregate_targets.reject { |target| target.label.include? 'Test' }
17
30
  aggregated_targets.each do |aggregated_target|
@@ -0,0 +1,28 @@
1
+ module Amimono
2
+ class XCConfigUpdater
3
+ attr_reader :installer
4
+
5
+ def initialize(installer)
6
+ @installer = installer
7
+ end
8
+
9
+ def update_xcconfigs(aggregated_target, aggregated_target_sandbox_path)
10
+ path = aggregated_target_sandbox_path
11
+ archs = ['armv7', 'armv7s', 'arm64', 'i386', 'x86_64']
12
+ # Find all xcconfigs for the aggregated target
13
+ Dir.entries(path).select { |entry| entry.end_with? 'xcconfig' }.each do |entry|
14
+ full_path = path + entry
15
+ xcconfig = Xcodeproj::Config.new full_path
16
+ # Clear the -frameworks flag
17
+ xcconfig.other_linker_flags[:frameworks] = Set.new(aggregated_target.pod_targets.reject(&:should_build?).map(&:name))
18
+ # Add -filelist flag instead, for each architecture
19
+ archs.each do |arch|
20
+ config_key = "OTHER_LDFLAGS[arch=#{arch}]"
21
+ xcconfig.attributes[config_key] = "$(inherited) -filelist \"$(OBJROOT)/Pods.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)-$(TARGET_NAME)-#{arch}.objects.filelist\""
22
+ end
23
+ xcconfig.save_as full_path
24
+ end
25
+ end
26
+
27
+ end
28
+ end
@@ -1,20 +1,10 @@
1
1
  require 'cocoapods-amimono/command'
2
- require 'cocoapods-amimono/integrator'
2
+ require 'cocoapods-amimono/build_phases_updater'
3
3
 
4
4
  Pod::HooksManager.register('cocoapods-amimono', :post_install) do |installer_context|
5
5
  # We exclude all targets that contain `Test`, which might not work for some test targets
6
6
  # that doesn't include that word
7
7
  pods_targets = installer_context.umbrella_targets.reject { |target| target.cocoapods_target_label.include? 'Test' }
8
- target_info = Hash.new
9
- pods_targets.each do |pods_target|
10
- puts "[Amimono] Pods target found: #{pods_target.cocoapods_target_label}"
11
- target_info[pods_target] = installer_context.sandbox.target_support_files_dir pods_target.cocoapods_target_label
12
- end
13
-
14
- integrator = Amimono::Integrator.new(installer_context)
15
- target_info.each do |pods_target, path|
16
- integrator.update_xcconfigs(path)
17
- puts "[Amimono] xcconfigs updated with filelist for target #{pods_target.cocoapods_target_label}"
18
- end
19
- integrator.update_build_phases(target_info.keys)
8
+ updater = Amimono::BuildPhasesUpdater.new
9
+ updater.update_build_phases(installer_context, pods_targets)
20
10
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-amimono
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renzo Crisostomo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-15 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Move all dynamic frameworks symbols into the main executable.
@@ -46,7 +46,7 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
- - ".gitignore"
49
+ - .gitignore
50
50
  - Gemfile
51
51
  - Gemfile.lock
52
52
  - LICENSE.txt
@@ -55,11 +55,12 @@ files:
55
55
  - bin/amimono
56
56
  - cocoapods-amimono.gemspec
57
57
  - lib/cocoapods-amimono.rb
58
+ - lib/cocoapods-amimono/build_phases_updater.rb
58
59
  - lib/cocoapods-amimono/command.rb
59
60
  - lib/cocoapods-amimono/command/amimono.rb
60
61
  - lib/cocoapods-amimono/gem_version.rb
61
- - lib/cocoapods-amimono/integrator.rb
62
62
  - lib/cocoapods-amimono/patcher.rb
63
+ - lib/cocoapods-amimono/xcconfig_updater.rb
63
64
  - lib/cocoapods_plugin.rb
64
65
  - spec/command/amimono_spec.rb
65
66
  - spec/spec_helper.rb
@@ -73,17 +74,17 @@ require_paths:
73
74
  - lib
74
75
  required_ruby_version: !ruby/object:Gem::Requirement
75
76
  requirements:
76
- - - ">="
77
+ - - '>='
77
78
  - !ruby/object:Gem::Version
78
79
  version: 2.0.0
79
80
  required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  requirements:
81
- - - ">="
82
+ - - '>='
82
83
  - !ruby/object:Gem::Version
83
84
  version: '0'
84
85
  requirements: []
85
86
  rubyforge_project:
86
- rubygems_version: 2.6.4
87
+ rubygems_version: 2.6.11
87
88
  signing_key:
88
89
  specification_version: 3
89
90
  summary: Move all dynamic frameworks symbols into the main executable.