cocoapods-bb-bin 0.1.9.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 421565cc472d283f9e146259dc55a04d59f47ea257971c5ed08c0c91a20f8103
4
- data.tar.gz: 6fd6c9755d9dc3277a9f055e38dac34edee2ed1f2a827d454558be14c8a78668
3
+ metadata.gz: 9c3db228010949a3ee9a1029358a1ed29026a1e2ac100ea2eae52afe9a0c0843
4
+ data.tar.gz: cf85159135d5e2f16a6cd025cc1bbcfce786becf639e239ed832145cc62d91aa
5
5
  SHA512:
6
- metadata.gz: 48b8836abd60d88e82321a1843964ccda27ff364a09f8f5b56b4ecd2b56b6d0735b07fa561954411534fd2d93338db0b34009764eb382f0b1794ae7781a16d69
7
- data.tar.gz: 41233c856e3922cb85ac445219b14021670b10516fc8b2292e1326648ca842857081e27bce96c36bc61c242408a51d89e5876315476687985d67a12f745baff1
6
+ metadata.gz: 39a6e327cd12a99f317da290936820af7e680ecc5f29032fc3669a1059e54d3516091bf1c526b5239eb933784029d4fe1412e874460a77f997c94c9f2d7d2154
7
+ data.tar.gz: 072b9c4c9f0d2dad89cd20b5b77d987ed42d2a977b1f60b4d95ce79ee43af9aeb636f9e550d25799a30a1444b696740cec769e09cbb39a2be611dc74fb6387ff
@@ -21,7 +21,8 @@ module Pod
21
21
  ['--no-zip', '不压缩静态 framework 为 zip'],
22
22
  ['--all-make', '对该组件的依赖库,全部制作为二进制组件'],
23
23
  ['--configuration', 'Build the specified configuration (e.g. Release ). Defaults to Debug'],
24
- ['--env', "该组件上传的环境 %w[dev debug_iphoneos release_iphoneos]"]
24
+ ['--env', "该组件上传的环境 %w[dev debug_iphoneos release_iphoneos]"],
25
+ ['--all-push', '上传二进制同时,允许同时推送源码索引'],
25
26
  ].concat(Pod::Command::Gen.options).concat(super).uniq
26
27
  end
27
28
 
@@ -40,6 +41,7 @@ module Pod
40
41
  @allow_prerelease = argv.flag?('allow-prerelease')
41
42
  @framework_output = argv.flag?('framework-output', false )
42
43
  @xcframework_output = argv.flag?('xcframework-output', false )
44
+ @pushsourcespec = argv.flag?('all-push', false )
43
45
  @clean = argv.flag?('clean', true)
44
46
  @zip = argv.flag?('zip', true)
45
47
  @all_make = argv.flag?('all-make', false )
@@ -64,7 +66,7 @@ module Pod
64
66
  fail_push_specs = []
65
67
  sources_sepc.uniq.each do |spec|
66
68
  begin
67
- fail_push_specs << spec unless CBin::Upload::Helper.new(spec,@code_dependencies,@sources).upload
69
+ fail_push_specs << spec unless CBin::Upload::Helper.new(spec,@code_dependencies,@sources,@pushsourcespec).upload
68
70
  rescue Object => exception
69
71
  UI.puts exception
70
72
  fail_push_specs << spec
@@ -84,7 +86,6 @@ module Pod
84
86
  auto_success += "#{spec.name} | #{spec.version}\n"
85
87
  UI.warn "===【 #{spec.name} | #{spec.version} 】二进制组件制作完成 !!! "
86
88
  end
87
- puts "============== auto_success"
88
89
  puts auto_success
89
90
  ENV['auto_success'] = auto_success
90
91
  end
@@ -38,7 +38,6 @@ module Pod
38
38
  @podspec = argv.shift_argument
39
39
  super
40
40
  @additional_args = argv.remainder!
41
- @verbose = argv.flag?('verbose', false)
42
41
  end
43
42
 
44
43
  def run
@@ -109,11 +108,12 @@ module Pod
109
108
  argvs += ['--verbose'] if @verbose
110
109
  end
111
110
 
112
- # puts "pod lib lint argvs:#{argvs}"
111
+ puts "pod bin lib lint argvs:#{argvs}"
113
112
  lint = Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
114
113
  lint.validate!
115
114
  lint.run
116
115
  rescue Object => exception
116
+ UI.puts "fail....."
117
117
  UI.puts exception
