cocoapods-remove-duplicates 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
+ SHA256:
3
+ metadata.gz: df233be13ca433351590bba095550642a861f4154e5ae6180c8b42147b79d34d
4
+ data.tar.gz: 4b293d5a6ba54f25e573d4b5d92e509e04d9c4410422b36408c9b95c59ed5300
5
+ SHA512:
6
+ metadata.gz: 2e7182ddcdc569b8b1ddffa179f5465ae6cebc4e98b591a6485e1b5a2233ceaee9a4b45cd9b17bdad383c07c6d1711ec1642f3ebf1375f37d3102e333c990d96
7
+ data.tar.gz: '09d38b8d9e69fd9be5124340a6a3c6095ae08d94925fb98a32b5a86ef68cb47ae448da46ef07060fdefa80506533ba63cc78a8651b8368ff5e07271067778b35'
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-remove-duplicates.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,102 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cocoapods-remove-duplicates (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ CFPropertyList (3.0.3)
10
+ activesupport (4.2.11.3)
11
+ i18n (~> 0.7)
12
+ minitest (~> 5.1)
13
+ thread_safe (~> 0.3, >= 0.3.4)
14
+ tzinfo (~> 1.1)
15
+ algoliasearch (1.27.5)
16
+ httpclient (~> 2.8, >= 2.8.3)
17
+ json (>= 1.5.1)
18
+ atomos (0.1.3)
19
+ bacon (1.2.0)
20
+ claide (1.0.3)
21
+ cocoapods (1.8.0)
22
+ activesupport (>= 4.0.2, < 5)
23
+ claide (>= 1.0.2, < 2.0)
24
+ cocoapods-core (= 1.8.0)
25
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
26
+ cocoapods-downloader (>= 1.2.2, < 2.0)
27
+ cocoapods-plugins (>= 1.0.0, < 2.0)
28
+ cocoapods-search (>= 1.0.0, < 2.0)
29
+ cocoapods-stats (>= 1.0.0, < 2.0)
30
+ cocoapods-trunk (>= 1.4.0, < 2.0)
31
+ cocoapods-try (>= 1.1.0, < 2.0)
32
+ colored2 (~> 3.1)
33
+ escape (~> 0.0.4)
34
+ fourflusher (>= 2.3.0, < 3.0)
35
+ gh_inspector (~> 1.0)
36
+ molinillo (~> 0.6.6)
37
+ nap (~> 1.0)
38
+ ruby-macho (~> 1.4)
39
+ xcodeproj (>= 1.11.1, < 2.0)
40
+ cocoapods-core (1.8.0)
41
+ activesupport (>= 4.0.2, < 6)
42
+ algoliasearch (~> 1.0)
43
+ concurrent-ruby (~> 1.0)
44
+ fuzzy_match (~> 2.0.4)
45
+ nap (~> 1.0)
46
+ cocoapods-deintegrate (1.0.4)
47
+ cocoapods-downloader (1.4.0)
48
+ cocoapods-plugins (1.0.0)
49
+ nap
50
+ cocoapods-search (1.0.0)
51
+ cocoapods-stats (1.1.0)
52
+ cocoapods-trunk (1.5.0)
53
+ nap (>= 0.8, < 2.0)
54
+ netrc (~> 0.11)
55
+ cocoapods-try (1.2.0)
56
+ colored2 (3.1.2)
57
+ concurrent-ruby (1.1.8)
58
+ escape (0.0.4)
59
+ fourflusher (2.3.1)
60
+ fuzzy_match (2.0.4)
61
+ gh_inspector (1.1.3)
62
+ httpclient (2.8.3)
63
+ i18n (0.9.5)
64
+ concurrent-ruby (~> 1.0)
65
+ json (2.5.1)
66
+ minitest (5.14.4)
67
+ mocha (1.12.0)
68
+ mocha-on-bacon (0.2.3)
69
+ mocha (>= 0.13.0)
70
+ molinillo (0.6.6)
71
+ nanaimo (0.3.0)
72
+ nap (1.1.0)
73
+ netrc (0.11.0)
74
+ prettybacon (0.0.2)
75
+ bacon (~> 1.2)
76
+ rake (13.0.3)
77
+ ruby-macho (1.4.0)
78
+ thread_safe (0.3.6)
79
+ tzinfo (1.2.9)
80
+ thread_safe (~> 0.1)
81
+ xcodeproj (1.19.0)
82
+ CFPropertyList (>= 2.3.3, < 4.0)
83
+ atomos (~> 0.1.3)
84
+ claide (>= 1.0.2, < 2.0)
85
+ colored2 (~> 3.1)
86
+ nanaimo (~> 0.3.0)
87
+
88
+ PLATFORMS
89
+ ruby
90
+
91
+ DEPENDENCIES
92
+ bacon
93
+ bundler (~> 1.3)
94
+ cocoapods (= 1.8.0)
95
+ cocoapods-remove-duplicates!
96
+ mocha
97
+ mocha-on-bacon
98
+ prettybacon
99
+ rake
100
+
101
+ BUNDLED WITH
102
+ 1.17.3
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2021 Gao Yu <gaoyuexit@163.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-remove-duplicates
2
+
3
+ > 该插件会在**pod install**过程中自动移除掉重复的`.a`, `.framework`库
4
+
5
+ ## Installation
6
+
7
+ $ gem install cocoapods-remove-duplicates
8
+
9
+ ## Usage
10
+
11
+ $ pod spec duplicates POD_NAME
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
+
@@ -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-remove-duplicates/gem_version.rb'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'cocoapods-remove-duplicates'
8
+ spec.version = CocoapodsRemoveDuplicates::VERSION
9
+ spec.authors = ['GaoYu']
10
+ spec.email = ['gaoyuexit@163.com']
11
+ spec.description = %q{remove the duplicate .a .framework in pod install.}
12
+ spec.summary = %q{remove the duplicate .a .framework in pod install.}
13
+ spec.homepage = 'https://github.com/gaoyuexit/cocoapods-remove-duplicates'
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 @@
1
+ require 'cocoapods-remove-duplicates/gem_version'
@@ -0,0 +1 @@
1
+ require 'cocoapods-remove-duplicates/command/duplicates'
@@ -0,0 +1,46 @@
1
+ module Pod
2
+ class Command
3
+ # This is an example of a cocoapods plugin adding a top-level subcommand
4
+ # to the 'pod' command.
5
+ #
6
+ # You can also create subcommands of existing or new commands. Say you
7
+ # wanted to add a subcommand to `list` to show newly deprecated pods,
8
+ # (e.g. `pod list deprecated`), there are a few things that would need
9
+ # to change.
10
+ #
11
+ # - move this file to `lib/pod/command/list/deprecated.rb` and update
12
+ # the class to exist in the the Pod::Command::List namespace
13
+ # - change this class to extend from `List` instead of `Command`. This
14
+ # tells the plugin system that it is a subcommand of `list`.
15
+ # - edit `lib/cocoapods_plugins.rb` to require this file
16
+ #
17
+ # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
18
+ # in the `plugins.json` file, once your plugin is released.
19
+ #
20
+ class Duplicates < Command
21
+ self.summary = 'Short description of cocoapods-remove-duplicates.'
22
+
23
+ self.description = <<-DESC
24
+ Longer description of cocoapods-remove-duplicates.
25
+ DESC
26
+
27
+ self.arguments = [
28
+ CLAide::Argument.new('NAME', false)
29
+ ]
30
+
31
+ def initialize(argv)
32
+ @name = argv.shift_argument
33
+ super
34
+ end
35
+
36
+ def validate!
37
+ super
38
+ help! 'A Pod name is required.' unless @name
39
+ end
40
+
41
+ def run
42
+ UI.puts "Add your implementation for the cocoapods-remove-duplicates plugin in #{__FILE__}"
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,3 @@
1
+ module CocoapodsRemoveDuplicates
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,35 @@
1
+ require 'cocoapods'
2
+ require 'fileutils'
3
+
4
+ module Pod
5
+
6
+ class Installer
7
+
8
+ alias old_install_pod_sources install_pod_sources
9
+ def install_pod_sources
10
+ old_install_pod_sources
11
+
12
+ lib_paths = (`find '#{self.sandbox.root}' -type f -name *.a -o -name *.framework`).split("\n")
13
+ lib_hash = Hash.new
14
+
15
+ lib_paths.each do |path|
16
+
17
+ lib_name = File::basename(path)
18
+
19
+ if lib_hash.has_key?(lib_name)
20
+
21
+ if File.exist?(path)
22
+ File.delete(path)
23
+ Pod::UI.puts "移除重复库: #{lib_name}\t\t路径: #{path}"
24
+ end
25
+
26
+ else
27
+ lib_hash[lib_name] = path
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,9 @@
1
+ require 'cocoapods'
2
+ require 'cocoapods-remove-duplicates/command'
3
+ require 'fileutils'
4
+ require 'cocoapods-remove-duplicates/native/installer'
5
+
6
+ module CocoapodsDulicatesHooks
7
+ # Pod::HooksManager.register('cocoapods-remove-duplicates', :post_install) do |context|
8
+ # end
9
+ end
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::Duplicates do
5
+ describe 'CLAide' do
6
+ it 'registers it self' do
7
+ Command.parse(%w{ duplicates }).should.be.instance_of Command::Duplicates
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,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-remove-duplicates
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - GaoYu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-04-08 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: remove the duplicate .a .framework in pod install.
42
+ email:
43
+ - gaoyuexit@163.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - cocoapods-remove-duplicates.gemspec
55
+ - lib/cocoapods-remove-duplicates.rb
56
+ - lib/cocoapods-remove-duplicates/command.rb
57
+ - lib/cocoapods-remove-duplicates/command/duplicates.rb
58
+ - lib/cocoapods-remove-duplicates/gem_version.rb
59
+ - lib/cocoapods-remove-duplicates/native/installer.rb
60
+ - lib/cocoapods_plugin.rb
61
+ - spec/command/duplicates_spec.rb
62
+ - spec/spec_helper.rb
63
+ homepage: https://github.com/gaoyuexit/cocoapods-remove-duplicates
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
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
+ rubygems_version: 3.1.4
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: remove the duplicate .a .framework in pod install.
86
+ test_files:
87
+ - spec/command/duplicates_spec.rb
88
+ - spec/spec_helper.rb