cocoapods-cafswitcher 0.0.17 → 0.0.18
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: b985979e76483821455bb55d0fb5e6337c0f22a6338e9f9fb83cab90691b5b9c
|
4
|
+
data.tar.gz: 9d1491a422e43fb1798127bf2d2736ca1b0dcc5d53daeeac89bb2c4f85395860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465bc02f429e46b7a24024241c82bad1ec36bea48684e9a90bd6fa59ca23dcd6fc00ad84a9a93adc31ab789c287052b26702c34216c701f37dd3f296cfd6ef2c
|
7
|
+
data.tar.gz: 95216c0d050c876f8264834561194fc39b50f3e6d68bfc388d85ccc1efb782beb0e15303cd7f8c408bc250c1b45c0f742da676fad15d09f78584df17c70595ea
|
@@ -60,14 +60,10 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
60
60
|
currentSourceList = currentSourceList << name unless currentSourceList.include?(name)
|
61
61
|
end
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
# setEnv(name, "_DEBUG")
|
68
|
-
# # ENV["#{name}_DEBUG"] = '1'
|
69
|
-
# end
|
70
|
-
# end
|
63
|
+
isDebug = true
|
64
|
+
if ENV['IS_RELEASE']
|
65
|
+
isDebug = FALSE
|
66
|
+
end
|
71
67
|
|
72
68
|
# 对debug和release切换,release级别高
|
73
69
|
# for debugName in Pod::Podfile.debugPackageList.uniq
|
@@ -104,16 +100,17 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
104
100
|
sourceList = []
|
105
101
|
archiveList = []
|
106
102
|
frameworkList = []
|
107
|
-
|
108
|
-
|
103
|
+
debugPackageList = Array.new
|
104
|
+
releasePackageList = Array.new
|
109
105
|
|
110
106
|
allNames.each do |name|
|
107
|
+
# 对于区分subspec的库,subspec之间只能同时是debug或者release
|
111
108
|
envName = name.gsub(/[\/]/, '_')
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
109
|
+
if ENV["IS_RELEASE"] == '1'
|
110
|
+
releasePackageList << name
|
111
|
+
else
|
112
|
+
debugPackageList << name
|
113
|
+
end
|
117
114
|
|
118
115
|
if ENV["#{envName}_SOURCE"] == '1'
|
119
116
|
sourceList << name
|
@@ -127,8 +124,14 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
127
124
|
Pod::UI.puts "is Source :\n #{sourceList}"
|
128
125
|
Pod::UI.puts "is Archive :\n #{archiveList}"
|
129
126
|
Pod::UI.puts "is Framework :\n #{frameworkList}"
|
130
|
-
|
131
|
-
|
127
|
+
|
128
|
+
Pod::UI.puts "debugPackage tag :\n #{debugPackageList}"
|
129
|
+
Pod::UI.puts "releasePackage tag:\n #{releasePackageList}"
|
130
|
+
if isDebug
|
131
|
+
Pod::UI.puts "all Debug\n"
|
132
|
+
else
|
133
|
+
Pod::UI.puts "all Release\n"
|
134
|
+
end
|
132
135
|
|
133
136
|
# 如果某一个Pod和上一次比发生变化,需要清除缓存
|
134
137
|
# 1. 清除pod缓存
|
@@ -140,7 +143,8 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
140
143
|
|
141
144
|
# caf_hash = Hash["sourceList" => sourceList, "archiveList" => archiveList, "frameworkList" => frameworkList,
|
142
145
|
# "debugPackageList" => debugPackageList, "releasePackageList" => releasePackageList]
|
143
|
-
caf_hash = Hash['sourceList' => sourceList, 'archiveList' => archiveList, 'frameworkList' => frameworkList
|
146
|
+
caf_hash = Hash['sourceList' => sourceList, 'archiveList' => archiveList, 'frameworkList' => frameworkList,
|
147
|
+
'debugPackageList' => debugPackageList, 'releasePackageList' => releasePackageList ]
|
144
148
|
|
145
149
|
|
146
150
|
config = Pod::Config.instance
|
@@ -150,26 +154,49 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
150
154
|
configPath = config.cafConfigPath
|
151
155
|
FileUtils.mkdir_p(configPath) unless configPath.exist?
|
152
156
|
configFile = config.cafConfigFile
|
153
|
-
cafConfig = Hash['sourceList' => [], 'archiveList' => [], 'frameworkList' => []
|
157
|
+
cafConfig = Hash['sourceList' => [], 'archiveList' => [], 'frameworkList' => [],
|
158
|
+
'debugPackageList' => [], 'releasePackageList' => []]
|
154
159
|
if configFile.exist?
|
155
160
|
cafConfig = YAML.load(File.open(configFile))
|
156
|
-
|
161
|
+
if not cafConfig
|
162
|
+
cafConfig = Hash['sourceList' => [], 'archiveList' => [], 'frameworkList' => [], 'debugPackageList' => [], 'releasePackageList' => []]
|
163
|
+
end
|
157
164
|
else
|
158
165
|
FileUtils.touch configFile
|
159
166
|
end
|
160
167
|
# 比较不同
|
161
168
|
changedSubPods = []
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
changedSubPods |= (value |
|
169
|
+
caf_hash.each do |key, value|
|
170
|
+
if key == 'debugPackageList'
|
171
|
+
cafDebugList = []
|
172
|
+
if cafConfig.include?('debugPackageList')
|
173
|
+
cafDebugList = cafConfig['debugPackageList']
|
174
|
+
end
|
175
|
+
changedSubPods |= (value | cafDebugList) - (value & cafDebugList)
|
176
|
+
elsif key == 'releasePackageList'
|
177
|
+
cafReleaseeList = []
|
178
|
+
if cafConfig.include?('releasePackageList')
|
179
|
+
cafReleaseeList = cafConfig['releasePackageList']
|
180
|
+
end
|
181
|
+
changedSubPods |= (value | cafReleaseeList) - (value & cafReleaseeList)
|
182
|
+
elsif key == 'sourceList'
|
183
|
+
cafSourceList = []
|
184
|
+
if cafConfig.include?('sourceList')
|
185
|
+
cafSourceList = cafConfig['sourceList']
|
186
|
+
end
|
187
|
+
changedSubPods |= (value | cafSourceList) - (value & cafSourceList)
|
169
188
|
elsif key == 'archiveList'
|
170
|
-
|
189
|
+
cafArchiveList = []
|
190
|
+
if cafConfig.include?('archiveList')
|
191
|
+
cafArchiveList = cafConfig['archiveList']
|
192
|
+
end
|
193
|
+
changedSubPods |= (value | cafArchiveList) - (value & cafArchiveList)
|
171
194
|
elsif key == 'frameworkList'
|
172
|
-
|
195
|
+
cafFrameworkList = []
|
196
|
+
if cafConfig.include?('frameworkList')
|
197
|
+
cafFrameworkList = cafConfig['frameworkList']
|
198
|
+
end
|
199
|
+
changedSubPods |= (value | cafFrameworkList) - (value & cafFrameworkList)
|
173
200
|
end
|
174
201
|
end
|
175
202
|
|
@@ -210,7 +237,7 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
|
|
210
237
|
end
|
211
238
|
end
|
212
239
|
end
|
213
|
-
next unless changedSubPod =~ /^(?i)LJ/ || changedSubPod =~ /^(?i)Lianjia/
|
240
|
+
next unless changedSubPod =~ /^(?i)LJ/ || changedSubPod =~ /^(?i)Lianjia/ || changedSubPod.include?('/')
|
214
241
|
# 清除目录 pods 文件夹下的缓存
|
215
242
|
changedPodPath = podRoot + changedPod
|
216
243
|
if changedPodPath.exist?
|
@@ -51,17 +51,17 @@ module Pod
|
|
51
51
|
@@frameworkList
|
52
52
|
end
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
54
|
+
@@debugPackageList = Array.new
|
55
|
+
|
56
|
+
def Podfile.debugPackageList
|
57
|
+
@@debugPackageList
|
58
|
+
end
|
59
|
+
|
60
|
+
@@releasePackageList = Array.new
|
61
|
+
|
62
|
+
def Podfile.releasePackageList
|
63
|
+
@@releasePackageList
|
64
|
+
end
|
65
65
|
|
66
66
|
# all the name of Pod
|
67
67
|
@@allPodName = []
|
@@ -108,17 +108,16 @@ module Pod
|
|
108
108
|
ENV['IS_ARCHIVE'] = '1'
|
109
109
|
end
|
110
110
|
|
111
|
-
# Enable
|
111
|
+
# Enable release package for all pods
|
112
112
|
# it has a lower priority to other binary settings
|
113
|
-
# def
|
114
|
-
# ENV['
|
113
|
+
# def all_release_package!
|
114
|
+
# ENV['IS_RELEASE'] = '1'
|
115
115
|
# end
|
116
116
|
|
117
117
|
end
|
118
118
|
|
119
119
|
class TargetDefinition
|
120
120
|
|
121
|
-
|
122
121
|
def parse_isFramework(name, requirements)
|
123
122
|
options = requirements.last
|
124
123
|
return requirements unless options.is_a?(Hash)
|
@@ -155,21 +154,17 @@ module Pod
|
|
155
154
|
#
|
156
155
|
# isDebugPackage = options.has_key?(Pod::Podfile.isDebugPackage)
|
157
156
|
# # pod_name = Specification.root_name(name)
|
158
|
-
# if isDebugPackage
|
159
|
-
# Pod::Podfile.debugPackageList << name.gsub(/[\/]/, '_')
|
160
|
-
# end
|
157
|
+
# Pod::Podfile.debugPackageList << name if isDebugPackage
|
161
158
|
# requirements.pop if options.empty?
|
162
159
|
# end
|
163
|
-
|
160
|
+
|
164
161
|
# def parse_release_package(name, requirements)
|
165
162
|
# options = requirements.last
|
166
163
|
# return requirements unless options.is_a?(Hash)
|
167
164
|
#
|
168
165
|
# isReleasePackage = options.has_key?(Pod::Podfile.isReleasePackage)
|
169
166
|
# # pod_name = Specification.root_name(name)
|
170
|
-
# if isReleasePackage
|
171
|
-
# Pod::Podfile.releasePackageList << name.gsub(/[\/]/, '_')
|
172
|
-
# end
|
167
|
+
# Pod::Podfile.releasePackageList << name if isReleasePackage
|
173
168
|
# requirements.pop if options.empty?
|
174
169
|
# end
|
175
170
|
|
@@ -206,7 +201,6 @@ module Pod
|
|
206
201
|
# parse_release_package(name, requirements)
|
207
202
|
parse_needUpdatePod_git(name, requirements)
|
208
203
|
parse_needUpdatePod_path(name, requirements)
|
209
|
-
# pod_name = Specification.root_name(name)
|
210
204
|
Pod::Podfile.allPodName << name
|
211
205
|
old_method.bind(self).call(name, requirements)
|
212
206
|
end
|
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.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- handa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|