cocoapods-privacy 0.2.1 → 0.2.2

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: 11b2bf9e6e9cd3c863067c2e4e4bcf9db70d734b2d3786dfba8c881dcdc58a16
4
- data.tar.gz: 4bf64cdce7e18acfef794f43a92371a2633bdcfae75d593a60c7c0e481975235
3
+ metadata.gz: aca165884812e22b5b99ff4220a5a87129f9b56f5940b95f32cea856418e8c32
4
+ data.tar.gz: fcfbee202add9d50cff29d74c5bf8b1558855daca7278905a25922d9674c40c0
5
5
  SHA512:
6
- metadata.gz: 228886b2f261e7850e7531ceecdd282fe483589f8abf014c3e27fa933cb652c941c7e50276d7d13f50487cd5e5d97d9c04c47bbc62bb110502e0f573ac59f410
7
- data.tar.gz: f2b7d99c39f6cd2e15f1943ac49fa6285595632fdef523504d973cb5e0f652daee9ace8bed17dc1652ae87a8b776c93b920272aae131796718004953aef2c6ee
6
+ metadata.gz: 3c61d2467300415d231fab11762e54c8a5e17ec7fb91f47af5f3aff9db72c85b30353d505354642e420513059bd7227bcb88a31f921d44929a9ba66150e626c7
7
+ data.tar.gz: 90718eb044f351c618a7a7c9490f156e010053083668aad75f31f6b5b7b95fca4142785193286b8b92008a3b7cc954b7724a7c1bc04a05786929ec290016aabb
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPrivacy
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -88,33 +88,29 @@ module Pod
88
88
  pod_folds = modules.map{ |spec|
89
89
  name = spec.name.split('/').first
90
90
  fold = File.join(@sandbox.root,name)
91
- if Dir.exist?(fold)
92
- fold
93
- else
94
- development_pods = @sandbox.development_pods
95
- if name && development_pods
96
- podspec_file_path = development_pods[name]
97
- if podspec_file_path && !podspec_file_path.empty?
98
- podspec_fold_path = File.dirname(podspec_file_path)
99
- source_files = spec.attributes_hash['source_files']
100
- if source_files && !source_files.empty?
101
- if source_files.is_a?(String) && !source_files.empty?
102
- development_folds << File.join(podspec_fold_path,source_files)
103
- elsif source_files.is_a?(Array)
104
- source_files.each do |file|
105
- development_folds << File.join(podspec_fold_path,file)
106
- end
107
- end
91
+ podspec_file_path_develop = validate_development_pods(name)
92
+ # 先验证是否是指向本地的组件(发现有的情况下 组件指向本地Pods 下依旧还是会有该组件,所以这里先判断本地的)
93
+ if podspec_file_path_develop
94
+ podspec_fold_path = File.dirname(podspec_file_path_develop)
95
+ source_files = spec.attributes_hash['source_files']
96
+ if source_files && !source_files.empty?
97
+ if source_files.is_a?(String) && !source_files.empty?
98
+ development_folds << File.join(podspec_fold_path,source_files)
99
+ elsif source_files.is_a?(Array)
100
+ source_files.each do |file|
101
+ development_folds << File.join(podspec_fold_path,file)
108
102
  end
109
103
  end
110
104
  end
111
105
  nil
106
+ elsif Dir.exist?(fold)
107
+ formatter_search_fold(fold)
112
108
  end
113
109
  }.compact
114
110
 
115
111
 
116
112
  pod_folds += development_folds # 拼接本地调试和远端的pod目录
117
- pod_folds += [PrivacyUtils.project_code_fold].compact # 拼接工程同名主目录
113
+ pod_folds += [formatter_search_fold(PrivacyUtils.project_code_fold)].compact # 拼接工程同名主目录
118
114
  pod_folds += custom_folds || [] # 拼接外部传入的自定义目录
119
115
  pod_folds = pod_folds.uniq # 去重
120
116
 
@@ -126,5 +122,22 @@ module Pod
126
122
  end
127
123
  puts "👆👆👆👆👆👆 End analysis project privacy 👆👆👆👆👆👆"
128
124
  end
125
+
126
+ private
127
+ def formatter_search_fold(fold)
128
+ File.join(fold,"**","*.{m,c,swift,mm,hap,hpp,cpp}")
129
+ end
130
+
131
+ def validate_development_pods(name)
132
+ result = nil
133
+ development_pods = @sandbox.development_pods
134
+ if name && !name.empty? development_pods && !development_pods.empty?
135
+ podspec_file_path = development_pods[name]
136
+ if podspec_file_path && !podspec_file_path.empty?
137
+ result = podspec_file_path
138
+ end
139
+ end
140
+ result
141
+ end
129
142
  end
130
143
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-privacy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - youhui