cocoapods-bb-bin 0.2.8.1 → 0.2.10.0

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: a407974bf0e3a3d83090414b24bc3a141b5e43266209880a76612f6803a495a2
4
- data.tar.gz: 4172223e8c1f104fd0a8bc04f5dcc576b0a171cc1887d7fdbd43c8a8d956da09
3
+ metadata.gz: 6fce318ef901fcad220462267c7b775a896a713d64b709ea17dcb25fda700e81
4
+ data.tar.gz: 558223276cae0cdb2c17d46c28860b5710d5c43495a7d1e0e03c2602f79aca1b
5
5
  SHA512:
6
- metadata.gz: 1cba0529db54c5feceb01b4aa88f088b281ca517204a28dd31e9d6e93fc4c704711fc23191bb227e92b691d75376f42ec908eb234a6e5805896fde57e0ecba15
7
- data.tar.gz: cc7d774005f4d73e11c09ec84044db1254932bfe0ebfd1adb9cc67c21a50af59b64a2e41f478747afb724a87ee5af5a07b1e1dd430781c8cc6a6031b5926e607
6
+ metadata.gz: 754e5f52ac96ddf65d2e66a3f3ff1cf1c48703d8718e90ef65b5297693103b88acd8a9019c2070397f8e961327d4ae2fcfa0d29f942fb3974ad1387564c8b835
7
+ data.tar.gz: 185d627c29158d5449769975f2bbec760da7ed7212bed6331c1751c81cff707ef468c5be2fffc15d057ea344961542b164c8366759870892402b0876ede59b2a
@@ -19,9 +19,12 @@ module Pod
19
19
  [
20
20
  ['--sources', '私有源地址,多个用分号区分'],
21
21
  ['--path', '(必传)需要上传文件路径'],
22
+ ['--new_pod_name', '(可选)组件库新名称'],
22
23
  ['--vendored_framework_name', '(可选)组件库依赖framework名称,默认组件名称'],
23
24
  ['--dylib', '(可选)是否动态库,默认静态库'],
24
25
  ['--developer_mode', '(可选)是否开发者模式,默认发布模式'],
26
+ ['--upload_res', '(可选)是否上传资源文件,格式:zip、tgz'],
27
+ ['--only_business_spec', '(可选)仅仅上传到业务线专属spec,需要配合sources一起使用'],
25
28
  ].concat(Pod::Command::Gen.options).concat(super).uniq
26
29
  end
27
30
 
@@ -35,9 +38,14 @@ module Pod
35
38
  @podspec = argv.shift_argument || find_podspec
36
39
  @sources = argv.option('sources') || []
37
40
  @localPath = argv.option('path') || nil
41
+ @pod_name = argv.option('new_pod_name') || nil
38
42
  @vendored_framework_name = argv.option('vendored_framework_name') || nil
39
43
  @is_dylib = argv.flag?('dylib', false )
40
44
  @is_dev_model = argv.flag?('developer_mode', false )
45
+ # 上传资源
46
+ @is_up_res = argv.flag?('upload_res', false )
47
+ # 上传到业务线专属spec
48
+ @only_business_spec = argv.flag?('only_business_spec', false )
41
49
  end
42
50
  super
43
51
  end
@@ -57,6 +65,11 @@ module Pod
57
65
  @spec = Specification.from_file(@podspec)
58
66
  # dev环境修改version规则 by hm 24/8/20
59
67
  @spec.version = binary_version(@is_dev_model)
68
+ # 修改pod名称 by hm 24/10/9
69
+ if @pod_name
70
+ puts "====修改pod名称,原始:#{@spec.name} 新:#{@pod_name}"
71
+ @spec.name = @pod_name
72
+ end
60
73
  # 上传文件
61
74
  localPath = update_uploadpath unless !@localPath
62
75
  if File.file?(localPath)
@@ -65,9 +78,11 @@ module Pod
65
78
  sources_sepc << @spec
66
79
 
67
80
  fail_push_specs = []
81
+ pushsourcespec = hasUploadSourceCodeSpec # 是否需要上传源码spec
68
82
  sources_sepc.uniq.each do |spec|
69
83
  begin
70
- fail_push_specs << spec unless CBin::Upload::Helper.new(spec,true,@sources,true).upload_binary_file(localPath, @is_dylib, @vendored_framework_name)
84
+ is_upload_sourcecode =
85
+ fail_push_specs << spec unless CBin::Upload::Helper.new(spec,true,@sources,pushsourcespec).upload_binary_file(localPath, @is_dylib, @vendored_framework_name, @is_up_res)
71
86
  rescue Object => exception
72
87
  UI.puts exception
73
88
  fail_push_specs << spec
@@ -141,6 +156,17 @@ module Pod
141
156
  return new_version
142
157
  end
143
158
 
159
+ # 是否需要上传源码spec
160
+ def hasUploadSourceCodeSpec()
161
+ # 如果配置业务线专属spec,那么不去设置源码spec
162
+ hasSource = true
163
+ if @only_business_spec == true && !@sources.empty?
164
+ puts "配置业务线专属spec:#{@sources}".yellow
165
+ hasSource = false
166
+ end
167
+ return hasSource
168
+ end
169
+
144
170
  end
145
171
  end
146
172
  end
@@ -61,7 +61,7 @@ module Pod
61
61
  Podfile.execute_with_allow_prerelease(@allow_prerelease) do
62
62
  Podfile.execute_with_use_binaries(!@code_dependencies) do
63
63
  argvs = [
64
- repo,
64
+ push_repo,
65
65
  "--sources=#{sources_option(@code_dependencies, @sources)}",
66
66
  *@additional_args
67
67
  ]
@@ -74,7 +74,7 @@ module Pod
74
74
  argvs << '--use-libraries'
75
75
  end
76
76
  end
77
-
77
+ puts "push argvs: #{argvs}".yellow
78
78
  push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
79
79
  push.validate!
80
80
  push.run
@@ -98,15 +98,10 @@ module Pod
98
98
  end
99
99
  @podspec = podspecs.first
100
100
  end
101
- new_repo = repo # 内部判断区源码还是二进制
102
- if !@repo.nil?
103
- new_repo = @repo # 使用命令传入
104
- end
105
101
  argvs = [
106
- new_repo,
102
+ push_repo,
107
103
  @podspec,
108
104
  "--sources=#{sources_option(@code_dependencies, @sources)}",
109
- # '--verbose',
110
105
  '--allow-warnings',
111
106
  '--use-static-frameworks',
112
107
  '--skip-import-validation',
@@ -162,9 +157,15 @@ module Pod
162
157
  end
163
158
  end
164
159
 
165
- def repo
166
- @binary ? binary_source.name : code_source.name
160
+ def push_repo
161
+ if !@repo.empty?
162
+ new_repo = @repo # 使用命令传入
163
+ else
164
+ new_repo = @binary ? binary_source.name : code_source.name # 内部判断区源码还是二进制
165
+ end
166
+ return new_repo
167
167
  end
168
+
168
169
  end
169
170
  end
170
171
  end
@@ -8,7 +8,7 @@ module Pod
8
8
  self.summary = '更新私有源'
9
9
 
10
10
  self.arguments = [
11
- CLAide::Argument.new('NAME', false)
11
+ CLAide::Argument.new('NAME', false) # local spec name
12
12
  ]
13
13
 
14
14
  def self.options
@@ -28,6 +28,7 @@ module Pod
28
28
  if @name || @all
29
29
  config.sources_manager.update(@name, show_output)
30
30
  else
31
+ puts "repo update valid_sources:#{valid_sources}"
31
32
  Parallel.each(valid_sources, in_threads: 4) do |source|
32
33
  UI.puts "更新私有源仓库 #{source.to_s}".yellow
33
34
  source.update(show_output)
@@ -13,6 +13,11 @@ module CBin
13
13
  def template_hash
14
14
  {
15
15
  'configuration_env' => { description: '编译环境', default: 'dev', selection: %w[dev debug_iphoneos release_iphoneos] },
16
+ 'br_repo_url' => { description: 'BR产品线-源码私有源(源/静态库) Git 地址', default: 'https://github.com/CocoaPods/Specs.git' },
17
+ 'bw_repo_url' => { description: 'BW产品线-源码私有源(源/静态库) Git 地址', default: 'https://github.com/CocoaPods/Specs.git' },
18
+ 'math_repo_url' => { description: '数学产品线-源码私有源(源/静态库) Git 地址', default: 'https://github.com/CocoaPods/Specs.git' },
19
+ 'science_repo_url' => { description: '科学产品线-源码私有源(源/静态库) Git 地址', default: 'https://github.com/CocoaPods/Specs.git' },
20
+ 'abc_repo_url' => { description: 'ABC产品线-源码私有源(源/静态库) Git 地址', default: 'https://github.com/CocoaPods/Specs.git' },
16
21
  'code_repo_url' => { description: '源码私有源(源/静态库) Git 地址', default: 'https://github.com/CocoaPods/Specs.git' },
17
22
  'binary_repo_url' => { description: '二进制静态库私有源 Git 地址', default: 'https://github.com/CocoaPods/Specs.git' },
18
23
  'dylib_repo_url' => { description: '动态链接库私有源 Git 地址', default: 'https://github.com/CocoaPods/Specs.git' },
@@ -1,7 +1,7 @@
1
1
  require 'cocoapods'
2
2
 
3
3
  module CBin
4
- VERSION = '0.2.8.1'
4
+ VERSION = '0.2.10.0'
5
5
  end
6
6
 
7
7
  module Pod
@@ -11,41 +11,38 @@ module CBin
11
11
  class Helper
12
12
  include CBin::SourcesHelper
13
13
 
14
- def initialize()
14
+ def initialize(sources="")
15
+ @sources = sources
15
16
  end
16
17
 
17
18
  # 上传二进制 podspec
18
19
  def push_binary_repo(binary_podsepc_json,isGenDylib=false)
19
- argvs = [
20
- "#{binary_source.name}", # repo
21
- "#{binary_podsepc_json}", # spec
22
- "--binary",
23
- "--sources=#{binary_source},https:\/\/cdn.cocoapods.org",
24
- "--skip-import-validation",
25
- "--use-libraries",
26
- "--allow-warnings",
27
- "--verbose",
28
- "--code-dependencies",
29
- '--no-cocoapods-validator', #不采用cocoapods验证
30
- ]
31
- if @verbose
32
- argvs += ['--verbose']
20
+ if !@sources.empty?
21
+ customsource = custom_business_source(@sources)
22
+ else
23
+ customsource = binary_source
33
24
  end
34
- if isGenDylib # 生成动态库
35
- argvs += ['--dylib']
36
- end
37
- Pod::UI.message "上传二进制 argvs: #{argvs}"
38
- push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs))
39
- push.validate!
40
- push.run
25
+ puts "binary customsource=#{customsource}"
26
+ push_customsource_repo(binary_podsepc_json, customsource, isGenDylib, true)
41
27
  end