118
118
  end
119
119
  end
@@ -31,7 +31,6 @@ module Pod
31
31
  end
32
32
 
33
33
  def initialize(argv)
34
- super
35
34
  @repo = argv.shift_argument
36
35
  @podspec = argv.shift_argument
37
36
  @binary = argv.flag?('binary')
@@ -43,13 +42,8 @@ module Pod
43
42
  @allow_prerelease = argv.flag?('allow-prerelease')
44
43
  @use_static_frameworks = argv.flag?('use-static-frameworks', true)
45
44
  @bb_env = argv.flag?('bb-env', false)
46
-
45
+ super
47
46
  @additional_args = argv.remainder!
48
- @message = argv.option('commit-message')
49
- @commit_message = argv.flag?('commit-message', false)
50
- @use_json = argv.flag?('use-json')
51
- @verbose = argv.flag?('verbose', false)
52
- @local_only = argv.flag?('local-only')
53
47
  end
54
48
 
55
49
  def run
@@ -110,13 +104,12 @@ module Pod
110
104
  new_repo,
111
105
  @podspec,
112
106
  "--sources=#{sources_option(@code_dependencies, @sources)}",
113
- # '--verbose'
107
+ # '--verbose',
114
108
  '--allow-warnings',
115
109
  '--use-static-frameworks',
116
110
  '--skip-import-validation',
117
111
  '--use-modular-headers',
118
112
  '--swift-version=5.0',
119
- '--use_cocoapods_validator', #cocoapods验证
120
113
  *@additional_args
121
114
  ]
122
115
  argvs += ['--verbose'] if @verbose
@@ -124,7 +117,7 @@ module Pod
124
117
  argvs += ['--use-json'] if @use_json
125
118
  argvs += ['--local-only'] if @local_only
126
119
 
127
- # UI.puts "pod repo push argvs:#{argvs}"
120
+ UI.puts "pod bin repo push argvs:#{argvs}"
128
121
  push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
129
122
  push.validate!
130
123
  push.run
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.1.9.1'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
 
6
6
  module Pod
@@ -43,15 +43,24 @@ module CBin
43
43
  end
44
44
 
45
45
  @filename = file
46
+ # Pod::UI::puts "===copy origin file: #{file}"
47
+ # Pod::UI::puts "===copy desc file: #{sourceSpecFilePath}"
48
+ # 拷贝二进制spec到源码spec by hm 22/1/19
49
+ `cp -fa #{file} #{sourceSpecFilePath}`
46
50
  end
47
51
 
48
52
  def clear_spec_file
49
53
  File.delete(filename) if File.exist?(filename)
50
54
  end
51
55
 
56
+ # 二进制spec路径
52
57
  def filename
53
58
  @filename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.binary.podspec.json"
54
59
  end
60
+ # 源码spec路径(指向二进制库)
61
+ def sourceSpecFilePath
62
+ @sourcefilename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.podspec.json"
63
+ end
55
64
 
56
65
  private
57
66
 
@@ -15,10 +15,11 @@ module CBin
15
15
  class Helper
16
16
  include CBin::SourcesHelper
17
17
 
18
- def initialize(spec,code_dependencies,sources)
18
+ def initialize(spec,code_dependencies,sources, pushsourcespec = false)
19
19
  @spec = spec
20
20
  @code_dependencies = code_dependencies
21
21
  @sources = sources
22
+ @pushsourcespec = pushsourcespec # 推送源码
22
23
  end
23
24
 
24
25
  def upload
@@ -29,7 +30,13 @@ module CBin
29
30
  res_zip = curl_zip
30
31
  if res_zip
31
32
  filename = spec_creator
33
+ Pod::UI.message "上传二进制 podspec: #{filename}"
32
34
  push_binary_repo(filename)
35
+ # 上传源码 podspec
36
+ if @pushsourcespec
37
+ Pod::UI.message "上传源码 podspec: #{@spec_creator.sourceSpecFilePath}"
38
+ push_source_repo(@spec_creator.sourceSpecFilePath)
39
+ end
33
40
  end
34
41
  res_zip
35
42
  end
@@ -37,6 +44,7 @@ module CBin
37
44
 
38
45
  def spec_creator
39
46
  spec_creator = CBin::SpecificationSource::Creator.new(@spec)
47
+ @spec_creator = spec_creator
40
48
  spec_creator.create
41
49
  spec_creator.write_spec_file
