cocoapods-soul-component-plugin 0.0.12 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1cc567fadc6951270b4ecdc745c8181315c90ec3197b3c02dd4ccf25f074aa0
|
4
|
+
data.tar.gz: c37be6a87ad84c013f378bd7f6cd6490ad1264ec26ea2ad41107241bd5f9d9ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfe876fafd86ea8194e52d21d158d70d6cd311b5741001b04acfbed6fef1516b47ea0145659b7c438d45c63c61ac35745e365218be1638828992950ca66ea024
|
7
|
+
data.tar.gz: 7ac6535353d77dc166ec4704ea4ff60dd8ab9e8a5fb5b02cc1bed59bcb52d7fd415ec3e5fcc812d4080cd0368af34ba4d6d321a8aaac507954b07e6098bb70ee
|
@@ -44,6 +44,7 @@ end
|
|
44
44
|
module CocoapodsSoulComponentPlugin
|
45
45
|
@@components = []
|
46
46
|
@@use_source = false
|
47
|
+
@@input_dependency = ''
|
47
48
|
|
48
49
|
def self.use_source=(t_use_source)
|
49
50
|
@@use_source = t_use_source
|
@@ -53,6 +54,14 @@ module CocoapodsSoulComponentPlugin
|
|
53
54
|
@@use_source
|
54
55
|
end
|
55
56
|
|
57
|
+
def self.input_dependency=(t_input_dependency)
|
58
|
+
@@input_dependency = t_input_dependency
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.input_dependency
|
62
|
+
@@input_dependency
|
63
|
+
end
|
64
|
+
|
56
65
|
def self.components
|
57
66
|
@@components
|
58
67
|
end
|
@@ -110,12 +119,19 @@ module CocoapodsSoulComponentPlugin
|
|
110
119
|
|
111
120
|
def self.post_run
|
112
121
|
Pod::UI.puts '添加component.json文件引用'
|
122
|
+
if File.exist?(component_user_file_path)
|
123
|
+
add_refrence(component_user_file_path)
|
124
|
+
end
|
125
|
+
add_refrence(component_file_path)
|
126
|
+
end
|
127
|
+
|
128
|
+
def self.add_refrence(file_path)
|
113
129
|
project = Xcodeproj::Project.open(Pod::Config.instance.sandbox.project_path)
|
114
130
|
# 获取主group
|
115
131
|
group = project.main_group
|
116
132
|
group.set_source_tree('SOURCE_ROOT')
|
117
133
|
# 向group中添加 文件引用
|
118
|
-
file_ref = group.new_reference(
|
134
|
+
file_ref = group.new_reference(file_path)
|
119
135
|
# podfile_local排序
|
120
136
|
podfile_local_group = group.children.last
|
121
137
|
group.children.pop
|
@@ -135,12 +151,17 @@ module CocoapodsSoulComponentPlugin
|
|
135
151
|
dependencies_user = obj_user['dependencies']
|
136
152
|
end
|
137
153
|
|
154
|
+
if self.input_dependency.length > 0
|
155
|
+
obj = JSON.parse(self.input_dependency)
|
156
|
+
Pod::UI.puts "使用外部依赖配置覆盖。参数:#{obj['dependencies'].to_hash}".green
|
157
|
+
end
|
158
|
+
|
138
159
|
dependencies = obj['dependencies']
|
139
160
|
dependencies.each do |each|
|
140
161
|
component = Soul_Component.new(each[0], each[1]['local'], each[1]['submodule'], each[1]['version'], each[1]['git'],
|
141
162
|
each[1]['branch'], each[1]['path'], each[1]['commit'])
|
142
163
|
if dependencies_user && dependencies_user[component.name]
|
143
|
-
component.local = dependencies_user[component.name]['local']
|
164
|
+
component.local = dependencies_user[component.name]['local'] if dependencies_user[component.name]['local']
|
144
165
|
component.submodule = dependencies_user[component.name]['submodule'] if dependencies_user[component.name]['submodule']
|
145
166
|
component.version = dependencies_user[component.name]['version']
|
146
167
|
component.git = dependencies_user[component.name]['git'] if dependencies_user[component.name]['git']
|
@@ -164,7 +185,7 @@ module CocoapodsSoulComponentPlugin
|
|
164
185
|
def self.checkValidComponents
|
165
186
|
isValid = true
|
166
187
|
@@components.each do |each|
|
167
|
-
if each.name.nil? || each.git.nil? || each.local.nil? || each.submodule.nil
|
188
|
+
if each.name.nil? || each.git.nil? || each.local.nil? || each.submodule.nil?
|
168
189
|
Pod::UI.puts "缺少必要参数,name/git/local/submodule为必要参数:#{each.to_hash}".red
|
169
190
|
isValid = false
|
170
191
|
end
|
@@ -222,12 +243,15 @@ module Pod
|
|
222
243
|
class Install < Command
|
223
244
|
def self.options
|
224
245
|
[
|
225
|
-
['--source', 'Use source']
|
246
|
+
['--source', 'Use source'],
|
247
|
+
['--import-dependency', 'Use importDependency']
|
226
248
|
].concat(super)
|
227
249
|
end
|
228
250
|
|
251
|
+
|
229
252
|
def initialize(argv)
|
230
253
|
CocoapodsSoulComponentPlugin.use_source = argv.flag?('source')
|
254
|
+
CocoapodsSoulComponentPlugin.input_dependency = argv.option('import-dependency')
|
231
255
|
super
|
232
256
|
end
|
233
257
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-soul-component-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|