cocoapods-vbbuildsource 0.0.2 → 0.0.7

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
  SHA256:
3
- metadata.gz: 4cb0a2843d6354a15edb4c2b4a7521163938e58dc85d0258b34f2c6d1dce529e
4
- data.tar.gz: 1fd68295337dc3ad276282eaa5a2cb100fcf3d632995609c99af687fc7631eed
3
+ metadata.gz: e5148b5ba82eb4674ec9a26d3dc0b5d74ef179cfc6b49741af742da358cac735
4
+ data.tar.gz: a394049f02b7ed4268fb5f38034e5903d44376ff625c712cc2fe6baa4e5fce7c
5
5
  SHA512:
6
- metadata.gz: 4840af4daa453010e6f8cd635aed6f1d3967455cf7946ea225b4b50e243edd77ba686167780b4cc77b186a96fdc57ac370f06fc8481ee3b1cd1aa7d9d1674493
7
- data.tar.gz: 15427260291361cba7a0c4f222f72131b4f115ae55ffc33b9ad704311252cebd10a5436b8c076ba2b1d1d02b3f29ee68f4d2c828df6abfb2c65b52b99fe9f351
6
+ metadata.gz: 394956b24d2e83003e10baf78ab4786e03d34e5c85497737d4865bffda0dff04b979dd7cd84010cd6e42a2b31b3986d008f08a3984b014a42ff33359563a7ea9
7
+ data.tar.gz: 87bb12ac43058f8aea96d5b77725e5fcc2f589f15b13b94b8794eae3883826a426d6126dc5972c7fb5a91a826e32694f5035adb8ab8f71126efa854baf3e4077
data/Gemfile CHANGED
@@ -6,8 +6,4 @@ gemspec
6
6
  group :development do
7
7
  gem 'cocoapods', '1.10.0'
8
8
 
