cocoapods-amimono 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -5
- data/cocoapods-amimono.gemspec +5 -0
- data/lib/cocoapods-amimono/gem_version.rb +1 -1
- data/lib/cocoapods-amimono/integrator.rb +23 -11
- data/lib/cocoapods-amimono/patcher.rb +11 -9
- data/lib/cocoapods_plugin.rb +3 -3
- metadata +12 -12
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 9e30439c931168e37c701a6b32a76fee58a6fdf5
         | 
| 4 | 
            +
              data.tar.gz: 982a2fec2cf47816cc0ef881f490e8ad078b9796
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 025476375dee99fd73ba30c09c46c5cc2f99d51d47964171bb1b3007e6eca0dc8272c35f92834815c376388d9f699db4476141080630425881b699a495647573
         | 
| 7 | 
            +
              data.tar.gz: 200c539fc225795a5e84c5a2e6cdf36cb519bf4b3e7d6457dfde990c059c078b13f51cbc2d295094da6907ebe00fceea4f3d35ff7d72898490be1897d76f2cc6
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,15 +1,16 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                cocoapods-amimono (0.0. | 
| 4 | 
            +
                cocoapods-amimono (0.0.5)
         | 
| 5 5 |  | 
| 6 6 | 
             
            GEM
         | 
| 7 7 | 
             
              remote: https://rubygems.org/
         | 
| 8 8 | 
             
              specs:
         | 
| 9 | 
            -
                activesupport ( | 
| 10 | 
            -
                  concurrent-ruby (~> 1.0, >= 1.0.2)
         | 
| 9 | 
            +
                activesupport (4.2.7.1)
         | 
| 11 10 | 
             
                  i18n (~> 0.7)
         | 
| 11 | 
            +
                  json (~> 1.7, >= 1.7.7)
         | 
| 12 12 | 
             
                  minitest (~> 5.1)
         | 
| 13 | 
            +
                  thread_safe (~> 0.3, >= 0.3.4)
         | 
| 13 14 | 
             
                  tzinfo (~> 1.1)
         | 
| 14 15 | 
             
                bacon (1.2.0)
         | 
| 15 16 | 
             
                claide (1.0.0)
         | 
| @@ -45,13 +46,13 @@ GEM | |
| 45 46 | 
             
                  netrc (= 0.7.8)
         | 
| 46 47 | 
             
                cocoapods-try (1.1.0)
         | 
| 47 48 | 
             
                colored (1.2)
         | 
| 48 | 
            -
                concurrent-ruby (1.0.2)
         | 
| 49 49 | 
             
                escape (0.0.4)
         | 
| 50 50 | 
             
                fourflusher (0.3.2)
         | 
| 51 51 | 
             
                fuzzy_match (2.0.4)
         | 
| 52 52 | 
             
                i18n (0.7.0)
         | 
| 53 | 
            +
                json (1.8.3)
         | 
| 53 54 | 
             
                metaclass (0.0.4)
         | 
| 54 | 
            -
                minitest (5.9. | 
| 55 | 
            +
                minitest (5.9.1)
         | 
| 55 56 | 
             
                mocha (1.1.0)
         | 
| 56 57 | 
             
                  metaclass (~> 0.0.1)
         | 
| 57 58 | 
             
                mocha-on-bacon (0.2.2)
         | 
    
        data/cocoapods-amimono.gemspec
    CHANGED
    
    | @@ -20,4 +20,9 @@ Gem::Specification.new do |spec| | |
| 20 20 |  | 
| 21 21 | 
             
              spec.add_development_dependency 'bundler', '~> 1.3'
         | 
| 22 22 | 
             
              spec.add_development_dependency 'rake'
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              spec.rubygems_version = "1.6.2"
         | 
| 25 | 
            +
              spec.required_rubygems_version = Gem::Requirement.new(">= 0") if spec.respond_to? :required_rubygems_version=
         | 
| 26 | 
            +
              spec.required_ruby_version = '>= 2.0.0'
         | 
| 27 | 
            +
              spec.specification_version = 3 if spec.respond_to? :specification_version
         | 
| 23 28 | 
             
            end
         | 
| @@ -1,6 +1,12 @@ | |
| 1 1 | 
             
            module Amimono
         | 
| 2 2 | 
             
              class Integrator
         | 
| 3 3 |  | 
| 4 | 
            +
                attr_reader :installer_context
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                def initialize(installer_context)
         | 
| 7 | 
            +
                  @installer_context = installer_context
         | 
| 8 | 
            +
                end
         | 
| 9 | 
            +
             | 
| 4 10 | 
             
                FILELIST_SCRIPT = <<-SCRIPT.strip_heredoc
         | 
| 5 11 | 
             
                      IFS=" " read -r -a SPLIT <<< "$ARCHS"
         | 
| 6 12 | 
             
                      for ARCH in "${SPLIT[@]}"; do
         | 
| @@ -23,7 +29,7 @@ module Amimono | |
| 23 29 |  | 
| 24 30 | 
             
                AMIMONO_FILELIST_BUILD_PHASE = '[Amimono] Create filelist per architecture'
         | 
| 25 31 |  | 
| 26 | 
            -
                def update_xcconfigs(aggregated_target_sandbox_path | 
| 32 | 
            +
                def update_xcconfigs(aggregated_target_sandbox_path)
         | 
| 27 33 | 
             
                  path = aggregated_target_sandbox_path
         | 
| 28 34 | 
             
                  archs = ['armv7', 'armv7s', 'arm64', 'i386', 'x86_64']
         | 
| 29 35 | 
             
                  # Find all xcconfigs for the aggregated target
         | 
| @@ -41,16 +47,16 @@ module Amimono | |
| 41 47 | 
             
                  end
         | 
| 42 48 | 
             
                end
         | 
| 43 49 |  | 
| 44 | 
            -
                def update_build_phases(aggregated_targets | 
| 50 | 
            +
                def update_build_phases(aggregated_targets)
         | 
| 45 51 | 
             
                  # All user projects should be the same I hope
         | 
| 46 52 | 
             
                  user_project = aggregated_targets.first.user_project
         | 
| 47 53 | 
             
                  aggregated_targets.each do |aggregated_target|
         | 
| 48 54 | 
             
                    # This pick is probably wrong, but works for most of the simple cases
         | 
| 49 55 | 
             
                    user_target = aggregated_target.user_targets.first
         | 
| 50 56 | 
             
                    # Remove the `Embed Pods Frameworks` build phase
         | 
| 51 | 
            -
                    remove_embed_pods_frameworks(user_target | 
| 57 | 
            +
                    remove_embed_pods_frameworks(user_target)
         | 
| 52 58 | 
             
                    # Create or update [Amimono] build phase
         | 
| 53 | 
            -
                    create_or_update_amimono_phase(user_target | 
| 59 | 
            +
                    create_or_update_amimono_phase(user_target, AMIMONO_FILELIST_BUILD_PHASE, generate_filelist_script(aggregated_target))
         | 
| 54 60 | 
             
                    puts "[Amimono] Build phases updated for target #{aggregated_target.cocoapods_target_label}"
         | 
| 55 61 | 
             
                  end
         | 
| 56 62 | 
             
                  user_project.save
         | 
| @@ -58,13 +64,13 @@ module Amimono | |
| 58 64 |  | 
| 59 65 | 
             
                private
         | 
| 60 66 |  | 
| 61 | 
            -
                def remove_embed_pods_frameworks(user_target | 
| 67 | 
            +
                def remove_embed_pods_frameworks(user_target)
         | 
| 62 68 | 
             
                  embed_pods_frameworks_build_phase = user_target.build_phases.find { |build_phase| build_phase.display_name.include? 'Embed Pods Frameworks' }
         | 
| 63 69 | 
             
                  return if embed_pods_frameworks_build_phase.nil?
         | 
| 64 70 | 
             
                  embed_pods_frameworks_build_phase.remove_from_project
         | 
| 65 71 | 
             
                end
         | 
| 66 72 |  | 
| 67 | 
            -
                def create_or_update_amimono_phase(user_target | 
| 73 | 
            +
                def create_or_update_amimono_phase(user_target, phase_name, script)
         | 
| 68 74 | 
             
                  amimono_filelist_build_phase = user_target.build_phases.find { |build_phase| build_phase.display_name.include? phase_name } || user_target.new_shell_script_build_phase(phase_name)
         | 
| 69 75 | 
             
                  amimono_filelist_build_phase.shell_path = '/bin/bash'
         | 
| 70 76 | 
             
                  amimono_filelist_build_phase.shell_script = script
         | 
| @@ -72,12 +78,18 @@ module Amimono | |
| 72 78 | 
             
                  user_target.build_phases.uniq!
         | 
| 73 79 | 
             
                end
         | 
| 74 80 |  | 
| 75 | 
            -
                def generate_filelist_script(aggregated_target | 
| 76 | 
            -
                  dependencies =  | 
| 81 | 
            +
                def generate_filelist_script(aggregated_target)
         | 
| 82 | 
            +
                  dependencies = []
         | 
| 83 | 
            +
                  installer_context.pods_project.targets.select { |target| target.name == aggregated_target.cocoapods_target_label }.first.dependencies.each do |dependency|
         | 
| 84 | 
            +
                    case dependency.target.product_type
         | 
| 85 | 
            +
                    when 'com.apple.product-type.framework'
         | 
| 86 | 
            +
                      dependencies << "'#{dependency.name}'"
         | 
| 87 | 
            +
                    when 'com.apple.product-type.bundle'
         | 
| 88 | 
            +
                      # ignore
         | 
| 89 | 
            +
                    end
         | 
| 90 | 
            +
                  end
         | 
| 77 91 | 
             
                  puts "[Amimono] #{dependencies.count} dependencies found"
         | 
| 78 | 
            -
                   | 
| 79 | 
            -
                  declare_statement = "declare -a DEPENDENCIES=(%s);\n" % bash_array
         | 
| 80 | 
            -
                  declare_statement + FILELIST_SCRIPT
         | 
| 92 | 
            +
                  "declare -a DEPENDENCIES=(#{dependencies.join(' ')});\n" + FILELIST_SCRIPT
         | 
| 81 93 | 
             
                end
         | 
| 82 94 | 
             
              end
         | 
| 83 95 | 
             
            end
         | 
| @@ -1,16 +1,18 @@ | |
| 1 | 
            +
            require 'cocoapods/installer'
         | 
| 2 | 
            +
             | 
| 1 3 | 
             
            module Amimono
         | 
| 2 4 | 
             
              # This class will patch your project's copy resources script to match the one that would be
         | 
| 3 5 | 
             
              # generated as if the `use_frameworks!` flag wouldn't be there
         | 
| 4 6 | 
             
              class Patcher
         | 
| 5 7 |  | 
| 6 | 
            -
                def self.patch!(installer | 
| 7 | 
            -
                  patch_copy_resources_script(installer | 
| 8 | 
            -
                  patch_vendored_build_settings(installer | 
| 8 | 
            +
                def self.patch!(installer)
         | 
| 9 | 
            +
                  patch_copy_resources_script(installer)
         | 
| 10 | 
            +
                  patch_vendored_build_settings(installer)
         | 
| 9 11 | 
             
                end
         | 
| 10 12 |  | 
| 11 13 | 
             
                private
         | 
| 12 14 |  | 
| 13 | 
            -
                def self.patch_vendored_build_settings(installer | 
| 15 | 
            +
                def self.patch_vendored_build_settings(installer)
         | 
| 14 16 | 
             
                  aggregated_targets = installer.aggregate_targets.reject { |target| target.label.include? 'Test' }
         | 
| 15 17 | 
             
                  aggregated_targets.each do |aggregated_target|
         | 
| 16 18 | 
             
                    path = installer.sandbox.target_support_files_dir aggregated_target.label
         | 
| @@ -21,19 +23,19 @@ module Amimono | |
| 21 23 | 
             
                      # But this also works and it's simpler
         | 
| 22 24 | 
             
                      configuration = entry.split('.')[-2]
         | 
| 23 25 | 
             
                      pod_targets = aggregated_target.pod_targets_for_build_configuration configuration
         | 
| 24 | 
            -
                      generate_vendored_build_settings(pod_targets | 
| 26 | 
            +
                      generate_vendored_build_settings(pod_targets, xcconfig)
         | 
| 25 27 | 
             
                      xcconfig.save_as full_path
         | 
| 26 28 | 
             
                    end
         | 
| 27 29 | 
             
                    puts "[Amimono] Vendored build settings patched for target #{aggregated_target.label}"
         | 
| 28 30 | 
             
                  end
         | 
| 29 31 | 
             
                end
         | 
| 30 32 |  | 
| 31 | 
            -
                def self.patch_copy_resources_script(installer | 
| 33 | 
            +
                def self.patch_copy_resources_script(installer)
         | 
| 32 34 | 
             
                  project = installer.sandbox.project
         | 
| 33 35 | 
             
                  aggregated_targets = installer.aggregate_targets.reject { |target| target.label.include? 'Test' }
         | 
| 34 36 | 
             
                  aggregated_targets.each do |aggregated_target|
         | 
| 35 37 | 
             
                    path = aggregated_target.copy_resources_script_path
         | 
| 36 | 
            -
                    resources = resources_by_config(aggregated_target | 
| 38 | 
            +
                    resources = resources_by_config(aggregated_target, project)
         | 
| 37 39 | 
             
                    generator = Pod::Generator::CopyResourcesScript.new(resources, aggregated_target.platform)
         | 
| 38 40 | 
             
                    generator.save_as(path)
         | 
| 39 41 | 
             
                    puts "[Amimono] Copy resources script patched for target #{aggregated_target.label}"
         | 
| @@ -42,7 +44,7 @@ module Amimono | |
| 42 44 |  | 
| 43 45 | 
             
                # Copied over from https://github.com/CocoaPods/CocoaPods/blob/e5afc825eeafa60933a1299f52eb764c267cc9b2/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb#L152-L158
         | 
| 44 46 | 
             
                # with some modifications to this particular use case
         | 
| 45 | 
            -
                def self.generate_vendored_build_settings(pod_targets | 
| 47 | 
            +
                def self.generate_vendored_build_settings(pod_targets, xcconfig)
         | 
| 46 48 | 
             
                  pod_targets.each do |pod_target|
         | 
| 47 49 | 
             
                    Pod::Generator::XCConfig::XCConfigHelper.add_settings_for_file_accessors_of_target(pod_target, xcconfig)
         | 
| 48 50 | 
             
                  end
         | 
| @@ -50,7 +52,7 @@ module Amimono | |
| 50 52 |  | 
| 51 53 | 
             
                # Copied over from https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb#L115-L131
         | 
| 52 54 | 
             
                # with some modifications to this particular use case
         | 
| 53 | 
            -
                def self.resources_by_config(aggregated_target | 
| 55 | 
            +
                def self.resources_by_config(aggregated_target, project)
         | 
| 54 56 | 
             
                  library_targets = aggregated_target.pod_targets.reject do |pod_target|
         | 
| 55 57 | 
             
                    # This reject doesn't matter much anymore. We have to process all targets because
         | 
| 56 58 | 
             
                    # every single one requires frameworks and this workaround doesn't work with Pods
         | 
    
        data/lib/cocoapods_plugin.rb
    CHANGED
    
    | @@ -11,10 +11,10 @@ Pod::HooksManager.register('cocoapods-amimono', :post_install) do |installer_con | |
| 11 11 | 
             
                target_info[pods_target] = installer_context.sandbox.target_support_files_dir pods_target.cocoapods_target_label
         | 
| 12 12 | 
             
              end
         | 
| 13 13 |  | 
| 14 | 
            -
              integrator = Amimono::Integrator.new
         | 
| 14 | 
            +
              integrator = Amimono::Integrator.new(installer_context)
         | 
| 15 15 | 
             
              target_info.each do |pods_target, path|
         | 
| 16 | 
            -
                integrator.update_xcconfigs( | 
| 16 | 
            +
                integrator.update_xcconfigs(path)
         | 
| 17 17 | 
             
                puts "[Amimono] xcconfigs updated with filelist for target #{pods_target.cocoapods_target_label}"
         | 
| 18 18 | 
             
              end
         | 
| 19 | 
            -
              integrator.update_build_phases( | 
| 19 | 
            +
              integrator.update_build_phases(target_info.keys)
         | 
| 20 20 | 
             
            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. | 
| 4 | 
            +
              version: 0.0.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Renzo Crisostomo
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016- | 
| 11 | 
            +
            date: 2016-09-27 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 | 
            -
            -  | 
| 49 | 
            +
            - .gitignore
         | 
| 50 50 | 
             
            - Gemfile
         | 
| 51 51 | 
             
            - Gemfile.lock
         | 
| 52 52 | 
             
            - LICENSE.txt
         | 
| @@ -73,19 +73,19 @@ require_paths: | |
| 73 73 | 
             
            - lib
         | 
| 74 74 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 75 75 | 
             
              requirements:
         | 
| 76 | 
            -
              - -  | 
| 76 | 
            +
              - - '>='
         | 
| 77 77 | 
             
                - !ruby/object:Gem::Version
         | 
| 78 | 
            -
                  version:  | 
| 78 | 
            +
                  version: 2.0.0
         | 
| 79 79 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 80 80 | 
             
              requirements:
         | 
| 81 | 
            -
              - -  | 
| 81 | 
            +
              - - '>='
         | 
| 82 82 | 
             
                - !ruby/object:Gem::Version
         | 
| 83 83 | 
             
                  version: '0'
         | 
| 84 84 | 
             
            requirements: []
         | 
| 85 85 | 
             
            rubyforge_project: 
         | 
| 86 | 
            -
            rubygems_version: 2. | 
| 86 | 
            +
            rubygems_version: 2.4.8
         | 
| 87 87 | 
             
            signing_key: 
         | 
| 88 | 
            -
            specification_version:  | 
| 88 | 
            +
            specification_version: 3
         | 
| 89 89 | 
             
            summary: Move all dynamic frameworks symbols into the main executable.
         | 
| 90 90 | 
             
            test_files:
         | 
| 91 91 | 
             
            - spec/command/amimono_spec.rb
         |