cocoapods-jsource 0.0.5 → 0.0.6

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: 8cf67858eeff4f5e88ac1cef95df1f64695b8505061f2e1dbfeb0774c58b82bc
4
- data.tar.gz: 3b0bf833fdc0027c4d15d5a31f955cf55ae922bcfead4384cabce9060ecd1787
3
+ metadata.gz: 6eeecb30b063be7b98e13e67bcaf2dcf8afe6216c2e2c8cb9ac340a227b9d40f
4
+ data.tar.gz: 7f4ca79756176dab296fc9e784b256effc33e77385cd6e60e9a62107fb745679
5
5
  SHA512:
6
- metadata.gz: e4e1db75164b5329d869ae0f298ea5fa9cbe5015f5ff8d43a675438373ada0945486c3baab2f98160059cfd347728999d69287ef232206e4b1d95c3a201bd516
7
- data.tar.gz: 392f0575a1b633ba16a252a4475876961613c9e8948f9f206b29b349fc2fc1e9e46f2b5b9841e1b468c5390caf242b4a6153bab394a4fe9dd7d3965ca67b7a16
6
+ metadata.gz: 851fc0bae0bd7723e1937d6a64697d1307e84f58399366353f2d74a0f33a753115898c3660ea3c84a48df9b700f8ab06d6a35c3a0281093261e81de433c7b332
7
+ data.tar.gz: 666b0d9de3eadad5f431c0990a543a931ac690c159f6b0f5f66d5ea03841fe8f00e11ee8f315958b334745c23cc6bf370d321877231755b4be9c89ade6afb1e1
data/.gemrc ADDED
File without changes
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://gems.ruby-china.com/"
1
+ source "https://gems.ruby-china.com"
2
2
 
3
3
  # Specify your gem's dependencies in cocoapods-jsource.gemspec
4
4
  gemspec
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-jsource (0.0.4)
4
+ cocoapods-jsource (0.0.6)
5
5
  cocoapods
6
6
 
7
7
  GEM
8
8
  remote: https://gems.ruby-china.com/
9
9
  specs:
10
- CFPropertyList (3.0.1)
10
+ CFPropertyList (3.0.2)
11
11
  activesupport (4.2.11.1)
12
12
  i18n (~> 0.7)
13
13
  minitest (~> 5.1)
@@ -19,10 +19,10 @@ GEM
19
19
  atomos (0.1.3)
20
20
  bacon (1.2.0)
21
21
  claide (1.0.3)
22
- cocoapods (1.8.4)
22
+ cocoapods (1.9.1)
23
23
  activesupport (>= 4.0.2, < 5)
24
24
  claide (>= 1.0.2, < 2.0)
25
- cocoapods-core (= 1.8.4)
25
+ cocoapods-core (= 1.9.1)
26
26
  cocoapods-deintegrate (>= 1.0.3, < 2.0)
27
27
  cocoapods-downloader (>= 1.2.2, < 2.0)
28
28
  cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -37,13 +37,15 @@ GEM
37
37
  molinillo (~> 0.6.6)
38
38
  nap (~> 1.0)
39
39
  ruby-macho (~> 1.4)
40
- xcodeproj (>= 1.11.1, < 2.0)
41
- cocoapods-core (1.8.4)
40
+ xcodeproj (>= 1.14.0, < 2.0)
41
+ cocoapods-core (1.9.1)
42
42
  activesupport (>= 4.0.2, < 6)
43
43
  algoliasearch (~> 1.0)
44
44
  concurrent-ruby (~> 1.1)
45
45
  fuzzy_match (~> 2.0.4)
46
46
  nap (~> 1.0)
47
+ netrc (~> 0.11)
48
+ typhoeus (~> 1.0)
47
49
  cocoapods-deintegrate (1.0.4)
48
50
  cocoapods-downloader (1.3.0)
49
51
  cocoapods-plugins (1.0.0)
@@ -55,17 +57,20 @@ GEM
55
57
  netrc (~> 0.11)
56
58
  cocoapods-try (1.1.0)
57
59
  colored2 (3.1.2)
