cocoapods-cafswitcher 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cocoapods-cafswitcher/Main.rb +5 -2
- data/lib/cocoapods-cafswitcher/gem_version.rb +1 -1
- data/lib/cocoapods-cafswitcher/podfile_switch.rb +18 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab22ddae4087c4c1bdee9b9db70decbb129d0a5d23d36c2ed42be628457f3bb0
|
4
|
+
data.tar.gz: ef0da8784ff372f864a6aff89162e11b95b82ce3c85d049b1085b9a71fa0313b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97801e574bdfe43f3cbf4a1d30e3a825985eab3d408f805df8f2908cfa2399893702942eed9d466c35888cc087858382157226060b92a82b435eabddbae48eb4
|
7
|
+
data.tar.gz: 3ddbcc7e595317b9651b5eb3a3bce0875e14c925f880f89a7e72dcf3463140635b5d6699b37470a96ccd6030ff8473683a571533a571bef42ec06633f36fe103
|
data/Gemfile.lock
CHANGED
@@ -141,6 +141,8 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
141
141
|
cafConfig = YAML.load(File.open(configFile))
|
142
142
|
else
|
143
143
|
FileUtils.touch configFile
|
144
|
+
cafConfig = Hash["sourceList" => [], "archiveList" => [], "frameworkList" => [],
|
145
|
+
"debugPackageList" => [], "releasePackageList" => []]
|
144
146
|
end
|
145
147
|
# 比较不同
|
146
148
|
changedSubPods = Array.new
|
@@ -157,18 +159,19 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
157
159
|
changedSubPods |= (value | frameworkList) - (value & frameworkList)
|
158
160
|
end
|
159
161
|
end
|
160
|
-
changedSubPods = changedSubPods | needUpdatePodList
|
161
162
|
Pod::UI.puts "\nchanged sub Pod is:\n " + changedSubPods.to_s if changedSubPods.length > 0
|
162
163
|
# changedPod 里是根据subspec来存的,需要进行合并,找到pod库而不是含有subspec的库
|
163
164
|
changedPods = Array.new
|
164
165
|
changedSubPods.each {|subPod| changedPods << subPod.split("_")[0]}
|
166
|
+
# changedPods = changedPods | needUpdatePodList
|
165
167
|
changedPods.uniq!
|
168
|
+
|
166
169
|
Pod::UI.puts "\nchanged Pod is:\n " + changedPods.to_s if changedPods.length > 0
|
167
170
|
|
168
171
|
# 根据不同删除cache
|
169
172
|
podRoot = config.project_pods_root
|
170
173
|
changedPods.each do |changedPod|
|
171
|
-
if
|
174
|
+
if needUpdatePodList.delete(changedPod)
|
172
175
|
# TODO如果pod 里没有用到preserve_paths,需要清除 pod cache clean
|
173
176
|
cacheCleanCMD = "pod cache clean #{changedPod} --all"
|
174
177
|
out = `#{cacheCleanCMD}`.lines.to_a
|
@@ -31,16 +31,6 @@ 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
|
-
|
44
34
|
@@sourceList = Array.new
|
45
35
|
|
46
36
|
def Podfile.sourceList
|
@@ -169,15 +159,26 @@ module Pod
|
|
169
159
|
requirements.pop if options.empty?
|
170
160
|
end
|
171
161
|
|
172
|
-
def
|
162
|
+
def parse_needUpdatePod_git(name, requirements)
|
163
|
+
options = requirements.last
|
164
|
+
return requirements unless options.is_a?(Hash)
|
165
|
+
|
166
|
+
isGitPath = options.has_key?(:git)
|
167
|
+
# pod_name = Specification.root_name(name)
|
168
|
+
if isGitPath
|
169
|
+
Pod::Podfile.needUpdatePodList << name[0,name=~/[\/]/]
|
170
|
+
end
|
171
|
+
requirements.pop if options.empty?
|
172
|
+
end
|
173
|
+
|
174
|
+
def parse_needUpdatePod_path(name, requirements)
|
173
175
|
options = requirements.last
|
174
176
|
return requirements unless options.is_a?(Hash)
|
175
177
|
|
176
|
-
|
177
|
-
isPath = options.has_key?(Pod::Podfile.path)
|
178
|
+
isPath = options.has_key?(:path)
|
178
179
|
# pod_name = Specification.root_name(name)
|
179
|
-
if
|
180
|
-
Pod::Podfile.needUpdatePodList << name
|
180
|
+
if isPath
|
181
|
+
Pod::Podfile.needUpdatePodList << name[0,name=~/[\/]/]
|
181
182
|
end
|
182
183
|
requirements.pop if options.empty?
|
183
184
|
end
|
@@ -193,7 +194,8 @@ module Pod
|
|
193
194
|
parse_isArchive(name, requirements)
|
194
195
|
parse_debug_package(name, requirements)
|
195
196
|
parse_release_package(name, requirements)
|
196
|
-
|
197
|
+
parse_needUpdatePod_git(name, requirements)
|
198
|
+
parse_needUpdatePod_path(name, requirements)
|
197
199
|
# pod_name = Specification.root_name(name)
|
198
200
|
Pod::Podfile.allPodName << name.gsub(/[\/]/, '_')
|
199
201
|
old_method.bind(self).(name, requirements)
|