42
28
 
43
29
  # 上传源码podspec
44
30
  def push_source_repo(source_podsepc_json)
31
+ if !@sources.empty?
32
+ customsource = custom_business_source(@sources)
33
+ else
34
+ customsource = code_source
35
+ end
36
+ puts "source customsource=#{customsource}"
37
+ push_customsource_repo(source_podsepc_json, customsource, false, false)
38
+ end
39
+
40
+ # 上传自定义源podspec
41
+ def push_customsource_repo(source_podsepc_json, customsource=code_source, isGenDylib=false, isBinary=false)
45
42
  argvs = [
46
- "#{code_source.name}", # repo
43
+ "#{customsource.name}", # repo
47
44
  "#{source_podsepc_json}", # spec
48
- "--sources=#{code_source},https:\/\/cdn.cocoapods.org",
45
+ "--sources=#{customsource},https:\/\/cdn.cocoapods.org",
49
46
  "--skip-import-validation",
50
47
  "--use-libraries",
51
48
  "--allow-warnings",
@@ -56,7 +53,15 @@ module CBin
56
53
  if @verbose
57
54
  argvs += ['--verbose']
58
55
  end
59
- Pod::UI.message "上传源码 argvs: #{argvs}"
56
+ if isGenDylib # 生成动态库
57
+ argvs += ['--dylib']
58
+ end
59
+ if isBinary # 是否二进制
60
+ argvs += ['--binary']
61
+ Pod::UI.message "上传【二进制】argvs: #{argvs}"
62
+ else
63
+ Pod::UI.message "上传【源码】argvs: #{argvs}"
64
+ end
60
65
  push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs))
61
66
  push.validate!
62
67
  push.run
@@ -15,6 +15,30 @@ module CBin
15
15
  def code_source
16
16
  sources_manager.code_source
17
17
  end