58
- concurrent-ruby (1.1.5)
60
+ concurrent-ruby (1.1.6)
59
61
  escape (0.0.4)
62
+ ethon (0.12.0)
63
+ ffi (>= 1.3.0)
64
+ ffi (1.12.2)
60
65
  fourflusher (2.3.1)
61
66
  fuzzy_match (2.0.4)
62
67
  gh_inspector (1.1.3)
63
68
  httpclient (2.8.3)
64
69
  i18n (0.9.5)
65
70
  concurrent-ruby (~> 1.0)
66
- json (2.2.0)
67
- minitest (5.13.0)
68
- mocha (1.10.1)
71
+ json (2.3.0)
72
+ minitest (5.14.0)
73
+ mocha (1.11.2)
69
74
  mocha-on-bacon (0.2.3)
70
75
  mocha (>= 0.13.0)
71
76
  molinillo (0.6.6)
@@ -77,9 +82,11 @@ GEM
77
82
  rake (13.0.1)
78
83
  ruby-macho (1.4.0)
79
84
  thread_safe (0.3.6)
80
- tzinfo (1.2.5)
85
+ typhoeus (1.3.1)
86
+ ethon (>= 0.9.0)
87
+ tzinfo (1.2.7)
81
88
  thread_safe (~> 0.1)
82
- xcodeproj (1.13.0)
89
+ xcodeproj (1.16.0)
83
90
  CFPropertyList (>= 2.3.3, < 4.0)
84
91
  atomos (~> 0.1.3)
85
92
  claide (>= 1.0.2, < 2.0)
@@ -100,4 +107,4 @@ DEPENDENCIES
100
107
  rake
101
108
 
102
109
  BUNDLED WITH
103
- 1.16.3
110
+ 1.17.2
@@ -77,7 +77,12 @@ module Pod
77
77
 
78
78
  def download_component_to_path(component_name, version, source_path_hash={})
79
79
  source_path_hash.each do |binary_name, source_path|
