cocoapods-bb-bin 0.2.0 → 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: 4926e04b2eaade743939e92c8de3707bdaf3444b06b9515aa45278b63c444df8
4
- data.tar.gz: 677d14354d6f11f34a30e956c515f9b9db5040076cdbf2902a71ed9ff3badd65
3
+ metadata.gz: 9c3db228010949a3ee9a1029358a1ed29026a1e2ac100ea2eae52afe9a0c0843
4
+ data.tar.gz: cf85159135d5e2f16a6cd025cc1bbcfce786becf639e239ed832145cc62d91aa
5
5
  SHA512:
6
- metadata.gz: bc1d214967a7056d24836d7162bc5140c771575f1a4f0c59f90b91a47d782ba506069fadb22c35cdf2f4b13a1d6aca9e63595c4c51b068836135a19b30795c0d
7
- data.tar.gz: c625ef1d42a31eef96e0f9fc492ddd21066dd59ff35d88a2529f227466ca533cdaf276dbecfe136870abc916e7448fc9dcc381ca958635174b7d8a3785b909ea
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
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
 
6
6
  module Pod
@@ -43,6 +43,8 @@ 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}"
46
48
  # 拷贝二进制spec到源码spec by hm 22/1/19
47
49
  `cp -fa #{file} #{sourceSpecFilePath}`
48
50
  end
@@ -57,7 +59,7 @@ module CBin
57
59
  end
58
60
  # 源码spec路径(指向二进制库)
59
61
  def sourceSpecFilePath
60
- @filename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.podspec.json"
62
+ @sourcefilename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.podspec.json"
61
63
  end
62
64
 
63
65
  private
@@ -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,7 +84,7 @@ 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",
@@ -87,12 +95,33 @@ EOF
87
95
  if @verbose
88
96
  argvs += ['--verbose']
89
97
  end
90
-
98
+ Pod::UI.message "上传二进制 argvs: #{argvs}"
91
99
  push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs))
92
100
  push.validate!
93
101
  push.run
94
102
  end
95
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
96
125
  end
97
126
  end
98
127
  end
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.0
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: 2022-01-19 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