18
+ # br产品线源
19
+ def br_source
20
+ sources_manager.br_source
21
+ end
22
+ # bw产品线源
23
+ def bw_source
24
+ sources_manager.bw_source
25
+ end
26
+ # 思维产品线源
27
+ def math_source
28
+ sources_manager.math_source
29
+ end
30
+ # 科学产品线源
31
+ def science_source
32
+ sources_manager.science_source
33
+ end
34
+ # ABC产品线源
35
+ def abc_source
36
+ sources_manager.abc_source
37
+ end
38
+ # 自定义产品线源
39
+ def custom_business_source(source_spec)
40
+ sources_manager.custom_business_source(source_spec)
41
+ end
18
42
 
19
43
  # 优先采用对应依赖的 source
20
44
  # cocoapods 内部会先匹配前面符合的 specification
@@ -19,10 +19,14 @@ module CBin
19
19
  raise Pod::Informative, '源码 podspec 不能为空 .' unless code_spec
20
20
  end
21
21
 
22
- def create(frameworkName=nil, is_xcframework=false)
22
+ def create(frameworkName=nil, is_xcframework=false, isUpRes=false)
23
23
  # spec = nil
24
24
  if CBin::Build::Utils.is_framework(@code_spec)
25
- Pod::UI::puts "make framework spec. vendored_framework_name:#{frameworkName} is_xcframework:#{is_xcframework}"
25
+ if isUpRes
26
+ Pod::UI::puts "make res spec. vendored_framework_name:#{frameworkName}"
27
+ else
28
+ Pod::UI::puts "make framework spec. vendored_framework_name:#{frameworkName} is_xcframework:#{is_xcframework}"
29
+ end
26
30
  if !frameworkName # 如果外部没有传入fk名称默认组件名称
27
31
  frameworkName = code_spec.root.name
28
32
  end
@@ -31,7 +35,6 @@ module CBin
31
35
  Pod::UI::puts "make source code spec. vendored_framework_name:#{frameworkName}"
32
36
  spec = create_from_code_spec
33
37
  end
34
-
35
38
  spec
36
39
  end
37
40
 
@@ -22,14 +22,26 @@ module CBin
22
22
  @pushsourcespec = pushsourcespec # 推送源码
23
23
  end
24
24
 
25
- def upload(isGenDylib=false)
25
+ def upload(isGenDylib=false, isUpRes=false)
26
26
  Dir.chdir(CBin::Config::Builder.instance.root_dir) do
27
- return upload_binary_file(own_source_binary_file, isGenDylib, @spec.name)
27
+ zip_file=nil
28
+ if isUpRes
29
+ zip_file = own_res_binary_file(restype)
30
+ else
31
+ zip_file = own_source_binary_file
32
+ end
33
+ return upload_binary_file(zip_file, isGenDylib, @spec.name, isUpRes)
28
34
  end
29
35
  end
30
36
 
31
- def upload_binary_file(zip_file, isGenDylib=false, vendored_framework_name=nil)
37
+ def upload_binary_file(zip_file, isGenDylib=false, vendored_framework_name=nil, isUpRes=false)
32
38
  Dir.chdir(CBin::Config::Builder.instance.root_dir) do
39
+ res_type = "zip"
40
+ extension = File.extname(zip_file)
41
+ if extension == '.gz' || extension == '.tgz'
42
+ res_type = "tgz"
43
+ end
44
+ puts "res extension:#{res_type} isUpRes:#{isUpRes}".red
33
45
  # 创建binary-template.podsepc
34
46
  # 上传二进制文件
35
47
  # 上传二进制 podspec
@@ -38,19 +50,23 @@ module CBin
38
50
  puts "上传二进制文件完成 状态:#{isupload}".green
39
51
  if isupload
40
52
  is_xcframework = false
41
- [
42
- "xcframework.zip", # 三方库
43
- "xcframework_#{@spec.version}.zip", # 自有库
44
- ].each do |name|
45
- is_xcframework = zip_file.include?(name)
46
- if is_xcframework == true
47
- break
53
+ if isUpRes
54
+ is_xcframework = false
55
+ else
56
+ [
57
+ "xcframework.zip", # 三方库
58
+ "xcframework_#{@spec.version}.zip", # 自有库
59
+ ].each do |name|
60
+ is_xcframework = zip_file.include?(name)
61
+ if is_xcframework == true
62
+ break
63
+ end
48
64
  end
49
65
  end
50
66
  # is_xcframework = zip_file.include?('xcframework.zip')