80
- sandbox_path = source_path.split("Pods")[0] + "Pods"
80
+ if source_path.include?("Pods")
81
+ sandbox_path = source_path.split("Pods")[0] + "Pods"
82
+ else
83
+ sandbox_path = source_path.gsub(/\/#{component_name}$/,"")
84
+ end
85
+
81
86
  sandbox_component_path = "#{sandbox_path}/#{component_name}"
82
87
  binary_path = "#{sandbox_path}/#{binary_name}"
83
88
  if File.exist? sandbox_component_path
@@ -87,6 +92,7 @@ module Pod
87
92
  else
88
93
  UI.puts "downloading #{binary_name} #{version}"
89
94
  UI.puts "\t #{source_path.to_s}"
95
+ create_working_directory(sandbox_path)
90
96
  FileUtils.mkdir_p [binary_path] unless File.exist? binary_path
91
97
  sandbox = Sandbox.new(sandbox_path)
92
98
  spec = spec_with_name(component_name, version)
@@ -96,6 +102,12 @@ module Pod
96
102
  #installer.clean!
97
103
  # TODO validtarget
98
104
  # 改名
105
+ # 去掉framework
106
+ framework_path = "#{binary_path}/#{component_name}/Framework"
107
+ if File.directory?(framework_path)
108
+ UI.puts "正在清理无用资源:#{framework_path}"
109
+ `rm -rf #{framework_path}`
110
+ end
99
111
  if binary_name != component_name and File.exist? sandbox_component_path
100
112
  FileUtils.copy_entry(sandbox_component_path, binary_path) unless File.exist? binary_name
101
113
  end
@@ -147,12 +159,22 @@ module Pod
147
159
  #file_list = get_file_list path
148
160
  source_paths_hash.each do |binary_name, source_path_list|
149
161
  if source_path_list.length > 0
150
- dest_file_path = source_path_list[0].split("Pods")[0] + "Pods/#{binary_name}"
162
+ if source_path_list[0].include?("Pods")
163
+ dest_file_path = source_path_list[0].split("Pods")[0] + "Pods/#{binary_name}"
164
+ else
165
+ dest_file_path = file_path(source_path_list[0], component_name)
166
+ end
151
167
  UI.puts "copying #{binary_name} to #{dest_file_path}"
152
168
  end
153
169
  source_path_list.each do |dest_file_path|
154
- origin_file = dest_file_path.split("Pods/#{binary_name}")[-1]
155
- origin_file_path = path + origin_file
170
+ if dest_file_path.include?("/Pods/")
171
+ origin_file = dest_file_path.split("Pods/#{binary_name}")[-1]
172
+ origin_file_path = path + origin_file
173
+ else
174
+ tmp_path = file_path dest_file_path, component_name
175
+ origin_file = dest_file_path.gsub(tmp_path, "")
176
+ origin_file_path = path + "/#{origin_file}"
177
+ end
156
178
  if !File.exist? origin_file_path
157
179
  UI.warn "本地不存在#{origin_file_path}, 可能使用了虚拟subspec或者本地源码缓存有问题。推荐加上 --remote 参数"
158
180
  exit 1
@@ -177,6 +199,21 @@ module Pod
177
199
 
178
200
  end
179
201
 
202
+ def file_path(source_path, component_name)
203
+ tmp_list = source_path.split("#{component_name}/")
204
+ # if tmp_list.length == 4 and tmp_list[1] != "/"
205
+ # path = "#{tmp_list[0]}#{binary_name}#{tmp_list[1]}#{binary_name}"
206
+ # end
207
+ # if tmp_list.length == 5 and tmp_list[2] == "_binary/"
208
+ # path = source_paths[0].split(binary_name)[0] + "#{binary_name}/#{binary_name}"
209
+ # end
210
+ if tmp_list.length < 3
211
+ UI.puts "旧版本的不支持,请重新打二级制"
212
+ exit 1
213
+ end
214
+ path = source_path.gsub("#{component_name}/#{tmp_list[-1]}", "")
215
+ path
216
+ end
180
217
 
181
218
  def component_cache(component_name)
182
219
  if @cache_dict.has_key? component_name
@@ -206,10 +243,10 @@ module Pod
206
243
  end
207
244
 
208
245
 
209
- def unite_source_paths_hash(source_paths_hash)
246
+ def unite_source_paths_hash(source_paths_hash, component_name)
210
247
  source_path_hash = {}
211
248
  source_paths_hash.each do |binary_name, source_paths|
212
- source_path_hash[binary_name] = source_paths[0].split("Pods")[0] + "Pods/#{binary_name}" if source_paths.length > 0
249
+ source_path_hash[binary_name] = file_path(source_paths[0], component_name)
213
250
  end
214
251
  source_path_hash
215
252
  end
@@ -237,7 +274,7 @@ module Pod
237
274
  next
238
275
  end
239
276
  source_paths_hash = local_source_paths component_name, subspecs, source_paths_hash
240
- source_path_hash = unite_source_paths_hash source_paths_hash
277
+ source_path_hash = unite_source_paths_hash source_paths_hash, component_name
241
278
  if @remote
242
279
  # 需要把值合并。
243
280
  download_component_to_path component_name, version, source_path_hash
@@ -316,10 +353,10 @@ module Pod
316
353
  at_name_list = []
317
354
  if binary_name.to_s.end_with? libbinary_file_name
318
355
  # .a 文件
319
- at_name_list = `dwarfdump -arch x86_64 #{binary_path} | grep 'AT_name.*#{binary_name}'`.strip.split("\n").sort
356
+ at_name_list = `dwarfdump -arch x86_64 #{binary_path} | grep 'DW_AT_decl_file'`.strip.split("\n").sort
320
357
  else
321
358
  # framework 文件
322
- at_name_list = `dwarfdump -arch x86_64 #{binary_path} | grep 'DW_AT_name.*#{binary_name}'`.strip.split("\n").sort
359
+ at_name_list = `dwarfdump -arch x86_64 #{binary_path} | grep 'DW_AT_decl_file'`.strip.split("\n").sort
323
360
  end
324
361
  #if source_file.length == 0
325
362
  # UI.puts "在#{binary_path} 里没有找到合适的调试信息~"
@@ -327,16 +364,18 @@ module Pod
327
364
  #end
328
365
  source_list = []
329
366
  at_name_list.each do |tmp_source_path|
330
- if tmp_source_path.include?("Pods/#{binary_name}")
331
- source_path = tmp_source_path.strip.split("(\"")[-1].split("\")")[0]
332
- source_list << source_path if source_path.to_s.length > 0
333
- end
367
+ source_path = tmp_source_path.strip.split("(\"")[-1].split("\")")[0]
368
+ next if source_path.to_s.start_with?("/Applications/Xcode.app/Contents/Developer/Platforms/")
369
+ source_path = tmp_source_path.strip.split("(\"")[-1].split("\")")[0]
370
+ next unless source_path.to_s.include?("/../../")
371
+ source_path = File.expand_path(source_path)
372
+ source_list << source_path if source_path.to_s.length > 0 and not source_list.include?(source_path)
334
373
  end
335
374
  if source_list.length == 0
336
375
  UI.puts "#{component_name} 没有找到调试信息, 可能是早期打的组件。建议这个组件重新生成。"
337
376
  exit 1
338
377
  else
339
- source_path_hash[binary_name] = source_list
378
+ source_path_hash[binary_name] = source_list.sort
340
379
  end
341
380
  end
342
381
  source_path_hash
@@ -345,9 +384,13 @@ module Pod
345
384
 
346
385
  # 创建源码的存放的目录,可能需要root权限
347
386
  def create_working_directory(source_path)
348
- parent = source_path.split("T")[0]
349
- parent = File.expand_path(parent)
350
- return unless parent.length >0
387
+ # parent = File.dirname(source_path)
388
+ if not source_path.include? "/binary/"
389
+ UI.puts "旧版本的二进制不在支持,请通过keones重新打包"
390
+ exit 1
391
+ end
392
+ parent = source_path.split("/binary/")[0] + "/binary/"
393
+ return unless parent.length > 0
351
394
  return if Dir.exist? parent
352
395
  UI.puts "检测到没有源码目录,即将创建#{parent}目录"
353
396
  `sudo -S mkdir -p #{parent}`
@@ -100,7 +100,7 @@ module Pod
100
100
 
101
101
  def avaliable_dirs(file_path, dest_file_path)
102
102
  dir_list = []
103
- if file_path.to_s == dest_file_path.to_s
103
+ if "#{file_path.to_s}/" == dest_file_path.to_s
104
104
  return dir_list
105
105
  else
106
106
  parent_dir = File.dirname file_path
@@ -117,7 +117,7 @@ module Pod
117
117
  if subspec
118
118
  spec.subspecs.each do |subspec_spec|
119
119
  next unless subspec_spec.name == "#{component_name}/#{subspec}"
120
- source_files = "#{group.real_path}/#{subspec_spec.attributes_hash["source_files"]}"
120
+ source_files = "#{group.real_path}#{subspec_spec.attributes_hash["source_files"]}"
121
121
  tmp_files = Dir.glob (source_files)
122
122
  # 找到所有的文件夹
123
123
  tmp_files.each do |file_path|
@@ -1,3 +1,3 @@
1
1
  module CocoapodsJsource
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/test.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'xcodeproj'
2
2
  require 'cocoapods'
3
3
 
4
- `cd /Users/handa/Documents/lianjia/B/lianjia_im;pod jsource add flutter_boost`
4
+ `cd /Users/handa/Documents/lianjia/B/Lianjia_Alliance_Shell_Project;pod jsource add Lianjia_Alliance_User`
5
5
 
6
6
  #`cd /Users/handa/Downloads/Example;pod jsource clean LJRefresh --cache`
7
7
  #`cd /Users/handa/Documents/lianjia/C/lianjia_ios_platc;pod jsource add LJBaseToolKit`
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-jsource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - handa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-19 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".gemrc"
62
63
  - ".gitignore"
63
64
  - Gemfile
64
65
  - Gemfile.lock
@@ -98,8 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
99
  - !ruby/object:Gem::Version
99
100
  version: '0'
100
101
  requirements: []
101
- rubyforge_project:
102
- rubygems_version: 2.7.7
102
+ rubygems_version: 3.0.3
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Add source code debugging capabilities to binary.