cocoapods-amimono 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c802deb44fc7227e5a1ca4f4fb266f7ff51d06bc
4
+ data.tar.gz: fb88a7712cd35bf6f3fc1b468f682e45c0b9e07e
5
+ SHA512:
6
+ metadata.gz: 96f17037f27c9f6fac1c0d7594eb78f1aa0d03b68c9a2dc2ce88d5651581e45ffa60dda7ffdbf4a28ddf23c11cc1d0ff5c1fb7c29b077b3bab3e2491051d9b62
7
+ data.tar.gz: aca7d993ad1c6b6cd26cf629f6d0f49550c33543143fe2a8822d93a353cb121942554aeb633aa778e991348867d2f2f6cd888ee7a985a8ed9997aa1662241e4a
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ .DS_Store
2
+ pkg
3
+ .idea/
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cocoapods-amimono.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'cocoapods'
8
+
9
+ gem 'mocha'
10
+ gem 'bacon'
11
+ gem 'mocha-on-bacon'
12
+ gem 'prettybacon'
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,87 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cocoapods-amimono (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ activesupport (5.0.0)
10
+ concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ i18n (~> 0.7)
12
+ minitest (~> 5.1)
13
+ tzinfo (~> 1.1)
14
+ bacon (1.2.0)
15
+ claide (1.0.0)
16
+ cocoapods (1.0.1)
17
+ activesupport (>= 4.0.2)
18
+ claide (>= 1.0.0, < 2.0)
19
+ cocoapods-core (= 1.0.1)
20
+ cocoapods-deintegrate (>= 1.0.0, < 2.0)
21
+ cocoapods-downloader (>= 1.0.0, < 2.0)
22
+ cocoapods-plugins (>= 1.0.0, < 2.0)
23
+ cocoapods-search (>= 1.0.0, < 2.0)
24
+ cocoapods-stats (>= 1.0.0, < 2.0)
25
+ cocoapods-trunk (>= 1.0.0, < 2.0)
26
+ cocoapods-try (>= 1.0.0, < 2.0)
27
+ colored (~> 1.2)
28
+ escape (~> 0.0.4)
29
+ fourflusher (~> 0.3.0)
30
+ molinillo (~> 0.4.5)
31
+ nap (~> 1.0)
32
+ xcodeproj (>= 1.1.0, < 2.0)
33
+ cocoapods-core (1.0.1)
34
+ activesupport (>= 4.0.2)
35
+ fuzzy_match (~> 2.0.4)
36
+ nap (~> 1.0)
37
+ cocoapods-deintegrate (1.0.0)
38
+ cocoapods-downloader (1.1.0)
39
+ cocoapods-plugins (1.0.0)
40
+ nap
41
+ cocoapods-search (1.0.0)
42
+ cocoapods-stats (1.0.0)
43
+ cocoapods-trunk (1.0.0)
44
+ nap (>= 0.8, < 2.0)
45
+ netrc (= 0.7.8)
46
+ cocoapods-try (1.1.0)
47
+ colored (1.2)
48
+ concurrent-ruby (1.0.2)
49
+ escape (0.0.4)
50
+ fourflusher (0.3.2)
51
+ fuzzy_match (2.0.4)
52
+ i18n (0.7.0)
53
+ metaclass (0.0.4)
54
+ minitest (5.9.0)
55
+ mocha (1.1.0)
56
+ metaclass (~> 0.0.1)
57
+ mocha-on-bacon (0.2.2)
58
+ mocha (>= 0.13.0)
59
+ molinillo (0.4.5)
60
+ nap (1.1.0)
61
+ netrc (0.7.8)
62
+ prettybacon (0.0.2)
63
+ bacon (~> 1.2)
64
+ rake (11.2.2)
65
+ thread_safe (0.3.5)
66
+ tzinfo (1.2.2)
67
+ thread_safe (~> 0.1)
68
+ xcodeproj (1.2.0)
69
+ activesupport (>= 3)
70
+ claide (>= 1.0.0, < 2.0)
71
+ colored (~> 1.2)
72
+
73
+ PLATFORMS
74
+ ruby
75
+
76
+ DEPENDENCIES
77
+ bacon
78
+ bundler (~> 1.3)
79
+ cocoapods
80
+ cocoapods-amimono!
81
+ mocha
82
+ mocha-on-bacon
83
+ prettybacon
84
+ rake
85
+
86
+ BUNDLED WITH
87
+ 1.12.5
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2016 Renzo Crisóstomo <renzo.crisostomo@xing.com>
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # cocoapods-amimono
2
+
3
+ Move all dynamic frameworks symbols into the main executable.
4
+
5
+ ## Installation
6
+
7
+ $ gem install cocoapods-amimono
8
+
9
+ ## Usage
10
+
11
+ $ plugin 'cocoapods-amimono'
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ def specs(dir)
4
+ FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
5
+ end
6
+
7
+ desc 'Runs all the specs'
8
+ task :specs do
9
+ sh "bundle exec bacon #{specs('**')}"
10
+ end
11
+
12
+ task :default => :specs
13
+
data/bin/amimono ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.push File.expand_path("../lib", File.dirname(__FILE__))
4
+ require "cocoapods-amimono"
5
+ require "cocoapods-amimono/command"
6
+
7
+ Amimono::run
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cocoapods-amimono/gem_version.rb'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'cocoapods-amimono'
8
+ spec.version = CocoapodsAmimono::VERSION
9
+ spec.authors = ['Renzo Crisostomo']
10
+ spec.email = ['renzo.crisostomo@me.com']
11
+ spec.description = %q{Move all dynamic frameworks symbols into the main executable.}
12
+ spec.summary = %q{Move all dynamic frameworks symbols into the main executable.}
13
+ spec.homepage = 'https://github.com/Ruenzuo/cocoapods-amimono'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ end
@@ -0,0 +1,7 @@
1
+ require 'cocoapods-amimono/gem_version'
2
+
3
+ module Amimono
4
+ def self.run
5
+ Command.run(ARGV)
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-amimono/command/amimono'
@@ -0,0 +1,18 @@
1
+ require 'claide'
2
+ require 'cocoapods-amimono/gem_version'
3
+
4
+ module Amimono
5
+ class Command < CLAide::Command
6
+
7
+ self.abstract_command = true
8
+ self.command = 'amimono'
9
+ self.version = CocoapodsAmimono::VERSION
10
+ self.description = <<-DESC
11
+ Move all dynamic frameworks symbols into the main executable.
12
+ DESC
13
+
14
+ def self.run(argv)
15
+ super(argv)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ module CocoapodsAmimono
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,58 @@
1
+ module Amimono
2
+ class Integrator
3
+
4
+ def update_xcconfigs(aggregated_target_sandbox_path:)
5
+ path = aggregated_target_sandbox_path
6
+ archs = ['armv7', 'arm64', 'i386', 'x86_64']
7
+ # Find all xcconfigs for the aggregated target
8
+ Dir.entries(path).select { |entry| entry.end_with? 'xcconfig' }.each do |entry|
9
+ full_path = path + entry
10
+ xcconfig = Xcodeproj::Config.new full_path
11
+ # Clear the -frameworks flag
12
+ xcconfig.other_linker_flags[:frameworks] = Set.new
13
+ # Add -filelist flag instead, for each architecture
14
+ archs.each do |arch|
15
+ config_key = "OTHER_LDFLAGS[arch=#{arch}]"
16
+ xcconfig.attributes[config_key] = "$(inherited) -filelist \"$(OBJROOT)/Pods.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)-#{arch}.objects.filelist\""
17
+ end
18
+ xcconfig.save_as full_path
19
+ end
20
+ end
21
+
22
+ def update_build_phases(aggregated_target:)
23
+ user_project = aggregated_target.user_project
24
+ # Remove the `Embed Pods Frameworks` build phase
25
+ application_target = user_project.targets.find { |target| target.product_type.end_with? 'application' }
26
+ embed_pods_frameworks_build_phase = application_target.build_phases.find { |build_phase| build_phase.display_name.eql? '[CP] Embed Pods Frameworks' }
27
+ embed_pods_frameworks_build_phase.remove_from_project
28
+ # Check if [Amimono] phase already exist
29
+ amimono_build_phase = application_target.build_phases.find { |build_phase| build_phase.display_name.include? '[Amimono]' }
30
+ user_project.save
31
+ return unless amimono_build_phase.nil?
32
+ # Add new shell
33
+ shell_build_phase = application_target.new_shell_script_build_phase '[Amimono] Create filelist per architecture'
34
+ application_target.build_phases.insert(1, shell_build_phase)
35
+ application_target.build_phases.uniq!
36
+ shell_build_phase.shell_path = '/usr/bin/ruby'
37
+ shell_build_phase.shell_script = <<-SCRIPT.strip_heredoc
38
+ #!/usr/bin/ruby
39
+ intermediates_directory = ENV['OBJROOT']
40
+ configuration = ENV['CONFIGURATION']
41
+ platform = ENV['EFFECTIVE_PLATFORM_NAME']
42
+ archs = ENV['ARCHS']
43
+
44
+ archs.split(" ").each do |architecture|
45
+ Dir.chdir("\#{intermediates_directory}/Pods.build") do
46
+ filelist = ""
47
+ Dir.glob("\#{configuration}\#{platform}/*.build/Objects-normal/\#{architecture}/*.o") do |object_file|
48
+ filelist += File.absolute_path(object_file) + "\\n"
49
+ end
50
+ File.write("\#{configuration}\#{platform}-\#{architecture}.objects.filelist", filelist)
51
+ end
52
+ end
53
+ SCRIPT
54
+ user_project.save
55
+ end
56
+
57
+ end
58
+ end
@@ -0,0 +1,16 @@
1
+ require 'cocoapods-amimono/command'
2
+ require 'cocoapods-amimono/integrator'
3
+
4
+ Pod::HooksManager.register('cocoapods-amimono', :post_install) do |installer_context|
5
+ # Find the aggregated target
6
+ pods_target = installer_context.umbrella_targets.find do |target|
7
+ target.cocoapods_target_label.include? 'Pods'
8
+ end
9
+ puts "[Amimono] Pods target found: #{pods_target.cocoapods_target_label}"
10
+
11
+ path = installer_context.sandbox.target_support_files_dir pods_target.cocoapods_target_label
12
+
13
+ integrator = Amimono::Integrator.new
14
+ integrator.update_xcconfigs(aggregated_target_sandbox_path: path)
15
+ integrator.update_build_phases(aggregated_target: pods_target)
16
+ end
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::Amimono do
5
+ describe 'CLAide' do
6
+ it 'registers it self' do
7
+ Command.parse(%w{ amimono }).should.be.instance_of Command::Amimono
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,50 @@
1
+ require 'pathname'
2
+ ROOT = Pathname.new(File.expand_path('../../', __FILE__))
3
+ $:.unshift((ROOT + 'lib').to_s)
4
+ $:.unshift((ROOT + 'spec').to_s)
5
+
6
+ require 'bundler/setup'
7
+ require 'bacon'
8
+ require 'mocha-on-bacon'
9
+ require 'pretty_bacon'
10
+ require 'pathname'
11
+ require 'cocoapods'
12
+
13
+ Mocha::Configuration.prevent(:stubbing_non_existent_method)
14
+
15
+ require 'cocoapods_plugin'
16
+
17
+ #-----------------------------------------------------------------------------#
18
+
19
+ module Pod
20
+
21
+ # Disable the wrapping so the output is deterministic in the tests.
22
+ #
23
+ UI.disable_wrap = true
24
+
25
+ # Redirects the messages to an internal store.
26
+ #
27
+ module UI
28
+ @output = ''
29
+ @warnings = ''
30
+
31
+ class << self
32
+ attr_accessor :output
33
+ attr_accessor :warnings
34
+
35
+ def puts(message = '')
36
+ @output << "#{message}\n"
37
+ end
38
+
39
+ def warn(message = '', actions = [])
40
+ @warnings << "#{message}\n"
41
+ end
42
+
43
+ def print(message)
44
+ @output << message
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ #-----------------------------------------------------------------------------#
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-amimono
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Renzo Crisostomo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Move all dynamic frameworks symbols into the main executable.
42
+ email:
43
+ - renzo.crisostomo@me.com
44
+ executables:
45
+ - amimono
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - Gemfile.lock
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - bin/amimono
56
+ - cocoapods-amimono.gemspec
57
+ - lib/cocoapods-amimono.rb
58
+ - lib/cocoapods-amimono/command.rb
59
+ - lib/cocoapods-amimono/command/amimono.rb
60
+ - lib/cocoapods-amimono/gem_version.rb
61
+ - lib/cocoapods-amimono/integrator.rb
62
+ - lib/cocoapods_plugin.rb
63
+ - spec/command/amimono_spec.rb
64
+ - spec/spec_helper.rb
65
+ homepage: https://github.com/Ruenzuo/cocoapods-amimono
66
+ licenses:
67
+ - MIT
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 2.5.1
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: Move all dynamic frameworks symbols into the main executable.
89
+ test_files:
90
+ - spec/command/amimono_spec.rb
91
+ - spec/spec_helper.rb