cocoapods-tdf-bin 0.0.1.1 → 0.0.15

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: 7850a7e2d211d7344509a463662379d0acac9264c8440ea731748e8d20d2f299
4
- data.tar.gz: f7e4d843eeded01faaf453bf7eb35f508b1276a8cc6f6bfb781e69f91fd1caf5
3
+ metadata.gz: 86a91d0128afbce92cb49c569930af615972ff11440d4272345e0a077a6a1fa1
4
+ data.tar.gz: 01c470b5ac5dc999e4a3abcbd8cb39f355780358f4a738de7e053156a0d26b3c
5
5
  SHA512:
6
- metadata.gz: 8c995c6ab6503da88f17112b348b12c8192f0eefcc550cbca09f105fcdd54ddff9460a17e92342663a30a4198db858eae4501a613e6d0e8ca6c8ba02b78e6f5e
7
- data.tar.gz: 5337c1c8554e26487807d1bbfa2a1abc2d29e8ec4dae195aedc9d208c702a4693b0404b09243cf16c4aef8f63abd85fb66f18b61c354257a1723b2448a0ce380
6
+ metadata.gz: 2d450a0cd70705f4a4603bf64e40313c3c2ca1015aa9dc39fa24d2c1e069f594812cfdb48a9c228cc0605e126c00264a578171f33afb075ccb068fae1517d7c0
7
+ data.tar.gz: 40eb0a9bb0963bf0b1009d00f82c30c68104542d8a55a739e626a7da2fb42b441af52485e30f5b4ba727780cab78ff7cb7dd17b17bcaed519af14adcba58263b
@@ -50,6 +50,7 @@ module Pod
50
50
  @additional_args = argv.remainder!
51
51
 
52
52
  Pod::Resolver.build_dependencies_only_build(@only_build)
53
+ Pod::Resolver.build_dependencies_bin(true)
53
54
 
54
55
  super
55
56
  end
@@ -12,10 +12,10 @@ module CBin
12
12
  def template_hash
13
13
  {
14
14
  'configuration_env' => { description: '编译环境', default: 'dev', selection: %w[dev debug_iphoneos release_iphoneos] },
15
- 'code_repo_url' => { description: '源码私有源 Git 地址', default: 'git@github.com:su350380433/example_spec_source.git' },
16
- 'binary_repo_url' => { description: '二进制私有源 Git 地址', default: 'git@github.com:su350380433/example_spec_bin_dev.git' },
17
- 'binary_download_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http://localhost:8080/download/%s/%s/zip' },
18
- 'binary_upload_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http://localhost:8080/upload/%s/%s/zip' },
15
+ 'code_repo_url' => { description: '源码私有源 Git 地址', default: 'git@git.2dfire.net:ios/cocoapods-spec.git' },
16
+ 'binary_repo_url' => { description: '二进制私有源 Git 地址', default: 'git@git.2dfire.net:ios/cocoapods-spec-binary.git' },
17
+ 'binary_download_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http://iosframeworkserver-shopkeeperclient.app.2dfire.com/download/%s/%s.zip' },
18
+ 'binary_upload_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http://iosframeworkserver-shopkeeperclient.app.2dfire.com/upload/%s/%s.zip' },
19
19
  # 'binary_type' => { description: '二进制打包类型', default: 'framework', selection: %w[framework library] },
20
20
  'download_file_type' => { description: '下载二进制文件类型', default: 'zip', selection: %w[zip tgz tar tbz txz dmg] }
21
21
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.0.1.1'
3
+ VERSION = '0.0.15'
4
4
  end
5
5
 
6
6
  module Pod
@@ -258,8 +258,17 @@ module CBin
258
258
  resources.each do |source|
259
259
  escape_resource << Shellwords.join(source)
260
260
  end
261
- UI.message "Copying resources #{escape_resource}"
262
- `cp -rp #{escape_resource.join(' ')} #{resource_target_dir}`
261
+
262
+ escape_resource_str = escape_resource.join(' ')
263
+ escape_resource_arr = escape_resource_str.split(' ')
264
+
265
+ escape_resource_arr = escape_resource_arr.select do | source |
266
+ suffix = File.extname(source)
267
+ not expand_suffix(suffix)
268
+ end
269
+
270
+ UI.message "Copying resources #{escape_resource_arr}"
271
+ `cp -rp #{escape_resource_arr.join(' ')} #{resource_target_dir}`
263
272
  end
264
273
  end
265
274
 
@@ -269,6 +278,17 @@ module CBin
269
278
  end
270
279
  end
271
280
 
281
+ def expand_suffix(suffix)
282
+ case suffix
283
+ when '.storyboard' then true
284
+ when '.xib' then true
285
+ when '.xcdatamodel' then true
286
+ when '.xcdatamodeld' then true
287
+ when '.xcmappingmodel' then true
288
+ else false
289
+ end
290
+ end
291
+
272
292
  def framework
273
293
  @framework ||= begin
274
294
  framework = Framework.new(@spec.name, @platform.name.to_s)
@@ -119,8 +119,6 @@ module CBin
119
119
 
120
120
  @spec.resources = binary_resources if @spec.attributes_hash.keys.include?("resources")
121
121
 
122
-
123
-
124
122
  @spec
125
123
  end
126
124
 
@@ -133,7 +131,7 @@ module CBin
133
131
  end
134
132
 
135
133
  def framework_contents(name)
136
- ["#{code_spec.root.name}.framework", "#{code_spec.root.name}.framework/Versions/A"].map { |path| "#{path}/#{name}" }
134
+ ["#{code_spec.root.name}.framework"].map { |path| "#{path}/#{name}" }
137
135
  end