42
50
  spec_creator.filename
@@ -76,22 +84,44 @@ EOF
76
84
  "#{binary_source.name}", # repo
77
85
  "#{binary_podsepc_json}", # spec
78
86
  "--binary",
79
- "--sources=#{sources_option(@code_dependencies, @sources)},https:\/\/cdn.cocoapods.org",
87
+ "--sources=#{binary_source},https:\/\/cdn.cocoapods.org",
80
88
  "--skip-import-validation",
81
89
  "--use-libraries",
82
90
  "--allow-warnings",
83
91
  "--verbose",
84
- "--code-dependencies"
92
+ "--code-dependencies",
93
+ '--no-cocoapods-validator', #不采用cocoapods验证
85
94
  ]
86
95
  if @verbose
87
96
  argvs += ['--verbose']
88
97
  end
89
-
98
+ Pod::UI.message "上传二进制 argvs: #{argvs}"
90
99
  push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs))
91
100
  push.validate!
92
101
  push.run
93
102
  end
94
103
 
104
+ # 上传源码podspec
105
+ def push_source_repo(source_podsepc_json)
106
+ argvs = [
107
+ "#{code_source.name}", # repo
108
+ "#{source_podsepc_json}", # spec
109
+ "--sources=#{code_source},https:\/\/cdn.cocoapods.org",
110
+ "--skip-import-validation",
111
+ "--use-libraries",
112
+ "--allow-warnings",
113
+ "--verbose",
114
+ "--code-dependencies",
115
+ '--no-cocoapods-validator', #不采用cocoapods验证
116
+ ]
117
+ if @verbose
118
+ argvs += ['--verbose']
119
+ end
120
+ Pod::UI.message "上传源码 argvs: #{argvs}"
121
+ push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs))
122
+ push.validate!
123
+ push.run
124
+ end
95
125
  end
96
126
  end
97
127
  end
@@ -15,18 +15,16 @@ module Pod
15
15
  class PodfileGenerator
16
16
  # @return [Podfile] a podfile suitable for installing the given spec
17
17
  #
18
- # @param [Specification] spec
18
+ # @param [Array<Specification>] specs
19
19
  #
20
- alias old_podfile_for_spec podfile_for_spec
21
-
22
- def podfile_for_spec(spec)
20
+ def podfile_for_specs(specs)
23
21
  generator = self
24
- dir = configuration.gen_dir_for_pod(spec.name)
25
- project_name = configuration.project_name_for_spec(spec)
22
+ dir = configuration.gen_dir_for_specs(specs)
23
+ project_name = configuration.project_name_for_specs(specs)
26
24
 
27
25
  Pod::Podfile.new do
28
26
  project "#{project_name}.xcodeproj"
29
- workspace "#{spec.name}.xcworkspace"
27
+ workspace "#{project_name}.xcworkspace"
30
28
 
31
29
  plugin 'cocoapods-generate'
32
30
 
@@ -35,8 +33,8 @@ module Pod
35
33
  generator.podfile_plugins.each do |name, options|
36
34
  plugin(*[name, options].compact)
37
35
  end
38
- # Pod::UI::puts "====use_frameworks:#{generator.configuration.use_frameworks?}"
39
- use_frameworks!(generator.configuration.use_frameworks?)
36
+
37
+ use_frameworks!(generator.use_frameworks_value)
40
38
 
41
39
  if (supported_swift_versions = generator.supported_swift_versions)
42
40
  supports_swift_versions(supported_swift_versions)
@@ -49,44 +47,51 @@ module Pod
49
47
 
50
48
  self.defined_in_file = dir.join('CocoaPods.podfile.yaml')
51
49
 
52
- test_specs = spec.recursive_subspecs.select(&:test_specification?)
53
- app_specs = if spec.respond_to?(:app_specification?)
54
- spec.recursive_subspecs.select(&:app_specification?)
55
- else
56
- []
57
- end
50
+ test_specs_by_spec = Hash[specs.map do |spec|
51
+ [spec, spec.recursive_subspecs.select(&:test_specification?)]
52
+ end]
53
+ app_specs_by_spec = Hash[specs.map do |spec|
54
+ app_specs = if spec.respond_to?(:app_specification?)
55
+ spec.recursive_subspecs.select(&:app_specification?)
56
+ else
57
+ []
58
+ end
59
+ [spec, app_specs]
60
+ end]
58
61
 
