cocoapods-tdfire-binary 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77f5ba72a9ddd8d74b307cad072481ea4f0e1282
4
- data.tar.gz: 190b2307c266f0ea597697267a1f48d043ec2c44
3
+ metadata.gz: d8328e8ae8eaa871044cbb0532223f282d1f882f
4
+ data.tar.gz: d6378235a93ebb956a8ed486fd0f089aac2d1297
5
5
  SHA512:
6
- metadata.gz: 5ef9d0e540afae2ee4953c5fdac5b54de4c266c8907ea778a6bca0b84e7f9fd54c2e89b93dd41a35c125d32a4e5efc8742e99603a8e5d90f3db89093658f17ed
7
- data.tar.gz: e30c8ebe815e9c99f1d2987deaf4222dd2bae7afb883451b591d45ea4fc3a04ce4e10e7bf2203c86cafcfdcbb3101ad3686d46ba81dd10dfac498fb1b94c1f7e
6
+ metadata.gz: cb56e5c7c6176d9c4754c10318459a17ab27ea688c6c22a63fe03ce48838f4f849f1efab2bf35ec12f60c34a40ddd037066f2e77016466eae16110f6974ce108
7
+ data.tar.gz: df1a74d5402762726901609e32b1e8c5cbe0d4ad962a363e3f37ebad79cc2fc354d0f05ffaa19848cfac30ff66d588780c5c6402919633fcf441f06e4dcde6f1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-tdfire-binary (1.0.0)
4
+ cocoapods-tdfire-binary (1.0.3)
5
5
  cocoapods (~> 1.4)
6
6
  cocoapods-packager (~> 1.5.0)
7
7
 
@@ -21,6 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency 'bundler', '~> 1.3'
22
22
  spec.add_development_dependency 'rake', '~> 12.0'
23
23
 
24
- spec.add_dependency 'cocoapods', '~> 1.5'
24
+ spec.add_dependency 'cocoapods', '~> 1.4'
25
25
  spec.add_dependency 'cocoapods-packager', '~> 1.5.0'
26
26
  end
@@ -8,6 +8,7 @@ module Tdfire
8
8
  attr_reader :printed_pods
9
9
  attr_accessor :use_frameworks
10
10
  attr_accessor :use_source
11
+ attr_accessor :lib_lint_binary_pod
11
12
  end
12
13
 
13
14
  @use_source_pods = []
@@ -1,3 +1,5 @@
1
+ require 'cocoapods-tdfire-binary/binary_state_store'
2
+
1
3
  module Pod
2
4
  class Command
3
5
  class Binary < Command
@@ -8,9 +10,53 @@ module Pod
8
10
  对本地二进制进行 Lint
9
11
  DESC
10
12
 
11
- def run
12
-
13
- end
13
+ def self.options
14
+ [
15
+ ['--sources', '私有源地址'],
16
+ ['--clean', '执行成功后,删除 zip 文件外的所有生成文件'],
17
+ ].concat(super)
18
+ end
19
+
20
+ def initialize(argv)
21
+ @clean = argv.flag?('clean')
22
+ @sources = argv.option('sources')
23
+ @spec_file = first_podspec
24
+ @spec_name = @spec_file.split('/').last.split('.').first
25
+ unzip_framework
26
+ super
27
+ end
28
+
29
+ def validate!
30
+ super
31
+ help! '当前目录下没有podspec文件.' if @spec_file.nil?
32
+ framework = "#{@spec_name}.framework"
33
+ help! "当前目录下没有#{framework}文件" unless File.exist?(framework)
34
+ end
35
+
36
+ def unzip_framework
37
+ framework = "#{@spec_name}.framework"
38
+ zip_name = "#{framework}.zip"
39
+ if File.exist?(zip_name) && !File.exist?("#{@spec_name}.framework")
40
+ system "unzip #{zip_name}"
41
+ end
42
+ end
43
+
44
+ def run
45
+ Tdfire::BinaryStateStore.lib_lint_binary_pod = @spec_name
46
+
47
+ argvs = [
48
+ "--sources=#{@sources || Tdfire::BinaryUrlManager.private_cocoapods_url}",
49
+ '--allow-warnings',
50
+ '--use-libraries',
51
+ '--verbose'
52
+ ]
53
+
54
+ lint= Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
55
+ lint.validate!
56
+ lint.run
57
+
58
+ system "rm -fr #{@spec_name}.framework " if @clean
59
+ end
14
60
  end
15
61
  end
16
62
  end
@@ -66,7 +66,7 @@ module Pod
66
66
  FileUtils.rm_rf(b)
67
67
  end
68
68
  end
69
- end
69
+ end if File.exist? "#{framework_path}/Versions/A/Resources"
70
70
 
71
71
  output_name = "#{framework_name}.zip"
72
72
  UI.section("Tdfire: zip #{framework_path} ...") do
@@ -1,3 +1,3 @@
1
1
  module CocoapodsTdfireBinary
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -58,12 +58,13 @@ module Pod
58
58
  end
59
59
  end
60
60
 
61
+
61
62
  # 配置二进制文件下载、cache 住解压好的 framework
62
63
  def tdfire_set_binary_download_configurations
63
64
  tdfire_refactor.set_preserve_paths_with_reference_spec(tdfire_reference_spec)
64
65
 
65
66
  # 没有发布的pod,没有二进制版本,不进行下载配置
66
- return if !Tdfire::BinaryStateStore.force_use_binary? && Tdfire::BinaryStateStore.unpublished_pods.include?(root.name)
67
+ return if tdfire_should_skip_download?
67
68
 
68
69
  raise Pod::Informative, "You must invoke the method after setting name and version" if root.name.nil? || version.nil?
69
70
 
@@ -78,9 +79,15 @@ module Pod
78
79
  end
79
80
 
80
81
  def tdfire_use_source?
81
- (!Tdfire::BinaryStateStore.force_use_binary? &&
82
- (!Tdfire::BinaryStateStore.use_binary? || Tdfire::BinaryStateStore.real_use_source_pods.include?(root.name))) ||
83
- Tdfire::BinaryStateStore.force_use_source?
82
+ ((!Tdfire::BinaryStateStore.force_use_binary? &&
83
+ (!Tdfire::BinaryStateStore.use_binary? || Tdfire::BinaryStateStore.real_use_source_pods.include?(root.name))) ||
84
+ Tdfire::BinaryStateStore.force_use_source?) &&
85
+ (Tdfire::BinaryStateStore.lib_lint_binary_pod != root.name)
86
+ end
87
+
88
+ def tdfire_should_skip_download?
89
+ (!Tdfire::BinaryStateStore.force_use_binary? && Tdfire::BinaryStateStore.unpublished_pods.include?(root.name)) ||
90
+ (Tdfire::BinaryStateStore.lib_lint_binary_pod == root.name)
84
91
  end
85
92
  end
86
93
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-tdfire-binary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tripleCC
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.5'
47
+ version: '1.4'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.5'
54
+ version: '1.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: cocoapods-packager
57
57
  requirement: !ruby/object:Gem::Requirement