138
136
 
139
137
  def binary_source_files
@@ -140,8 +140,15 @@ module CBin
140
140
  if code_spec_consumer.resources.any?
141
141
  extnames += code_spec_consumer.resources.map { |r| File.basename(r) }
142
142
  end
143
+
144
+ extnames = extnames.select do | extname |
145
+ not expand_suffix(extname)
146
+ end
147
+
143
148
  if extnames.any?
144
- @spec.resources = framework_contents('Resources').flat_map { |r| extnames.map { |e| "#{r}/#{e}" } }
149
+ resources = framework_contents('Resources').flat_map { |r| extnames.map { |e| "#{r}/#{e}" } }
150
+ resources << "#{code_spec.root.name}.framework/*.{storyboardc,nib,mom,momd,cdm}"
151
+ @spec.resources = resources
145
152
  end
146
153
 
147
154
  # Source Location
@@ -182,6 +189,16 @@ module CBin
182
189
  @spec
183
190
  end
184
191
 
192
+ def expand_suffix(suffix)
193
+ if suffix.end_with?('.storyboard') ||
194
+ suffix.end_with?('.xib') ||
195
+ suffix.end_with?('.xcdatamodel') ||
196
+ suffix.end_with?('.xcdatamodeld') ||
197
+ suffix.end_with?('.xcmappingmodel')
198
+ return true
199
+ end
200
+ false
201
+ end
185
202
 
186
203
  def binary_source
187
204
  { http: format(CBin.config.binary_download_url, code_spec.root.name, code_spec.version), type: CBin.config.download_file_type }
@@ -192,7 +209,6 @@ module CBin
192
209
  end
193
210
 
194
211
  def framework_contents(name)
195
- # ["#{code_spec.root.name}.framework", "#{code_spec.root.name}.framework/Versions/A"].map { |path| "#{path}/#{name}" }
196
212
  ["#{code_spec.root.name}.framework"].map { |path| "#{path}/#{name}" }
197
213
  end
198
214
 
@@ -10,6 +10,13 @@ require 'cocoapods-tdf-bin/command/bin/archive'
10
10
 
11
11
  module Pod
12
12
  class Resolver
13
+
14
+ # 仅仅只是编译出产物,不上传
15
+ @@build_dependencies_only_build = false
16
+
17
+ # 是否是在进行二进制打包处理,没有的话一些步奏需要省略掉
18
+ @@build_dependencies_bin = false
19
+
13
20
  if Pod.match_version?('~> 1.6')
14
21
  # 其实不用到 resolver_specs_by_target 再改 spec
15
22
  # 在这个方法里面,通过修改 dependency 的 source 应该也可以
@@ -94,6 +101,11 @@ module Pod
94
101
  def Resolver.build_dependencies_only_build(only_build)
95
102
  @@build_dependencies_only_build = only_build
96
103
  end
104
+
105
+ def Resolver.build_dependencies_bin(bin)
106
+ @@build_dependencies_bin = bin
107
+ end
108
+
97
109
  end
98
110
 
99
111
  # >= 1.4.0 才有 resolver_specs_by_target 以及 ResolverSpecification
@@ -135,8 +147,11 @@ module Pod
135
147
  source = use_binary ? sources_manager.binary_source : sources_manager.code_source
136
148
 
137
149
  spec_version = rspec.spec.version
138
- UI.message 'cocoapods-tdf-bin 插件'
139
- UI.message "- 开始处理 #{rspec.spec.name} #{spec_version} 组件."
150
+
151
+ if use_binary
152
+ UI.message 'cocoapods-tdf-bin 插件'
153
+ UI.message "- 开始处理 #{rspec.spec.name} #{spec_version} 组件."
154
+ end
140
155
 
141
156
  if @@build_dependencies_only_build
142
157
  missing_binary_specs << rspec.spec
@@ -160,15 +175,12 @@ module Pod
160
175
  end
161
176
  # used_by_only = rspec.respond_to?(:used_by_tests_only) ? rspec.used_by_tests_only : rspec.used_by_non_library_targets_only
162
177
  # 组装新的 rspec ,替换原 rspec
163
- if use_binary
164
- rspec = if Pod.match_version?('~> 1.4.0')
165
- ResolverSpecification.new(specification, used_by_only)
166
- else
167
- ResolverSpecification.new(specification, used_by_only, source)
168
- end
169
- UI.message "组装新的 rspec ,替换原 rspec #{rspec.root.name} #{spec_version} \r\n specification =#{specification} \r\n #{rspec} "
170
-
171
- end
178
+ rspec = if Pod.match_version?('~> 1.4.0')
179
+ ResolverSpecification.new(specification, used_by_only)
180
+ else
181
+ ResolverSpecification.new(specification, used_by_only, source)
182
+ end
183
+ UI.message "组装新的 rspec ,替换原 rspec #{rspec.root.name} #{spec_version} \r\n specification =#{specification} \r\n #{rspec} "
172
184
 
173
185
  rescue Pod::StandardError => e
174
186
  # 没有从新的 source 找到对应版本组件,直接返回原 rspec
@@ -183,6 +195,10 @@ module Pod
183
195
  end.compact
184
196
  end
185
197
 
198
+ unless @@build_dependencies_bin
199
+ return specs_by_target
200
+ end
201
+
186
202
  if missing_binary_specs.any?
187
203
  missing_binary_specs.uniq.each do |spec|
188
204
  UI.message "【#{spec.name} | #{spec.version}】组件无对应二进制版本 , 将采用源码依赖."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-tdf-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.1
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - gaijiaofan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-07 00:00:00.000000000 Z
11
+ date: 2021-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel