cocoapods-soul-component-plugin 0.0.4 → 0.0.9

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: 0e41b1c9c7d00553e6fa8e71154757bd51e3825f9fd4e66ba8949c3ec714b8fe
4
- data.tar.gz: d99d0437af8d21add060f52be73898a3c9c83da5afe08d0d5d51a131edb187c8
3
+ metadata.gz: 2d5496a166787a45ac688840d23bb262b635ff4950e5268aa2061c6c9ce4a1b1
4
+ data.tar.gz: db97545925bf707fe592f89a47370e6d41c7808d5d93de78ef2fe4297b56cb09
5
5
  SHA512:
6
- metadata.gz: 6122fdab51c62198eb4005aa2cd6d80eaf509124eb2c23f4ec7235e4eff6a1ca5726f4c4e37e3b70eb3d6462659a4315a5c8ff06fe21631a91108a8027deb575
7
- data.tar.gz: 75f3a8880417c98c2d16d2ec4e1b893289756193ae25ae84cbcd3f131f8adb1fe4922f1955a750b097cd86059889d5fb35291bbc468794828a8f8d80888ee010
6
+ metadata.gz: 6c3b8c066c53e8a61692dc62147ce546eeab14ec4761909e0f8d58bb905335b75032b6db4975d2e5d33dee0049a1fe6690b55b0f12eff74e0c2269ede0755d46
7
+ data.tar.gz: 46c87b938b7cd76bbb7f9b9d8c97453b35a0e2724d5e1cdcbc2c44bcebfc03748a3d5095be1149992ade235400563664dfa217b633416212fd0f7e566fe8868c
@@ -3,8 +3,19 @@ require 'fileutils'
3
3
  require 'json'
4
4
  require 'xcodeproj'
5
5
  require 'cocoapods-downloader'
6
+ require 'cocoapods/user_interface'
7
+ require_relative '../gem_version'
6
8
 
7
9
  module Pod
10
+ module Downloader
11
+ class Git < Base
12
+ def download_deep
13
+ clone(false,false )
14
+ checkout_commit if options[:commit]
15
+ end
16
+ end
17
+ end
18
+
8
19
  class Command
9
20
  class Devops < Command
10
21
  self.summary = <<-SUMMARY
@@ -29,7 +40,7 @@ module CocoapodsSoulComponentPlugin
29
40
  class Soul_Component
30
41
  attr_accessor :name, :local, :submodule, :version, :git, :branch, :path, :commit
31
42
 
32
- def initialize(name, local, submodule, version, git, branch, path)
43
+ def initialize(name, local, submodule, version, git, branch, path, commit)
33
44
  @name = name
34
45
  @local = local
35
46
  @submodule = submodule
@@ -50,11 +61,11 @@ module CocoapodsSoulComponentPlugin
50
61
  end
51
62
 
52
63
  def self.podfile_path
53
- root_path + '/Podfile'
64
+ "#{root_path}/Podfile"
54
65
  end
55
66
 
56
67
  def self.component_file_path
57
- root_path + '/devops/component.json'
68
+ "#{root_path}/devops/component.json"
58
69
  end
59
70
 
60
71
  Pod::HooksManager.register('cocoapods-soul-component-plugin', :pre_install) do |_context|
@@ -74,7 +85,7 @@ module CocoapodsSoulComponentPlugin
74
85
  group = project.main_group
75
86
  group.set_source_tree('SOURCE_ROOT')
76
87
  # 向group中添加 文件引用
77
- file_ref = group.new_reference(Pod::Config.instance.sandbox.root + '../devops/component.json')
88
+ file_ref = group.new_reference(self.component_file_path)
78
89
  # podfile_local排序
79
90
  podfile_local_group = group.children.last
80
91
  group.children.pop
@@ -83,13 +94,13 @@ module CocoapodsSoulComponentPlugin
83
94
  end
84
95
 
85
96
  def self.pre_run
86
- puts '当前版本:' + CocoapodsSoulComponentPlugin::VERSION
97
+ Pod::UI.puts "当前版本:#{CocoapodsSoulComponentPlugin::VERSION}".green
87
98
  json = File.read(self.component_file_path)
88
99
  obj = JSON.parse(json)
89
100
  dependencies = obj['dependencies']
90
101
 
91
102
  dependencies.each do |each|
92
- $components.push(Soul_Component.new(each[0], each[1]['local'], each[1]['submodule'], each[1]['version'], each[1]['git'], each[1]['branch'], each[1]['path']))
103
+ $components.push(Soul_Component.new(each[0], each[1]['local'], each[1]['submodule'], each[1]['version'], each[1]['git'], each[1]['branch'], each[1]['path'],each[1]['commit']))
93
104
  end
94
105
 
95
106
  $components.each do |each|
@@ -97,23 +108,28 @@ module CocoapodsSoulComponentPlugin
97
108
  if each.submodule == false
98
109
  if each.local == true
99
110
  local_path = each.name
100
- if each.branch != nil
101
- local_path += '-'
102
- local_path += each.branch.to_s.tr('/','-')
103
- end
111
+
104
112
  if each.commit != nil
105
113
  local_path += '-'
106
114
  local_path += each.commit.to_s
115
+ elsif each.branch != nil
116
+ local_path += '-'
117
+ local_path += each.branch.to_s
118
+ elsif each.version != nil
119
+ local_path += '-'
120
+ local_path += each.version.to_s
107
121
  end
108
- target_path = root_path + '/LocalPods/' + local_path
122
+ target_path = "#{root_path}/LocalPods/#{local_path}1"
109
123
  each.path = target_path
110
124
 
111
125
  if File.exist?(target_path) == false
112
- options = { git: each.git, commit: each.commit, branch: each.branch }
126
+ options = { git: each.git, commit: each.commit, tag: each.version, branch:each.branch }
113
127
  options = Pod::Downloader.preprocess_options(options)
114
128
  downloader = Pod::Downloader.for_target(target_path, options)
115
- downloader.download
116
- downloader.checkout_options #=> { :git => 'example.com', :commit => 'd7f410490dabf7a6bde665ba22da102c3acf1bd9' }
129
+ Pod::UI.puts "本地依赖 #{each.name} 不存在,即将进行下载 。参数:#{options}".green
130
+ downloader.download_deep
131
+ else
132
+ Pod::UI.puts "本地依赖 #{each.name} 已存在,不进行变更,如需更新请删除重新 install。位置:#{target_path}".yellow
117
133
  end
118
134
  end
119
135
  else
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module CocoapodsSoulComponentPlugin
2
- VERSION = "0.0.4"
3
+ VERSION = '0.0.9'
3
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.4
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - fang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-15 00:00:00.000000000 Z
11
+ date: 2021-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler