cocoapods-timeconsuming-details 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: e2ddde2cc4085177a0280a84686f466f3203a1a6
4
+ data.tar.gz: f0f10fd59e98f1ca551ef4bc3a0bbd632de12127
5
+ SHA512:
6
+ metadata.gz: 01e6a1e721c7f07d0924fb61ba0a9a9b3c0e1782628f1461ee1c5a0fec0572a24f6e2cfc450abac1ae3cb7dba5b9c538eecf81434ceda48390600a3bdfd4516e
7
+ data.tar.gz: 093421da1373acbbd06e1b34af9ed84f33b265f133f61f5ca64d2741147ef0d71388b9f425a284785c04dd977607d576e5ea9bda5c497cbb0aa276beaf87785f
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at philip.lpf@alibaba-inc.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cocoapods-timeconsuming-details.gemspec
4
+ gemspec
5
+
6
+ gem 'cocoapods', '>=0.35.0'
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 philip.lpf
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Cocoapods::Timeconsuming::Details
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cocoapods/timeconsuming/details`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'cocoapods-timeconsuming-details'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install cocoapods-timeconsuming-details
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cocoapods-timeconsuming-details. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cocoapods/timeconsuming/details"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cocoapods-timeconsuming-details/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cocoapods-timeconsuming-details"
8
+ spec.version = CocoapodsTimeconsumingDetails::VERSION
9
+ spec.authors = ["圆寸"]
10
+ spec.email = ["philip.lpf@alibaba-inc.com"]
11
+
12
+ spec.summary = %q{cocoapods install/update timeconsuming details.}
13
+ spec.description = %q{cocoapods install/update timeconsuming details.}
14
+ spec.homepage = "http://github.com"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 1.12"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ end
@@ -0,0 +1,3 @@
1
+ module CocoapodsTimeconsumingDetails
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,147 @@
1
+ require "cocoapods-timeconsuming-details/version"
2
+
3
+ module Pod
4
+ class Installer
5
+
6
+ def timing (method, *argv) #method(:method_name)
7
+
8
+ start_time = Time.new
9
+
10
+ if argv and (argv.length != 0)
11
+ method.call(*argv)
12
+ else
13
+ method.call
14
+ end
15
+
16
+ cost_time = (Time.new.to_f - start_time.to_f)*1000
17
+
18
+ return cost_time.to_i.to_s
19
+ end
20
+
21
+ #-------------------------------------------------------------------------#
22
+
23
+ # Installs the Pods.
24
+ #
25
+ # The installation process is mostly linear with a few minor complications
26
+ # to keep in mind:
27
+ #
28
+ # - The stored podspecs need to be cleaned before the resolution step
29
+ # otherwise the sandbox might return an old podspec and not download
30
+ # the new one from an external source.
31
+ # - The resolver might trigger the download of Pods from external sources
32
+ # necessary to retrieve their podspec (unless it is instructed not to
33
+ # do it).
34
+ #
35
+ # @return [void]
36
+ #
37
+ def install!
38
+ start_time = Time.new
39
+
40
+ puts "=> prepare cost : " + timing(method(:prepare)) + " ms";
41
+ puts "=> resolve_dependencies cost : " + timing(method(:resolve_dependencies)) + " ms";
42
+ puts "=> download_dependencies cost : " + timing(method(:download_dependencies)) + " ms";
43
+ puts "=> generate_pods_project cost : " + timing(method(:generate_pods_project)) + " ms";
44
+ puts "=> integrate_user_project cost : " + timing(method(:integrate_user_project)) + " ms" if config.integrate_targets?
45
+ puts "=> perform_post_install_actions cost : " + timing(method(:perform_post_install_actions)) + " ms";
46
+
47
+ cost_time = (Time.new.to_f - start_time.to_f)*1000;
48
+ puts "\e[32m Total cost : #{cost_time.to_i.to_s} ms \e[0m" ;
49
+ end
50
+
51
+ def resolve_dependencies
52
+ UI.section 'Analyzing dependencies' do
53
+ puts "===> analyze cost : " + timing(method(:analyze)) +" ms";
54
+ puts "===> validate_build_configurations cost : " + timing(method(:validate_build_configurations)) +" ms";
55
+ puts "===> prepare_for_legacy_compatibility cost : " + timing(method(:prepare_for_legacy_compatibility)) +" ms";
56
+ puts "===> clean_sandbox cost : " + timing(method(:clean_sandbox)) +" ms";
57
+ end
58
+ end
59
+
60
+ def download_dependencies
61
+ UI.section 'Downloading dependencies' do
62
+ puts "===> create_file_accessors cost : " + timing(method(:create_file_accessors)) +" ms";
63
+ puts "===> install_pod_sources cost : " + timing(method(:install_pod_sources)) +" ms";
64
+ puts "===> run_pre_install_hooks cost : " + timing(method(:run_pre_install_hooks)) +" ms";
65
+ puts "===> clean_pod_sources cost : " + timing(method(:clean_pod_sources)) +" ms";
66
+ end
67
+ end
68
+
69
+ def generate_pods_project
70
+ UI.section 'Generating Pods project' do
71
+ puts "===> prepare_pods_project cost : " + timing(method(:prepare_pods_project)) + " ms";
72
+ puts "===> install_file_references cost : " + timing(method(:install_file_references)) + " ms";
73
+ puts "===> install_libraries cost : " + timing(method(:install_libraries)) + " ms";
74
+ puts "===> set_target_dependencies cost : " + timing(method(:set_target_dependencies)) + " ms";
75
+ puts "===> run_podfile_post_install_hooks cost : " + timing(method(:run_podfile_post_install_hooks)) + " ms";
76
+ puts "===> write_pod_project cost : " + timing(method(:write_pod_project)) + " ms";
77
+ puts "===> write_lockfiles cost : " + timing(method(:write_lockfiles)) + " ms";
78
+ end
79
+ end
80
+
81
+
82
+ #-------------------------------------------------------------------------#
83
+
84
+ private
85
+
86
+ # Downloads, installs the documentation and cleans the sources of the Pods
87
+ # which need to be installed.
88
+ #
89
+ # @return [void]
90
+ #
91
+ def install_pod_sources
92
+ @installed_specs = []
93
+ pods_to_install = sandbox_state.added | sandbox_state.changed
94
+ title_options = { :verbose_prefix => '-> '.green }
95
+ root_specs.sort_by(&:name).each do |spec|
96
+ if pods_to_install.include?(spec.name)
97
+ if sandbox_state.changed.include?(spec.name) && sandbox.manifest
98
+ previous = sandbox.manifest.version(spec.name)
99
+ title = "Installing #{spec.name} #{spec.version} (was #{previous})"
100
+ else
101
+ title = "Installing #{spec}"
102
+ end
103
+ UI.titled_section(title.green, title_options) do
104
+ # install_source_of_pod(spec.name)
105
+ puts "=====> Installing #{spec.name} cost : " + timing(method(:install_source_of_pod), spec.name) + " ms";
106
+ end
107
+ else
108
+ UI.titled_section("Using #{spec}", title_options)
109
+ end
110
+ end
111
+ end
112
+
113
+ # Installs the aggregate targets of the Pods projects and generates their
114
+ # support files.
115
+ #
116
+ # @return [void]
117
+ #
118
+ def install_libraries
119
+ UI.message '- Installing targets' do
120
+ pod_targets.sort_by(&:name).each do |pod_target|
121
+ next if pod_target.target_definition.dependencies.empty?
122
+ target_installer = PodTargetInstaller.new(sandbox, pod_target)
123
+ # target_installer.install!
124
+ puts "=====> install pod target #{pod_target.name} cost : " + timing(target_installer.method(:install!)) + " ms";
125
+ end
126
+
127
+ aggregate_targets.sort_by(&:name).each do |target|
128
+ next if target.target_definition.dependencies.empty?
129
+ target_installer = AggregateTargetInstaller.new(sandbox, target)
130
+ puts "=====> install aggregate target #{target.name} cost : " + timing(target_installer.method(:install!)) + " ms";
131
+ # target_installer.install!
132
+ end
133
+
134
+ # TODO
135
+ # Move and add specs
136
+ pod_targets.sort_by(&:name).each do |pod_target|
137
+ pod_target.file_accessors.each do |file_accessor|
138
+ file_accessor.spec_consumer.frameworks.each do |framework|
139
+ pod_target.native_target.add_system_framework(framework)
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
145
+ #-------------------------------------------------------------------------#
146
+ end
147
+ end
@@ -0,0 +1,158 @@
1
+
2
+ module Pod
3
+ class Installer
4
+
5
+ def timing (method, *argv) #method(:method_name)
6
+
7
+ start_time = Time.new
8
+
9
+ if argv and (argv.length != 0)
10
+ method.call(*argv)
11
+ else
12
+ method.call
13
+ end
14
+
15
+ cost_time = (Time.new.to_f - start_time.to_f)*1000
16
+
17
+ return cost_time.to_i.to_s
18
+ end
19
+
20
+ #-------------------------------------------------------------------------#
21
+
22
+ # Installs the Pods.
23
+ #
24
+ # The installation process is mostly linear with a few minor complications
25
+ # to keep in mind:
26
+ #
27
+ # - The stored podspecs need to be cleaned before the resolution step
28
+ # otherwise the sandbox might return an old podspec and not download
29
+ # the new one from an external source.
30
+ # - The resolver might trigger the download of Pods from external sources
31
+ # necessary to retrieve their podspec (unless it is instructed not to
32
+ # do it).
33
+ #
34
+ # @return [void]
35
+ #
36
+ def install!
37
+ start_time = Time.new
38
+ puts '=> prepare cost : ' + timing(method(:prepare)) + ' ms';
39
+ puts '=> resolve_dependencies cost : ' + timing(method(:resolve_dependencies)) + ' ms';
40
+ puts '=> download_dependencies cost : ' + timing(method(:download_dependencies)) + ' ms';
41
+ puts '=> determine_dependency_product_types cost : ' + timing(method(:determine_dependency_product_types)) + ' ms';
42
+ puts '=> verify_no_duplicate_framework_names cost : ' + timing(method(:verify_no_duplicate_framework_names)) + ' ms';
43
+ puts '=> verify_no_static_framework_transitive_dependencies cost : ' + timing(method(:verify_no_static_framework_transitive_dependencies)) + ' ms';
44
+ puts '=> verify_framework_usage cost : ' + timing(method(:verify_framework_usage)) + ' ms';
45
+ puts '=> generate_pods_project cost : ' + timing(method(:generate_pods_project)) + ' ms';
46
+ puts '=> integrate_user_project cost : ' + timing(method(:integrate_user_project)) + ' ms' if config.integrate_targets?
47
+ puts '=> perform_post_install_actions cost : ' + timing(method(:perform_post_install_actions)) + ' ms';
48
+
49
+ cost_time = (Time.new.to_f - start_time.to_f)*1000
50
+ puts "\e[32m Total cost : #{cost_time.to_i.to_s} ms\e[0m"
51
+ end
52
+
53
+ def resolve_dependencies
54
+ analyzer = create_analyzer
55
+
56
+ plugin_sources = run_source_provider_hooks
57
+ analyzer.sources.insert(0, *plugin_sources)
58
+
59
+ UI.section 'Updating local specs repositories' do
60
+ puts "===> analyzer.update_repositories cost : " + timing(analyzer.method(:update_repositories)) + " ms";
61
+ end unless config.skip_repo_update?
62
+
63
+ UI.section 'Analyzing dependencies' do
64
+ puts '===> analyze(analyzer) cost : ' + timing(method(:analyze), analyzer) + ' ms';
65
+ puts '===> validate_build_configurations cost : ' + timing(method(:validate_build_configurations)) + ' ms';
66
+ puts '===> prepare_for_legacy_compatibility cost : ' + timing(method(:prepare_for_legacy_compatibility)) + ' ms';
67
+ puts '===> clean_sandbox cost : ' + timing(method(:clean_sandbox)) + ' ms';
68
+ end
69
+ end
70
+
71
+ def download_dependencies
72
+ UI.section 'Downloading dependencies' do
73
+ puts '===> create_file_accessors cost : ' + timing(method(:create_file_accessors)) + ' ms';
74
+ puts '===> install_pod_sources cost : ' + timing(method(:install_pod_sources)) + ' ms';
75
+ puts '===> run_podfile_pre_install_hooks cost : ' + timing(method(:run_podfile_pre_install_hooks)) + ' ms';
76
+ puts '===> clean_pod_sources cost : ' + timing(method(:clean_pod_sources)) + ' ms';
77
+ end
78
+ end
79
+
80
+ def generate_pods_project
81
+ UI.section 'Generating Pods project' do
82
+ puts '===> prepare_pods_project cost : ' + timing(method(:prepare_pods_project)) + ' ms';
83
+ puts '===> install_file_references cost : ' + timing(method(:install_file_references)) + ' ms';
84
+ puts '===> install_libraries cost : ' + timing(method(:install_libraries)) + ' ms';
85
+ puts '===> set_target_dependencies cost : ' + timing(method(:set_target_dependencies)) + ' ms';
86
+ puts '===> run_podfile_post_install_hooks cost : ' + timing(method(:run_podfile_post_install_hooks)) + ' ms';
87
+ puts '===> write_pod_project cost : ' + timing(method(:write_pod_project)) + ' ms';
88
+ puts '===> share_development_pod_schemes cost : ' + timing(method(:share_development_pod_schemes)) + ' ms';
89
+ puts '===> write_lockfiles cost : ' + timing(method(:write_lockfiles)) + ' ms';
90
+ end
91
+ end
92
+
93
+ #-------------------------------------------------------------------------#
94
+
95
+ # Downloads, installs the documentation and cleans the sources of the Pods
96
+ # which need to be installed.
97
+ #
98
+ # @return [void]
99
+ #
100
+ def install_pod_sources
101
+ @installed_specs = []
102
+ pods_to_install = sandbox_state.added | sandbox_state.changed
103
+ title_options = { :verbose_prefix => '-> '.green }
104
+ root_specs.sort_by(&:name).each do |spec|
105
+ if pods_to_install.include?(spec.name)
106
+ if sandbox_state.changed.include?(spec.name) && sandbox.manifest
107
+ previous = sandbox.manifest.version(spec.name)
108
+ title = "Installing #{spec.name} #{spec.version} (was #{previous})"
109
+ else
110
+ title = "Installing #{spec}"
111
+ end
112
+ UI.titled_section(title.green, title_options) do
113
+ puts "=====> Install #{spec} cost : " + timing(method(:install_source_of_pod), spec.name) + " ms";
114
+ # install_source_of_pod(spec.name)
115
+ end
116
+ else
117
+ UI.titled_section("Using #{spec}", title_options) do
118
+ puts "=====> Using #{spec} cost : " + timing(method(:create_pod_installer), spec.name) + " ms";
119
+ # create_pod_installer(spec.name)
120
+ end
121
+ end
122
+ end
123
+ end
124
+
125
+ # Installs the aggregate targets of the Pods projects and generates their
126
+ # support files.
127
+ #
128
+ # @return [void]
129
+ #
130
+ def install_libraries
131
+ UI.message '- Installing targets' do
132
+ pod_targets.sort_by(&:name).each do |pod_target|
133
+ next if pod_target.target_definitions.flat_map(&:dependencies).empty?
134
+ target_installer = PodTargetInstaller.new(sandbox, pod_target)
135
+ puts "=====> install pod target #{pod_target.name} cost : " + timing(target_installer.method(:install!)) + " ms";
136
+ end
137
+
138
+ aggregate_targets.sort_by(&:name).each do |target|
139
+ next if target.target_definition.dependencies.empty?
140
+ target_installer = AggregateTargetInstaller.new(sandbox, target)
141
+ puts "=====> install aggregate target #{target.name} cost : " + timing(target_installer.method(:install!)) + " ms";
142
+ end
143
+
144
+ # TODO: Move and add specs
145
+ pod_targets.sort_by(&:name).each do |pod_target|
146
+ pod_target.file_accessors.each do |file_accessor|
147
+ file_accessor.spec_consumer.frameworks.each do |framework|
148
+ if pod_target.should_build?
149
+ pod_target.native_target.add_system_framework(framework)
150
+ end
151
+ end
152
+ end
153
+ end
154
+ end
155
+ end
156
+ #-------------------------------------------------------------------------#
157
+ end #of class
158
+ end #of module
@@ -0,0 +1,157 @@
1
+
2
+ module Pod
3
+ class Installer
4
+ def timing (method, *argv) #method(:method_name)
5
+
6
+ start_time = Time.new
7
+
8
+ if argv and (argv.length != 0)
9
+ method.call(*argv)
10
+ else
11
+ method.call
12
+ end
13
+
14
+ cost_time = (Time.new.to_f - start_time.to_f)*1000
15
+
16
+ return cost_time.to_i.to_s
17
+ end
18
+
19
+ #-------------------------------------------------------------------------#
20
+
21
+ # Installs the Pods.
22
+ #
23
+ # The installation process is mostly linear with a few minor complications
24
+ # to keep in mind:
25
+ #
26
+ # - The stored podspecs need to be cleaned before the resolution step
27
+ # otherwise the sandbox might return an old podspec and not download
28
+ # the new one from an external source.
29
+ # - The resolver might trigger the download of Pods from external sources
30
+ # necessary to retrieve their podspec (unless it is instructed not to
31
+ # do it).
32
+ #
33
+ # @return [void]
34
+ #
35
+ def install!
36
+
37
+ start_time = Time.new
38
+
39
+ puts '=> prepare cost : ' + timing(method(:prepare)) + ' ms';
40
+ puts '=> resolve_dependencies cost : ' + timing(method(:resolve_dependencies)) + ' ms';
41
+ puts '=> download_dependencies cost : ' + timing(method(:download_dependencies)) + ' ms';
42
+ puts '=> verify_no_duplicate_framework_names cost : ' + timing(method(:verify_no_duplicate_framework_names)) + ' ms';
43
+ puts '=> verify_no_static_framework_transitive_dependencies cost : ' + timing(method(:verify_no_static_framework_transitive_dependencies)) + ' ms';
44
+ puts '=> verify_framework_usage cost : ' + timing(method(:verify_framework_usage)) + ' ms';
45
+ puts '=> generate_pods_project cost : ' + timing(method(:generate_pods_project)) + ' ms';
46
+ puts '=> integrate_user_project cost : ' + timing(method(:integrate_user_project)) + ' ms' if installation_options.integrate_targets?
47
+ puts '=> perform_post_install_actions cost : ' + timing(method(:perform_post_install_actions)) + ' ms';
48
+
49
+ cost_time = (Time.new.to_f - start_time.to_f)*1000
50
+ puts "\e[32m Total cost : #{cost_time.to_i.to_s} ms\e[0m"
51
+ end
52
+
53
+ def resolve_dependencies
54
+ analyzer = create_analyzer
55
+
56
+ plugin_sources = run_source_provider_hooks
57
+ analyzer.sources.insert(0, *plugin_sources)
58
+
59
+ UI.section 'Updating local specs repositories' do
60
+ puts "===> analyzer.update_repositories cost : " + timing(analyzer.method(:update_repositories)) + " ms";
61
+ end if repo_update?
62
+
63
+ UI.section 'Analyzing dependencies' do
64
+ puts "===> analyze(analyzer) cost : " + timing(method(:analyze), analyzer) + " ms";
65
+ puts "===> validate_build_configurations cost : " + timing(method(:validate_build_configurations)) + " ms";
66
+ puts "===> clean_sandbox cost : " + timing(method(:clean_sandbox)) + " ms";
67
+ end
68
+ end
69
+
70
+ def download_dependencies
71
+ UI.section 'Downloading dependencies' do
72
+ puts "===> create_file_accessors cost : " + timing(method(:create_file_accessors)) + " ms";
73
+ puts "===> install_pod_sources cost : " + timing(method(:install_pod_sources)) + " ms";
74
+ puts "===> run_podfile_pre_install_hooks cost : " + timing(method(:run_podfile_pre_install_hooks)) + " ms";
75
+ puts "===> clean_pod_sources cost : " + timing(method(:clean_pod_sources)) + " ms";
76
+ end
77
+ end
78
+
79
+ def generate_pods_project
80
+ UI.section 'Generating Pods project' do
81
+ puts "===> prepare_pods_project cost : " + timing(method(:prepare_pods_project)) + " ms";
82
+ puts "===> install_file_references cost : " + timing(method(:install_file_references)) + " ms";
83
+ puts "===> install_libraries cost : " + timing(method(:install_libraries)) + " ms";
84
+ puts "===> set_target_dependencies cost : " + timing(method(:set_target_dependencies)) + " ms";
85
+ puts "===> run_podfile_post_install_hooks cost : " + timing(method(:run_podfile_post_install_hooks)) + " ms";
86
+ puts "===> write_pod_project cost : " + timing(method(:write_pod_project)) + " ms";
87
+ puts "===> share_development_pod_schemes cost : " + timing(method(:share_development_pod_schemes)) + " ms";
88
+ puts "===> write_lockfiles cost : " + timing(method(:write_lockfiles)) + " ms";
89
+ end
90
+ end
91
+
92
+ #-------------------------------------------------------------------------#
93
+ # Downloads, installs the documentation and cleans the sources of the Pods
94
+ # which need to be installed.
95
+ #
96
+ # @return [void]
97
+ #
98
+ def install_pod_sources
99
+ @installed_specs = []
100
+ pods_to_install = sandbox_state.added | sandbox_state.changed
101
+ title_options = { :verbose_prefix => '-> '.green }
102
+ root_specs.sort_by(&:name).each do |spec|
103
+ if pods_to_install.include?(spec.name)
104
+ if sandbox_state.changed.include?(spec.name) && sandbox.manifest
105
+ previous = sandbox.manifest.version(spec.name)
106
+ title = "Installing #{spec.name} #{spec.version} (was #{previous})"
107
+ else
108
+ title = "Installing #{spec}"
109
+ end
110
+ UI.titled_section(title.green, title_options) do
111
+ puts "=====> Install #{spec} cost : " + timing(method(:install_source_of_pod), spec.name) + " ms";
112
+ # install_source_of_pod(spec.name)
113
+ end
114
+ else
115
+ UI.titled_section("Using #{spec}", title_options) do
116
+ puts "=====> USing #{spec} cost : " + timing(method(:create_pod_installer), spec.name) + " ms";
117
+ # create_pod_installer(spec.name)
118
+ end
119
+ end
120
+ end
121
+ end
122
+
123
+ # Installs the aggregate targets of the Pods projects and generates their
124
+ # support files.
125
+ #
126
+ # @return [void]
127
+ #
128
+ def install_libraries
129
+ UI.message '- Installing targets' do
130
+ pod_targets.sort_by(&:name).each do |pod_target|
131
+ target_installer = PodTargetInstaller.new(sandbox, pod_target)
132
+ puts "=====> install pod target #{pod_target.name} cost : " + timing(target_installer.method(:install!)) + " ms";
133
+ # target_installer.install!
134
+ end
135
+
136
+ aggregate_targets.sort_by(&:name).each do |target|
137
+ target_installer = AggregateTargetInstaller.new(sandbox, target)
138
+ puts "=====> install aggregate target #{target.name} cost : " + timing(target_installer.method(:install!)) + " ms";
139
+ # target_installer.install!
140
+ end
141
+
142
+ # TODO: Move and add specs
143
+ pod_targets.sort_by(&:name).each do |pod_target|
144
+ pod_target.file_accessors.each do |file_accessor|
145
+ file_accessor.spec_consumer.frameworks.each do |framework|
146
+ if pod_target.should_build?
147
+ pod_target.native_target.add_system_framework(framework)
148
+ end
149
+ end
150
+ end
151
+ end
152
+
153
+ end
154
+ end
155
+ #-------------------------------------------------------------------------#
156
+ end
157
+ end
@@ -0,0 +1,11 @@
1
+ require "cocoapods-timeconsuming-details/version"
2
+
3
+ if Pod::VERSION == '1.0.0'
4
+ require 'cocoapods-timeconsuming-details_for1.0.0.rb'
5
+ elsif Pod::VERSION == '0.39.0'
6
+ require 'cocoapods-timeconsuming-details_for0.39.0.rb'
7
+ elsif Pod::VERSION == '0.35.0'
8
+ require 'cocoapods-timeconsuming-details_for0.35.0.rb'
9
+ end
10
+
11
+
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-timeconsuming-details
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - 圆寸
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-05-18 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.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: cocoapods install/update timeconsuming details.
42
+ email:
43
+ - philip.lpf@alibaba-inc.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - CODE_OF_CONDUCT.md
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - bin/console
55
+ - bin/setup
56
+ - cocoapods-timeconsuming-details.gemspec
57
+ - lib/cocoapods-timeconsuming-details/version.rb
58
+ - lib/cocoapods-timeconsuming-details_for0.35.0.rb
59
+ - lib/cocoapods-timeconsuming-details_for0.39.0.rb
60
+ - lib/cocoapods-timeconsuming-details_for1.0.0.rb
61
+ - lib/cocoapods_plugin.rb
62
+ homepage: http://github.com
63
+ licenses:
64
+ - MIT
65
+ metadata:
66
+ allowed_push_host: https://rubygems.org
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.6.1
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: cocoapods install/update timeconsuming details.
87
+ test_files: []