cocoapods-cafswitcher 0.0.3 → 0.0.4
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: 31445be2abcb86433759ab74dd951d2090dad8dac324dbf1cea32fcf7642b88f
|
4
|
+
data.tar.gz: ee481b6def3b8d54d8eac95109491bbcd6c12f4b4c34d29647e9db1f03c16f34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3942eae6620ed3afc82981fc50ed67822f3d0bab59b5727b3508b60c79480730cdcf002510e24fe338469b6bdca764ea501eff71294540e5f3885c6681b26635
|
7
|
+
data.tar.gz: 1d911a9b193b6dd1b54ee1a98f45991eecc2b42e8470265157adde3062458772ffb05463bbe926bbb7104d16cbded81d533afc3139dbfb9052c01a1bbc0b0f14
|
data/Gemfile.lock
CHANGED
@@ -34,7 +34,8 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
34
34
|
#
|
35
35
|
#
|
36
36
|
allNames = Pod::Podfile.allPodName.uniq
|
37
|
-
|
37
|
+
needUpdatePodList = Pod::Podfile.needUpdatePodList.uniq
|
38
|
+
|
38
39
|
if ENV['IS_ARCHIVE']
|
39
40
|
ENV.delete('IS_ARCHIVE')
|
40
41
|
for name in allNames
|
@@ -156,6 +157,7 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
156
157
|
changedSubPods |= (value | frameworkList) - (value & frameworkList)
|
157
158
|
end
|
158
159
|
end
|
160
|
+
changedSubPods = changedSubPods | needUpdatePodList
|
159
161
|
Pod::UI.puts "\nchanged sub Pod is:\n " + changedSubPods.to_s if changedSubPods.length > 0
|
160
162
|
# changedPod 里是根据subspec来存的,需要进行合并,找到pod库而不是含有subspec的库
|
161
163
|
changedPods = Array.new
|
@@ -166,10 +168,12 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
166
168
|
# 根据不同删除cache
|
167
169
|
podRoot = config.project_pods_root
|
168
170
|
changedPods.each do |changedPod|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
171
|
+
if changedPod =~ /^(?i)LJ/ or changedPod =~ /^(?i)Lianjia/
|
172
|
+
# TODO如果pod 里没有用到preserve_paths,需要清除 pod cache clean
|
173
|
+
cacheCleanCMD = "pod cache clean #{changedPod} --all"
|
174
|
+
out = `#{cacheCleanCMD}`.lines.to_a
|
175
|
+
puts out
|
176
|
+
end
|
173
177
|
# 清除目录 pods 文件夹下的缓存
|
174
178
|
changedPodPath = podRoot + changedPod
|
175
179
|
FileUtils.rm_r(changedPodPath) if changedPodPath.exist?
|
@@ -31,6 +31,16 @@ module Pod
|
|
31
31
|
:isReleasePackage
|
32
32
|
end
|
33
33
|
|
34
|
+
def self.git
|
35
|
+
:git
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.path
|
39
|
+
:path
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
|
34
44
|
@@sourceList = Array.new
|
35
45
|
|
36
46
|
def Podfile.sourceList
|
@@ -68,6 +78,13 @@ module Pod
|
|
68
78
|
@@allPodName
|
69
79
|
end
|
70
80
|
|
81
|
+
@@needUpdatePodList = Array.new
|
82
|
+
|
83
|
+
def Podfile.needUpdatePodList
|
84
|
+
@@needUpdatePodList
|
85
|
+
end
|
86
|
+
|
87
|
+
|
71
88
|
module DSL
|
72
89
|
# Enable code for all pods
|
73
90
|
# it has a lower priority to other binary settings
|
@@ -152,6 +169,19 @@ module Pod
|
|
152
169
|
requirements.pop if options.empty?
|
153
170
|
end
|
154
171
|
|
172
|
+
def parse_needUpdatePod(name, requirements)
|
173
|
+
options = requirements.last
|
174
|
+
return requirements unless options.is_a?(Hash)
|
175
|
+
|
176
|
+
isGit = options.has_key?(Pod::Podfile.git)
|
177
|
+
isPath = options.has_key?(Pod::Podfile.path)
|
178
|
+
# pod_name = Specification.root_name(name)
|
179
|
+
if isGit or isPath
|
180
|
+
Pod::Podfile.needUpdatePodList << name.gsub(/[\/]/, '_')
|
181
|
+
end
|
182
|
+
requirements.pop if options.empty?
|
183
|
+
end
|
184
|
+
|
155
185
|
# ---- patch method ----
|
156
186
|
# We want modify `store_pod` method, but it's hard to insert a line in the
|
157
187
|
# implementation. So we patch a method called in `store_pod`.
|
@@ -163,6 +193,7 @@ module Pod
|
|
163
193
|
parse_isArchive(name, requirements)
|
164
194
|
parse_debug_package(name, requirements)
|
165
195
|
parse_release_package(name, requirements)
|
196
|
+
parse_needUpdatePod(name, requirements)
|
166
197
|
# pod_name = Specification.root_name(name)
|
167
198
|
Pod::Podfile.allPodName << name.gsub(/[\/]/, '_')
|
168
199
|
old_method.bind(self).(name, requirements)
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- handa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|