59
62
  # Stick all of the transitive dependencies in an abstract target.
60
63
  # This allows us to force CocoaPods to use the versions / sources / external sources
61
64
  # that we want.
62
- # By using an abstract target,
63
-
65
+
64
66
  # 会导致多个dependencies出现, 注释by slj
65
67
  # abstract_target 'Transitive Dependencies' do
66
- # pods_for_transitive_dependencies = [spec.name]
67
- # .concat(test_specs.map(&:name))
68
- # .concat(test_specs.flat_map { |ts| ts.dependencies.flat_map(&:name) })
69
- # .concat(app_specs.map(&:name))
70
- # .concat(app_specs.flat_map { |as| as.dependencies.flat_map(&:name) })
71
- #
68
+ # pods_for_transitive_dependencies = specs.flat_map do |spec|
69
+ # [spec.name]
70
+ # .concat(test_specs_by_spec.keys.map(&:name))
71
+ # .concat(test_specs_by_spec.values.flatten.flat_map { |ts| ts.dependencies.flat_map(&:name) })
72
+ # .concat(app_specs_by_spec.keys.map(&:name))
73
+ # .concat(app_specs_by_spec.values.flatten.flat_map { |as| as.dependencies.flat_map(&:name) })
74
+ # end
75
+ # pods_for_transitive_dependencies.uniq!
76
+
77
+ # spec_names = specs.map { |s| s.root.name }.to_set
72
78
  # dependencies = generator
73
- # .transitive_dependencies_by_pod
74
- # .values_at(*pods_for_transitive_dependencies)
75
- # .compact
76
- # .flatten(1)
77
- # .uniq
78
- # .sort_by(&:name)
79
- # .reject { |d| d.root_name == spec.root.name }
80
- #
79
+ # .transitive_dependencies_by_pod
80
+ # .values_at(*pods_for_transitive_dependencies)
81
+ # .compact
82
+ # .flatten(1)
83
+ # .uniq
84
+ # .sort_by(&:name)
85
+ # .reject { |d| spec_names.include?(d.root_name) }
86
+
81
87
  # dependencies.each do |dependency|
82
88
  # pod_args = generator.pod_args_for_dependency(self, dependency)
83
89
  # pod(*pod_args)
84
90
  # end
85
91
  # end
86
92
 
87
- # Add platform-specific concrete targets that inherit the
88
- # `pod` declaration for the local pod.
89
- spec_platform_names = spec.available_platforms.map(&:string_name).flatten.each.reject do |platform_name|
93
+ # Add platform-specific concrete targets that inherit the `pod` declaration for the local pod.
94
+ spec_platform_names = specs.flat_map { |s| s.available_platforms.map(&:string_name) }.uniq.each.reject do |platform_name|
90
95
  !generator.configuration.platforms.nil? && !generator.configuration.platforms.include?(platform_name.downcase)
91
96
  end
92
97
 
@@ -98,8 +103,16 @@ module Pod
98
103
 
99
104
  # this block has to come _before_ inhibit_all_warnings! / use_modular_headers!,
100
105
  # and the local `pod` declaration
101
- # 会导致多个dependencies出现, 注释by slj
102
-
106
+ # current_target_definition.instance_exec do
107
+ # transitive_dependencies = children.find { |c| c.name == 'Transitive Dependencies' }
108
+
109
+ # %w[use_modular_headers inhibit_warnings].each do |key|
110
+ # Pod::UI::puts "====key:#{key} value:#{value}"
111
+ # value = transitive_dependencies.send(:internal_hash).delete(key)
112
+ # next if value.blank?
113
+ # set_hash_value(key, value)
114
+ # end
115
+ # end
103
116
 
104
117
  inhibit_all_warnings! if generator.inhibit_all_warnings?
105
118
  # use_modular_headers! if generator.use_modular_headers?
@@ -112,15 +125,18 @@ module Pod
112
125
  use_modular_headers!
113
126
  end
114
127
 
115
- # This is the pod declaration for the local pod,
116
- # it will be inherited by the concrete target definitions below
117
- pod_options = generator.dependency_compilation_kwargs(spec.name)
118
- pod_options[:path] = spec.defined_in_file.relative_path_from(dir).to_s
119
- { testspecs: test_specs, appspecs: app_specs }.each do |key, specs|
120
- pod_options[key] = specs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless specs.empty?
121
- end
128
+ specs.each do |spec|
129
+ # This is the pod declaration for the local pod,
130
+ # it will be inherited by the concrete target definitions below
131
+ pod_options = generator.dependency_compilation_kwargs(spec.name)
122
132
 
