cocoapods-soul-component-plugin 0.0.13 → 0.0.16

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: e24028ddd6eaf2842b42ec156eaa176c8e25979b027fe0bfc78b9de2d6b13aff
4
- data.tar.gz: 9ce54967f87d00a17b6697ec228027fc3e0af35442981ade92f9a801cdead879
3
+ metadata.gz: 1b70998eea510246adb5a4dc950005d7d4720594b1cb2d7dc05ba6d9cb6620f5
4
+ data.tar.gz: 68c1bb80e73ea87f00fd4ba9c2c6b07de579d671fba8d9abe051294739fd3b5a
5
5
  SHA512:
6
- metadata.gz: a02b79d7921ede221a8cf9784f333ad29c5cf757c289a059457b2f21576aa9783fe6a9e81f6950ef90a9d0e24a4067900428b875b9302b59e21a7925fa81c006
7
- data.tar.gz: 23d77f22305b4513bf2bc77fe0843d827aa0ec1b06c5dd8868d4327b86eb4a1531ccedbbd7c513590720ed5a19a8c04b56df193d3adce68d7be8fd9f49ad5d06
6
+ metadata.gz: 25c2d520190ec3680f66e5cfe1fd2f58a6ebfed749a6b7f1d0618051d4987aa8aa62b1fa15d16988941b5e5cf5d264eff93d0cc38185709feb08162b491a8626
7
+ data.tar.gz: a5ea185d610881ecfa1a2a43a5770928531f6fb2a4a2badf4d2733022d10b2e78e2448837873cd744fddd6d45eec95324e8dd2b8d8d7c8a47aae51861f63e599
@@ -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,13 +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(component_file_path)
119
- file_user_ref = group.new_reference(component_user_file_path)
134
+ file_ref = group.new_reference(file_path)
120
135
  # podfile_local排序
121
136
  podfile_local_group = group.children.last
122
137
  group.children.pop
@@ -136,6 +151,11 @@ module CocoapodsSoulComponentPlugin
136
151
  dependencies_user = obj_user['dependencies']
137
152
  end
138
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
+
139
159
  dependencies = obj['dependencies']
140
160
  dependencies.each do |each|
141
161
  component = Soul_Component.new(each[0], each[1]['local'], each[1]['submodule'], each[1]['version'], each[1]['git'],
@@ -223,12 +243,17 @@ module Pod
223
243
  class Install < Command
224
244
  def self.options
225
245
  [
226
- ['--source', 'Use source']
246
+ ['--source', 'Use source'],
247
+ ['--import-dependency', 'Use importDependency']
227
248
  ].concat(super)
228
249
  end
229
250
 
251
+
230
252
  def initialize(argv)
231
253
  CocoapodsSoulComponentPlugin.use_source = argv.flag?('source')
254
+ if argv.option('import-dependency')
255
+ CocoapodsSoulComponentPlugin.input_dependency = argv.option('import-dependency')
256
+ end
232
257
  super
233
258
  end
234
259
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module CocoapodsSoulComponentPlugin
3
- VERSION = '0.0.13'
3
+ VERSION = '0.0.16'
4
4
  end
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.13
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - fang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-30 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler