cocoapods-dev-env 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods/dev/env/version.rb +1 -1
- data/lib/cocoapods_plugin.rb +27 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6ef1f311749dfda8fe62e3edef726bb735d556ad02653554fd54ff66770602c
|
4
|
+
data.tar.gz: 8c845b54a33e312faef38db386f712b578758f35c2bbaed17211f887243da539
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32462311303b31c4d70aa6642219a3c53d9178c6a9ff7804bc23e2fd029ab34b178bef0d8edb795c5686d403baf335518d10d52b1446fb7e6b783e7eed171fde
|
7
|
+
data.tar.gz: d5cd32f589aa2c9f9cfb21106d71476ab39eb15ee4320f63372effd519b89382dea03b32b659ce2699ed7e85010e3b9c17e13368eeb82daca30bab1b3b68b3c4
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -2,9 +2,10 @@ Pod::HooksManager.register('cocoapods-dev-env', :pre_install) do |installer|
|
|
2
2
|
podfile = installer.podfile
|
3
3
|
#puts installer.instance_variables
|
4
4
|
# forbidden submodule not cloned
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
# 会引起submodule HEAD回滚,不靠谱,先注释掉
|
6
|
+
# `
|
7
|
+
# git submodule update --init --recursive
|
8
|
+
# `
|
8
9
|
end
|
9
10
|
|
10
11
|
Pod::HooksManager.register('cocoapods-dev-env', :post_install) do |installer|
|
@@ -25,6 +26,19 @@ module Pod
|
|
25
26
|
class Podfile
|
26
27
|
class TargetDefinition
|
27
28
|
|
29
|
+
def searchAndOpenLocalExample(path)
|
30
|
+
currentDir = Dir.pwd
|
31
|
+
Dir.chdir(path)
|
32
|
+
Dir.chdir("Example")
|
33
|
+
`pod install`
|
34
|
+
projPaths = Dir::glob("*.xcworkspace")
|
35
|
+
if projPaths.count > 0
|
36
|
+
`open -a Terminal ./`
|
37
|
+
`open #{projPaths[0]}`
|
38
|
+
end
|
39
|
+
Dir.chdir(currentDir)
|
40
|
+
end
|
41
|
+
|
28
42
|
def checkAndRemoveSubmodule(path)
|
29
43
|
currentDir = Dir.pwd
|
30
44
|
Dir.chdir(path)
|
@@ -97,8 +111,8 @@ class Podfile
|
|
97
111
|
end
|
98
112
|
|
99
113
|
def inputNeedJumpForReson(str)
|
100
|
-
puts str
|
101
|
-
puts '是(Y),
|
114
|
+
puts str.green
|
115
|
+
puts '是(Y), 任意其他输入或直接回车跳过'.green
|
102
116
|
input = STDIN.gets
|
103
117
|
if input[0,1] == "Y"
|
104
118
|
return true
|
@@ -168,16 +182,22 @@ class Podfile
|
|
168
182
|
UI.puts "add submodule for #{pod_name.green}".yellow
|
169
183
|
# TODO 这个命令要想办法展示实际报错信息
|
170
184
|
`git submodule add --force -b #{branch} #{git} #{path}`
|
171
|
-
|
185
|
+
if inputNeedJumpForReson("本地库#{pod_name} 开发模式加载完成,是否自动打开Example工程")
|
186
|
+
searchAndOpenLocalExample(path)
|
187
|
+
end
|
172
188
|
if !checkTagIsEqualToHead(tag, path) && !checkTagIsEqualToHead("#{tag}_beta", path)
|
173
189
|
raise "💔 #{pod_name.yellow} branch:#{branch.yellow} 与 tag:#{tag.yellow}[_beta] 内容不同步,请自行确认所用分支和tag后重新执行 pod install"
|
174
190
|
end
|
191
|
+
else
|
192
|
+
if inputNeedJumpForReson("本地库#{pod_name} 处于开发模式,是否自动打开Example工程")
|
193
|
+
searchAndOpenLocalExample(path)
|
194
|
+
end
|
175
195
|
end
|
176
196
|
options[:path] = path
|
177
197
|
if requirements.length >= 2
|
178
198
|
requirements.delete_at(0)
|
179
199
|
end
|
180
|
-
UI.message "enabled #{"dev".green}-mode
|
200
|
+
UI.message "pod #{pod_name.green} enabled #{"dev".green}-mode 🍺"
|
181
201
|
elsif dev_env == 'beta'
|
182
202
|
# Beta模式,使用tag引用远端git库的代码
|
183
203
|
tag = "#{tag}_beta"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-dev-env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 吴锡苗
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
|
-
rubygems_version: 3.0.
|
82
|
+
rubygems_version: 3.0.3
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: a cocoapod plugin for dev in mutipods
|