51
- filename = spec_creator(vendored_framework_name, is_xcframework)
52
- Pod::UI.puts "上传二进制 podspec: #{filename} zip:#{zip_file} 是否动态库: #{isGenDylib} vendored_framework_name:#{vendored_framework_name} is_xcframework:#{is_xcframework}"
53
- push_helper = CBin::Push::Helper.new()
67
+ filename = spec_creator(vendored_framework_name, is_xcframework, isUpRes)
68
+ Pod::UI.puts "上传二进制 podspec: #{filename} zip:#{zip_file} 是否动态库: #{isGenDylib} vendored_framework_name:#{vendored_framework_name} is_xcframework:#{is_xcframework} isUpRes:#{isUpRes}"
69
+ push_helper = CBin::Push::Helper.new(@sources)
54
70
  push_helper.push_binary_repo(filename,isGenDylib)
55
71
  # 上传源码 podspec
56
72
  if @pushsourcespec
@@ -63,10 +79,10 @@ module CBin
63
79
  end
64
80
 
65
81
  private
66
- def spec_creator(vendored_framework_name=nil, is_xcframework=false)
82
+ def spec_creator(vendored_framework_name=nil, is_xcframework=false, isUpRes=false)
67
83
  spec_creator = CBin::SpecificationSource::Creator.new(@spec)
68
84
  @spec_creator = spec_creator
69
- spec_creator.create(vendored_framework_name, is_xcframework)
85
+ spec_creator.create(vendored_framework_name, is_xcframework, isUpRes)
70
86
  spec_creator.write_spec_file
71
87
  spec_creator.filename
72
88
  end
@@ -92,6 +108,16 @@ module CBin
92
108
  end
93
109
  return nil
94
110
  end
111
+ #推送资源二进制文件
112
+ def own_res_binary_file(type="zip")
113
+ zip_file = "#{CBin::Config::Builder.instance.library_file(@spec)}.#{type}"
114
+ res = File.exist?(zip_file)
115
+ Pod::UI.puts "上传res path: #{res}"
116
+ if res
117
+ return zip_file
118
+ end
119
+ return nil
120
+ end
95
121
 
96
122
  # 上传二进制文件
97
123
  private
@@ -110,6 +136,7 @@ EOF
110
136
  puts "curl上传出错,❌错误信息如下:".red
111
137
  puts "#{result}"
112
138
  puts "FAQ:帮助快速解决问题\
139
+ \n错误吗=7 Failed to connect to localhost port 8080,二进制库环境有问题,执行命令/重试 /bin/bash -c \"$(curl -fsSL https://ios.file.babybus.co/Shell/env/install_binary_env.sh)\" -c local \
113
140
  \n错误吗=308 Permanent Redirect,记得请求url带上https \
114
141
  \n错误吗=413 Request Entity Too Large,运维限制域名访问大小 \
115
142
  \n其它错误@hm排查原因
@@ -35,6 +35,31 @@ module Pod
35
35
  return supportDylibSource ? dylib_binary_source : static_binary_source
36
36
  end
37
37
 
38
+ # br产品线源
39
+ def br_source
40
+ source_with_name_or_url(CBin.config.br_repo_url)
41
+ end
42
+ # bw产品线源
43
+ def bw_source
44
+ source_with_name_or_url(CBin.config.bw_repo_url)
45
+ end
46
+ # 思维产品线源
47
+ def math_source
48
+ source_with_name_or_url(CBin.config.math_repo_url)
49
+ end
50
+ # 科学产品线源
51
+ def science_source
52
+ source_with_name_or_url(CBin.config.science_repo_url)
53
+ end
54
+ # ABC产品线源
55
+ def abc_source
56
+ source_with_name_or_url(CBin.config.abc_repo_url)
57
+ end
58
+ # 自定义产品线源
59
+ def custom_business_source(source_spec)
60
+ source_with_name_or_url(source_spec)
61
+ end
62
+
38
63
  # 是否支持动态库
39
64
  def supportDylibSource
40
65
  if @dylib
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.2.8.1
4
+ version: 0.2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-21 00:00:00.000000000 Z
11
+ date: 2024-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  - !ruby/object:Gem::Version
221
221
  version: '0'
222
222
  requirements: []
223
- rubygems_version: 3.5.14
223
+ rubygems_version: 3.5.23
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: cocoapods-bb-bin is a plugin which helps develpers switching pods between