123
- pod spec.name, **pod_options
133
+ path = spec.defined_in_file.relative_path_from(dir).to_s
134
+ pod_options[:path] = path
135
+ { testspecs: test_specs_by_spec[spec], appspecs: app_specs_by_spec[spec] }.each do |key, subspecs|
136
+ pod_options[key] = subspecs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless subspecs.blank?
137
+ end
138
+ pod spec.name, **pod_options
139
+ end
124
140
 
125
141
  if Pod::Config.instance.podfile
126
142
  target_definitions['Pods'].instance_exec do
@@ -187,14 +203,16 @@ module Pod
187
203
 
188
204
  # Implement local-sources option to set up dependencies to podspecs in the local filesystem.
189
205
  next if generator.configuration.local_sources.empty?
190
- generator.transitive_local_dependencies(spec, generator.configuration.local_sources).each do |dependency, podspec_file|
191
- pod_options = generator.dependency_compilation_kwargs(dependency.name)
192
- pod_options[:path] = if podspec_file[0] == '/' # absolute path
193
- podspec_file
194
- else
195
- '../../' + podspec_file
196
- end
197
- pod dependency.name, **pod_options
206
+ specs.each do |spec|
207
+ generator.transitive_local_dependencies(spec, generator.configuration.local_sources).sort_by(&:first).each do |dependency, podspec_file|
208
+ pod_options = generator.dependency_compilation_kwargs(dependency.name)
209
+ pod_options[:path] = if podspec_file[0] == '/' # absolute path
210
+ podspec_file
211
+ else
212
+ '../../' + podspec_file
213
+ end
214
+ pod dependency.name, **pod_options
215
+ end
198
216
  end
199
217
  end
200
218
  end
@@ -27,7 +27,7 @@ module Pod
27
27
  @skip_tests = argv.flag?('skip-tests', false)
28
28
  @allow_overwrite = argv.flag?('overwrite', true)
29
29
  super
30
- @use_cocoapods_validator = argv.flag?('use_cocoapods_validator', false)# 配置参数cocoapods进行验证,内部进行hook,二进制hook,源码cocoapods进行验证
30
+ @use_cocoapods_validator = argv.flag?('cocoapods-validator', true)# 配置参数cocoapods进行验证,内部进行hook,二进制hook,源码cocoapods进行验证
31
31
  end
32
32
 
33
33
  # Performs a full lint against the podspecs.
@@ -5,8 +5,9 @@ module Pod
5
5
  # @return [Boolean] 使用cocoapods进行验证,二进制库推送默认不采用cocoapods(1.11.2)验证
6
6
  #
7
7
  # attr_accessor :use_cocoapods_validator
8
- def initialize(spec_or_path, source_urls, platforms = [], use_cocoapods_validator = false)
8
+ def initialize(spec_or_path, source_urls, platforms = [], use_cocoapods_validator = true)
9
9
  @use_cocoapods_validator = use_cocoapods_validator
10
+ UI.puts "use_cocoapods_validator = #{use_cocoapods_validator}"
10
11
  @use_frameworks = true
11
12
  @linter = Specification::Linter.new(spec_or_path)
12
13
  @source_urls = if @linter.spec && @linter.spec.dependencies.empty? && @linter.spec.recursive_subspecs.all? { |s| s.dependencies.empty? }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-02 00:00:00.000000000 Z
11
+ date: 2022-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -48,16 +48,22 @@ dependencies:
48
48
  name: cocoapods-generate
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '2.2'
54
+ - - "<"
52
55
  - !ruby/object:Gem::Version
53
- version: 2.0.1
56
+ version: '3.0'
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
- - - "~>"
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '2.2'
64
+ - - "<"
59
65
  - !ruby/object:Gem::Version
60
- version: 2.0.1
66
+ version: '3.0'
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: cocoapods-bb-xcframework
63
69
  requirement: !ruby/object:Gem::Requirement
@@ -197,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
203
  - !ruby/object:Gem::Version
198
204
  version: '0'
199
205
  requirements: []
200
- rubygems_version: 3.2.30
206
+ rubygems_version: 3.3.5
201
207
  signing_key:
202
208
  specification_version: 4
203
209
  summary: cocoapods-bb-bin is a plugin which helps develpers switching pods between