9
- gem 'mocha'
10
- gem 'bacon'
11
- gem 'mocha-on-bacon'
12
- gem 'prettybacon'
13
9
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-vbbuildsource (0.0.2)
4
+ cocoapods-vbbuildsource (0.0.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -18,7 +18,6 @@ GEM
18
18
  httpclient (~> 2.8, >= 2.8.3)
19
19
  json (>= 1.5.1)
20
20
  atomos (0.1.3)
21
- bacon (1.2.0)
22
21
  claide (1.0.3)
23
22
  cocoapods (1.10.0)
24
23
  addressable (~> 2.6)
@@ -71,15 +70,10 @@ GEM
71
70
  concurrent-ruby (~> 1.0)
72
71
  json (2.5.1)
73
72
  minitest (5.14.4)
74
- mocha (1.13.0)
75
- mocha-on-bacon (0.2.3)
76
- mocha (>= 0.13.0)
77
73
  molinillo (0.6.6)
78
74
  nanaimo (0.3.0)
79
75
  nap (1.1.0)
80
76
  netrc (0.11.0)
81
- prettybacon (0.0.2)
82
- bacon (~> 1.2)
83
77
  public_suffix (4.0.6)
84
78
  rake (13.0.6)
85
79
  rexml (3.2.5)
@@ -101,13 +95,9 @@ PLATFORMS
101
95
  ruby
102
96
 
103
97
  DEPENDENCIES
104
- bacon
105
98
  bundler (~> 1.3)
106
99
  cocoapods (= 1.10.0)
107
100
  cocoapods-vbbuildsource!
108
- mocha
109
- mocha-on-bacon
110
- prettybacon
111
101
  rake
112
102
 
113
103
  BUNDLED WITH
@@ -51,11 +51,17 @@ module Pod
51
51
 
52
52
  help! "该pod库 #{@module_name} 未找到" unless pod_target
53
53
 
54
- framework_file_path = pod_target.all_files.first
55
-
56
- framework_file_path = Pathname.new(framework_file_path) if framework_file_path.is_a? String
54
+ file_list = Array.new(pod_target.all_files.count) { |index|
55
+ file = pod_target.all_files[index]
56
+ if file.is_a? String
57
+ Pathname.new(file)
58
+ else
59
+ file
60
+ end
61
+ }
62
+ framework_file_path = file_list.detect {|each| each.extname.end_with? 'framework'}
57
63
 
58
- help! "该pod库 #{@module_name} 不是一个framework" unless pod_target.all_files.count == 1 and framework_file_path.extname.end_with? 'framework'
64
+ help! "该pod库 #{@module_name} 不是一个framework" unless framework_file_path
59
65
 
60
66
  binary_build_path = find_binary_build_path framework_file_path
61
67
 
@@ -82,8 +88,8 @@ module Pod
82
88
  binary_file_path = find_binary_file_in_framework framework_file_path
83
89
  help! "未找到库 #{@module_name} 的二进制文件" unless binary_file_path
84
90
  # 找到framework里面的某一个.h头文件的 DW_AT_decl_file 字段
85
- first_head_file = find_first_head_file_in_framework framework_file_path
86
- binary_build_path_string = `dwarfdump #{binary_file_path.to_path} | grep #{File.basename(first_head_file)} | grep 'DW_AT_decl_file'`.gsub!(/\s/, '')
91
+ binary_build_path_string = find_file_path_string_in_binary(framework_file_path,binary_file_path)
92
+ help! "未找到库 #{@module_name} 的二进制path路径" unless binary_build_path_string
87
93
  binary_build_path_list = binary_build_path_string.split('DW_AT_decl_file').delete_if(&:empty?).uniq
88
94
  # 删掉所有的括号引号
89
95
  binary_build_path_list = binary_build_path_list.each { |item| item.gsub!('("','').gsub!('")', '') }
@@ -124,13 +130,14 @@ module Pod
124
130
  return Pathname.new("#{framework_file_path.to_path}/#{framework_file_path.basename.to_path.gsub!('.framework', '')}")
125
131
  end
126
132
 
127
- def find_first_head_file_in_framework(framework_file_path, end_name='.h')
133
+ def find_file_path_string_in_binary(framework_file_path, binary_file_path)
128
134
  framework_file_path.children.collect do |child|
129
- if child.file? && child.extname.end_with?(end_name)
130
- return child
135
+ if child.file? && child.extname.end_with?('.h')
136
+ binary_build_path_string = `dwarfdump #{binary_file_path.to_path} | grep #{File.basename(child)} | grep 'DW_AT_decl_file'`.gsub!(/\s/, '')
137
+ return binary_build_path_string if binary_build_path_string
131
138
  elsif child.directory?
132
- filePath = find_first_head_file_in_framework child
133
- return filePath if filePath
139
+ binary_build_path_string = find_file_path_string_in_binary(child, binary_file_path)
140
+ return binary_build_path_string if binary_build_path_string
134
141
  end
135
142
  end
136
143
  return nil
@@ -147,7 +154,8 @@ module Pod
147
154
  end
148
155
  def find_spec_source_file_path specification
149
156
  source_path = specification.specification.attributes_hash['source_files']
150
- source_path = specification.specification.subspecs.first.attributes_hash['source_files']
157
+ source_path = specification.specification.subspecs.first.attributes_hash['source_files'] unless source_path
158
+ source_path = specification.specification.subspecs.first.attributes_hash['ios']['source_files'] unless source_path
151
159
  help! "该库 #{@module_name} 的spec文件没填 source_file,暂不支持" unless source_path
152
160
  dir_list = source_path.split('/')
153
161
  help! "源码路径错误 #{source_path}" unless dir_list.count >= 2
@@ -1,3 +1,3 @@
1
1
  module CocoapodsVbbuildsource
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-vbbuildsource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - faliu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-02 00:00:00.000000000 Z
11
+ date: 2021-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler