cocoapods-dev-env 2.0.1 → 2.0.2
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 +4 -4
- data/lib/cocoapods/dev/env/version.rb +1 -1
- data/lib/cocoapods_plugin.rb +49 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87f011b42c1df26a04c8ac866532a91eef0f0d7e1d854bf97e369714107c0844
|
4
|
+
data.tar.gz: 9befa3b3fe9f53aa5adbd201be02fa44d33ff48b56bada40c433e90235706f0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2e9238b1dfb6dad9ce583adb3b9cd61bf7744e91e376dd51dfd7a516d2cbe1c8f95b2469a212c41d4b1f9cbb4be9f915f9ccb0d0b2055f52ff140fa23fe069
|
7
|
+
data.tar.gz: 7d30f8dd72ef7bc78625f144e5fdd517c10f55ffec6c6985ae00fe9023673d3c6132f8cca17908f350c2bf15e55845769c684c606d729a2932ed2f5073c69f03
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -32,6 +32,7 @@ module Pod
|
|
32
32
|
class Podfile
|
33
33
|
class TargetDefinition
|
34
34
|
attr_reader :binary_repo_url
|
35
|
+
attr_reader :binary_source
|
35
36
|
|
36
37
|
def searchAndOpenLocalExample(path)
|
37
38
|
_currentDir = Dir.pwd
|
@@ -175,6 +176,7 @@ class Podfile
|
|
175
176
|
UI.puts "💔 切换版本号的版本现在为空,无法设置版本号".yellow
|
176
177
|
return
|
177
178
|
end
|
179
|
+
newVersion = get_pure_version(newVersion)
|
178
180
|
specName = name + ".podspec"
|
179
181
|
FileProcesserManager.new(specName,
|
180
182
|
[
|
@@ -206,7 +208,7 @@ class Podfile
|
|
206
208
|
|
207
209
|
deal_dev_env_with_options(dev_env, options, pod_name, name, requirements)
|
208
210
|
if dev_env != 'dev'
|
209
|
-
|
211
|
+
binary_processer(dev_env, pod_name, use_binary, options, requirements)
|
210
212
|
end
|
211
213
|
|
212
214
|
|
@@ -374,7 +376,7 @@ class Podfile
|
|
374
376
|
checkAndRemoveSubmodule(path)
|
375
377
|
end
|
376
378
|
if requirements.length < 2
|
377
|
-
requirements.insert(0, "#{tag}")
|
379
|
+
requirements.insert(0, "#{get_pure_version(tag)}")
|
378
380
|
end
|
379
381
|
UI.message "enabled #{"release".green}-mode for #{pod_name.green}"
|
380
382
|
else
|
@@ -382,27 +384,50 @@ class Podfile
|
|
382
384
|
end
|
383
385
|
end
|
384
386
|
|
385
|
-
def
|
387
|
+
def binary_processer(dev_env, pod_name, use_binary, options, requirements)
|
386
388
|
if use_binary && use_binary == true
|
387
|
-
options
|
388
|
-
|
389
|
-
|
390
|
-
|
389
|
+
if options[:tag] != nil
|
390
|
+
begin
|
391
|
+
version = get_pure_version(options[:tag])
|
392
|
+
spec = binary_source.specification_path(pod_name, Version.new(version))
|
393
|
+
if spec
|
394
|
+
if requirements.length < 2
|
395
|
+
options.delete(:git)
|
396
|
+
options.delete(:path)
|
397
|
+
options.delete(:tag)
|
398
|
+
options[:source] = binary_repo_url
|
399
|
+
requirements.insert(0, "#{version}")
|
400
|
+
else
|
401
|
+
UI.puts "pod '#{pod_name}' :tag => #{options[:tag]} version: #{version} 对应的版本,但是已经标记版本号#{requirements}, 不知道用哪个".red
|
402
|
+
end
|
403
|
+
else
|
404
|
+
UI.puts "pod '#{pod_name}' :tag => #{options[:tag]} version: #{version} 没有找到: tag 对应的版本".red
|
405
|
+
end
|
406
|
+
rescue => exception
|
407
|
+
UI.puts "pod '#{pod_name}' :tag => #{options[:tag]} version: #{version} 没有找到: tag 对应的版本".red
|
408
|
+
else
|
409
|
+
|
410
|
+
end
|
411
|
+
else
|
412
|
+
options.delete(:git)
|
413
|
+
options.delete(:path)
|
414
|
+
options.delete(:tag)
|
415
|
+
options[:source] = binary_repo_url
|
416
|
+
end
|
417
|
+
|
391
418
|
else
|
392
419
|
if options[:source] == nil
|
393
420
|
begin
|
394
421
|
sources = find_pod_repos(pod_name).sources.select{|item| item.url.downcase != binary_repo_url.downcase } if options.empty?
|
395
422
|
if sources != nil
|
396
423
|
if sources.length >= 2
|
397
|
-
|
424
|
+
UI.puts "#{pod_name.green} 有多个source #{sources}".yellow
|
398
425
|
source_url = sources.detect{|item| item.url.downcase != Pod::TrunkSource::TRUNK_REPO_URL.downcase && item.url.downcase != "https://github.com/CocoaPods/Specs.git".downcase}.url
|
399
426
|
else
|
400
427
|
source_url = sources.first.url
|
401
428
|
end
|
402
429
|
end
|
403
430
|
options[:source] = source_url if source_url != nil
|
404
|
-
UI.puts "#{pod_name} :source=> #{options[:source]} by cocoapods-dev-env".yellow if options[:source] != nil
|
405
|
-
|
406
431
|
rescue => exception
|
407
432
|
UI.puts "#{pod_name} exception:#{exception}".red
|
408
433
|
else
|
@@ -410,6 +435,9 @@ class Podfile
|
|
410
435
|
end
|
411
436
|
end
|
412
437
|
end
|
438
|
+
UI.puts "#{pod_name.green} :source=> #{options[:source].green} by cocoapods-dev-env" if options[:source] != nil
|
439
|
+
UI.message "#{pod_name.yellow} options #{options} by cocoapods-dev-env" if options[:source] != nil
|
440
|
+
UI.message "#{pod_name.yellow} requirements #{requirements} by cocoapods-dev-env" if options[:source] != nil
|
413
441
|
end
|
414
442
|
|
415
443
|
def binary_repo_url
|
@@ -419,6 +447,17 @@ class Podfile
|
|
419
447
|
return @binary_repo_url
|
420
448
|
end
|
421
449
|
|
450
|
+
def binary_source
|
451
|
+
if @binary_source == nil
|
452
|
+
@binary_source = Pod::Config.instance.sources_manager.all.detect{|item| item.url.downcase == binary_repo_url.downcase}
|
453
|
+
end
|
454
|
+
return @binary_source
|
455
|
+
end
|
456
|
+
|
457
|
+
def get_pure_version(version)
|
458
|
+
return version.split.last.scan(/\d+/).join('.')
|
459
|
+
end
|
460
|
+
|
422
461
|
def find_pod_repos(pod_name) #等同pod search
|
423
462
|
sets = Pod::Config.instance.sources_manager.search_by_name(pod_name)
|
424
463
|
if sets.count == 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-dev-env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 吴锡苗
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: luna-binary-uploader
|