cocoapods-cafswitcher 0.0.23 → 0.0.24
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b914e51d70ab8f4c673a9bc4265217530e571af68a11618788609f6b4293bdf
|
4
|
+
data.tar.gz: d167d17a0c93504b734398163946cb32ad401724b29918e3dedeb2fc375ea01f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b5b2afac7a88114d1a19bd9dc566abd14716e140726b915acda1992511b49e7036b32152d66f9681840701965a8eccbe9456895581ad01fd432bb696a035728
|
7
|
+
data.tar.gz: f933357fd7bc46b6f42d7a4a79b9b41d3e64ff1350606d4b0e1bad56eacec27aa610a10229141996db3c37c73c4cd123a4d14cf6b3e89620247711cacd12fdac
|
@@ -120,6 +120,7 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
120
120
|
Pod::Podfile.frameworkList.clear()
|
121
121
|
Pod::Podfile.debugPackageList.clear()
|
122
122
|
Pod::Podfile.releasePackageList.clear()
|
123
|
+
Pod::Podfile.unspecifiedList.clear()
|
123
124
|
|
124
125
|
Pod::Podfile.sourceList.concat(sourceList)
|
125
126
|
Pod::Podfile.frameworkList.concat(frameworkList)
|
@@ -198,32 +199,33 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
198
199
|
changedPods.uniq!
|
199
200
|
Pod::UI.puts "\nchanged Pod is:\n " + changedPods.to_s + "\n" unless changedPods.empty?
|
200
201
|
|
201
|
-
|
202
|
+
gitPathList.each do |gitPathSubPod|
|
203
|
+
changedSubPods << gitPathSubPod
|
204
|
+
end
|
205
|
+
changedSubPods.uniq!
|
206
|
+
|
207
|
+
cleanPodsDir(changedSubPods)
|
208
|
+
# cleanCocoapodsCache(gitPathList)
|
202
209
|
|
203
210
|
# 把新的配置写入file
|
204
211
|
File.open(configFile, 'wb') {|f| YAML.dump(caf_hash, f) } unless changedSubPods.empty?
|
205
212
|
end
|
206
213
|
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
changedSubPods.each do |changedSubPod|
|
214
|
-
changedPod = changedSubPod.split('/')[0]
|
215
|
-
|
216
|
-
# 清除本地的localFile 的JSON
|
217
|
-
localspecPath = podRoot + "Local Podspecs/" + "#{changedPod}.podspec.json"
|
218
|
-
if localspecPath.exist?
|
219
|
-
Pod::UI.message "Removing local Podspecs.json #{localspecPath}"
|
220
|
-
FileUtils.rm_r(localspecPath)
|
221
|
-
end
|
214
|
+
def cleanCocoapodsCache(gitPathList)
|
215
|
+
cachePath = Pod::Config.instance.cache_root + 'Pods'
|
216
|
+
@cache = Pod::Downloader::Cache.new(cachePath)
|
217
|
+
gitPathList.each do |gitPathSubPod|
|
218
|
+
gitPathPod = gitPathSubPod.split('/')[0]
|
219
|
+
cache_descriptors = @cache.cache_descriptors_per_pod[gitPathPod]
|
222
220
|
# 清空缓存,因为缓存里有podspec.json
|
223
|
-
cache_descriptors = @cache.cache_descriptors_per_pod[changedPod]
|
224
221
|
if cache_descriptors
|
225
222
|
# TODO 检查changedSubPod
|
226
223
|
cache_descriptors.each do |desc|
|
224
|
+
specs_dir = cachePath + 'Specs'
|
225
|
+
release_specs_dir = specs_dir + 'Release'
|
226
|
+
if desc[:spec_file].include?(release_specs_dir)
|
227
|
+
continue
|
228
|
+
end
|
227
229
|
Pod::UI.message("Removing spec #{desc[:spec_file]} (v#{desc[:version]})") do
|
228
230
|
FileUtils.rm desc[:spec_file]
|
229
231
|
end
|
@@ -232,6 +234,22 @@ def clean(changedSubPods)
|
|
232
234
|
# end
|
233
235
|
end
|
234
236
|
end
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
240
|
+
|
241
|
+
def cleanPodsDir(changedSubPods)
|
242
|
+
config = Pod::Config.instance
|
243
|
+
# 根据不同删除cache
|
244
|
+
podRoot = config.project_pods_root
|
245
|
+
changedSubPods.each do |changedSubPod|
|
246
|
+
changedPod = changedSubPod.split('/')[0]
|
247
|
+
# 清除本地的localFile 的JSON
|
248
|
+
localspecPath = podRoot + "Local Podspecs/" + "#{changedPod}.podspec.json"
|
249
|
+
if localspecPath.exist?
|
250
|
+
Pod::UI.message "Removing local Podspecs.json #{localspecPath}"
|
251
|
+
FileUtils.rm_r(localspecPath)
|
252
|
+
end
|
235
253
|
# next unless changedSubPod =~ /^(?i)LJ/ || changedSubPod =~ /^(?i)Lianjia/ || changedSubPod.include?('/')
|
236
254
|
# 清除目录 pods 文件夹下的缓存
|
237
255
|
changedPodPath = podRoot + changedPod
|
@@ -90,9 +90,12 @@ module Pod
|
|
90
90
|
|
91
91
|
def parse_source_framework_key(name, requirements)
|
92
92
|
options = requirements.last
|
93
|
-
|
94
|
-
|
95
|
-
|
93
|
+
if not options.is_a?(Hash)
|
94
|
+
Pod::Podfile.unspecifiedList << name
|
95
|
+
return requirements
|
96
|
+
end
|
97
|
+
isFramework = options.key?(Pod::Podfile.isFramework)
|
98
|
+
isSource = options.key?(Pod::Podfile.isSource)
|
96
99
|
if isSource or (isSource and isFramework)
|
97
100
|
Pod::Podfile.sourceList << name
|
98
101
|
elsif isFramework
|
@@ -105,10 +108,12 @@ module Pod
|
|
105
108
|
|
106
109
|
def parse_debug_release_package(name, requirements)
|
107
110
|
options = requirements.last
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
111
|
+
if not options.is_a?(Hash)
|
112
|
+
Pod::Podfile.debugPackageList << name
|
113
|
+
return requirements
|
114
|
+
end
|
115
|
+
isDebugPackage = options.key?(Pod::Podfile.isDebugPackage)
|
116
|
+
isReleasePackage = options.key?(Pod::Podfile.isReleasePackage)
|
112
117
|
if (isDebugPackage and isReleasePackage) or isReleasePackage
|
113
118
|
Pod::Podfile.releasePackageList << name
|
114
119
|
else
|
@@ -142,41 +147,40 @@ module Pod
|
|
142
147
|
old_method.bind(self).call(name, requirements)
|
143
148
|
end
|
144
149
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
# end
|
150
|
+
def deep_copy(o)
|
151
|
+
Marshal.load(Marshal.dump(o))
|
152
|
+
end
|
153
|
+
|
154
|
+
def clean(name, requirements)
|
155
|
+
tmp_hash = deep_copy(requirements)
|
156
|
+
options = tmp_hash.last
|
157
|
+
return tmp_hash unless options.is_a?(Hash)
|
158
|
+
|
159
|
+
isFramework = options.delete(Pod::Podfile.isFramework)
|
160
|
+
isSource = options.delete(Pod::Podfile.isSource)
|
161
|
+
isDebugPackage = options.delete(Pod::Podfile.isDebugPackage)
|
162
|
+
isReleasePackage = options.delete(Pod::Podfile.isReleasePackage)
|
163
|
+
tmp_hash.pop if options.empty?
|
164
|
+
tmp_hash
|
165
|
+
end
|
166
|
+
|
167
|
+
|
168
|
+
define_method(:store_pod) do |name, *requirements|
|
169
|
+
return if parse_subspecs(name, requirements) # This parse method must be called first
|
170
|
+
parse_inhibit_warnings(name, requirements)
|
171
|
+
parse_configuration_whitelist(name, requirements)
|
172
|
+
|
173
|
+
# 去掉添加的字段
|
174
|
+
tmp_hash = clean(name, requirements)
|
175
|
+
pod = if tmp_hash && !tmp_hash.empty?
|
176
|
+
{ name => tmp_hash }
|
177
|
+
else
|
178
|
+
name
|
179
|
+
end
|
180
|
+
|
181
|
+
get_hash_value('dependencies', []) << pod
|
182
|
+
nil
|
183
|
+
end
|
180
184
|
|
181
185
|
end
|
182
186
|
end
|
@@ -239,18 +243,19 @@ module Pod
|
|
239
243
|
end
|
240
244
|
end
|
241
245
|
|
242
|
-
framework_dependence_note.each do |note|
|
246
|
+
framework_dependence_note.uniq.each do |note|
|
243
247
|
need_reload = true
|
244
248
|
cleanENV note
|
245
249
|
setEnv note, '_FRAMEWORK'
|
246
250
|
end
|
247
251
|
|
248
|
-
source_dependence_note.each do |note|
|
252
|
+
source_dependence_note.uniq.each do |note|
|
249
253
|
need_reload = true
|
250
254
|
cleanENV note
|
251
255
|
setEnv note, '_SOURCE'
|
252
256
|
end
|
253
257
|
|
258
|
+
|
254
259
|
end
|
255
260
|
if need_reload
|
256
261
|
spec = old_specification_from_file.call(path, subspec_name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-cafswitcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- handa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|