cocoapods-bb-bin 0.2.9.0 → 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: 8cc0ab50509e17f48d29a81ccf19a46f2dc332b4efc0d035a13023106366424f
4
- data.tar.gz: d7211405407238227f83864a8c24148889730bcf226e00f50dfa7526d9204e26
3
+ metadata.gz: 6fce318ef901fcad220462267c7b775a896a713d64b709ea17dcb25fda700e81
4
+ data.tar.gz: 558223276cae0cdb2c17d46c28860b5710d5c43495a7d1e0e03c2602f79aca1b
5
5
  SHA512:
6
- metadata.gz: 71bb50eca6908d30e199bbe4a4c65e1c86db0b9e3e470417626f8d6a56a192567f05687051ef79137a058f38e4398d9fbe53efb2ecb88dce4aa6ab2130573685
7
- data.tar.gz: ed760852033d74d21498c5c671ef66136e890bdd53976b93bb32eb02f058d0e345ea754b59c46be14ce43493c6fb6ddbe3812cd0c20a919c15b12c895887524b
6
+ metadata.gz: 754e5f52ac96ddf65d2e66a3f3ff1cf1c48703d8718e90ef65b5297693103b88acd8a9019c2070397f8e961327d4ae2fcfa0d29f942fb3974ad1387564c8b835
7
+ data.tar.gz: 185d627c29158d5449769975f2bbec760da7ed7212bed6331c1751c81cff707ef468c5be2fffc15d057ea344961542b164c8366759870892402b0876ede59b2a
@@ -24,6 +24,7 @@ module Pod
24
24
  ['--dylib', '(可选)是否动态库,默认静态库'],
25
25
  ['--developer_mode', '(可选)是否开发者模式,默认发布模式'],
26
26
  ['--upload_res', '(可选)是否上传资源文件,格式:zip、tgz'],
27
+ ['--only_business_spec', '(可选)仅仅上传到业务线专属spec,需要配合sources一起使用'],
27
28
  ].concat(Pod::Command::Gen.options).concat(super).uniq
28
29
  end
29
30
 
@@ -43,6 +44,8 @@ module Pod
43
44
  @is_dev_model = argv.flag?('developer_mode', false )
44
45
  # 上传资源
45
46
  @is_up_res = argv.flag?('upload_res', false )
47
+ # 上传到业务线专属spec
48
+ @only_business_spec = argv.flag?('only_business_spec', false )
46
49
  end
47
50
  super
48
51
  end
@@ -75,9 +78,11 @@ module Pod
75
78
  sources_sepc << @spec
76
79
 
77
80
  fail_push_specs = []
81
+ pushsourcespec = hasUploadSourceCodeSpec # 是否需要上传源码spec
78
82
  sources_sepc.uniq.each do |spec|
79
83
  begin
80
- fail_push_specs << spec unless CBin::Upload::Helper.new(spec,true,@sources,true).upload_binary_file(localPath, @is_dylib, @vendored_framework_name, @is_up_res)
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)
81
86
  rescue Object => exception
82
87
  UI.puts exception
83
88
  fail_push_specs << spec
@@ -151,6 +156,17 @@ module Pod
151
156
  return new_version
152
157
  end
153
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
+
154
170
  end
155
171
  end
156
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.9.0'
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
@@ -66,7 +66,7 @@ module CBin
66
66
  # is_xcframework = zip_file.include?('xcframework.zip')
67
67
  filename = spec_creator(vendored_framework_name, is_xcframework, isUpRes)
68
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()
69
+ push_helper = CBin::Push::Helper.new(@sources)
70
70
  push_helper.push_binary_repo(filename,isGenDylib)
71
71
  # 上传源码 podspec
72
72
  if @pushsourcespec
@@ -136,6 +136,7 @@ EOF
136
136
  puts "curl上传出错,❌错误信息如下:".red
137
137
  puts "#{result}"
138
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 \
139
140
  \n错误吗=308 Permanent Redirect,记得请求url带上https \
140
141
  \n错误吗=413 Request Entity Too Large,运维限制域名访问大小 \
141
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.9.0
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-10-10 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.20
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