cocoapods-soul-component-plugin 0.0.7 → 0.0.8

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: 538e901040b541fa4e0ea1cbf57988925e52d826a5d58ad4ca2ed48b0974f557
4
- data.tar.gz: ee18ce9056fc63b06c87a667256f11adab50ab28430a8f616f77892ec75773e5
3
+ metadata.gz: 2973ba2951120c6f1fcc995d160ba9021ba167826dc8c3e3cc9636bb4f2aa993
4
+ data.tar.gz: 78ec8ef8b8d1905530ac31c7fe498f1ecfe1948979c420d7dfb5b6ac559b96fc
5
5
  SHA512:
6
- metadata.gz: 126f0255c192ff5c9f3ae04855fa50745afe7b85a7d228335789dafb42c6031b30eae548610e4b143aeb1559981fe613d18edd7b003de696e7e2d52063c3eb2c
7
- data.tar.gz: f7d5606e61d8a3525faa18bb02afe312ccfa80dc81b7b0fa12732331d204b717c39e9642d668aa83243a500966a0afd2c5497b694dc17b90e732d5d8501f4f23
6
+ metadata.gz: 0e884aec7137fb65168db58fee703f8d8b34edb35945e12d982d1ec405201ea67f7f857ea3d40bd8283684437c039e7b95eda6ab192ae5498c89b8f88420239a
7
+ data.tar.gz: e2174829dc3590418da0daab2c2f04979da30ca2afb51f17a423cbd47221bfaeedbb13450944678ced82d414a7e02c6a07054c767b3af242d926fbaaeb0c4e61
@@ -3,9 +3,19 @@ require 'fileutils'
3
3
  require 'json'
4
4
  require 'xcodeproj'
5
5
  require 'cocoapods-downloader'
6
+ require 'cocoapods/user_interface'
6
7
  require_relative '../gem_version'
7
8
 
8
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
+
9
19
  class Command
10
20
  class Devops < Command
11
21
  self.summary = <<-SUMMARY
@@ -30,7 +40,7 @@ module CocoapodsSoulComponentPlugin
30
40
  class Soul_Component
31
41
  attr_accessor :name, :local, :submodule, :version, :git, :branch, :path, :commit
32
42
 
33
- def initialize(name, local, submodule, version, git, branch, path)
43
+ def initialize(name, local, submodule, version, git, branch, path, commit)
34
44
  @name = name
35
45
  @local = local
36
46
  @submodule = submodule
@@ -84,13 +94,13 @@ module CocoapodsSoulComponentPlugin
84
94
  end
85
95
 
86
96
  def self.pre_run
87
- puts "当前版本:#{CocoapodsSoulComponentPlugin::VERSION}"
97
+ Pod::UI.puts "当前版本:#{CocoapodsSoulComponentPlugin::VERSION}".green
88
98
  json = File.read(self.component_file_path)
89
99
  obj = JSON.parse(json)
90
100
  dependencies = obj['dependencies']
91
101
 
92
102
  dependencies.each do |each|
93
- $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']))
94
104
  end
95
105
 
96
106
  $components.each do |each|
@@ -98,23 +108,28 @@ module CocoapodsSoulComponentPlugin
98
108
  if each.submodule == false
99
109
  if each.local == true
100
110
  local_path = each.name
101
- if each.branch != nil
102
- local_path += '-'
103
- local_path += each.branch.to_s.tr('/','-')
104
- end
111
+
105
112
  if each.commit != nil
106
113
  local_path += '-'
107
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
108
121
  end
109
- target_path = "#{root_path}/LocalPods/#{local_path}"
122
+ target_path = "#{root_path}/LocalPods/#{local_path}1"
110
123
  each.path = target_path
111
124
 
112
125
  if File.exist?(target_path) == false
113
- options = { git: each.git, commit: each.commit, branch: each.branch }
126
+ options = { git: each.git, commit: each.commit, tag: each.version, branch:each.branch }
114
127
  options = Pod::Downloader.preprocess_options(options)
115
128
  downloader = Pod::Downloader.for_target(target_path, options)
116
- downloader.download
117
- downloader.checkout_options #=> { :git => 'example.com', :commit => 'd7f410490dabf7a6bde665ba22da102c3acf1bd9' }
129
+ downloader.download_deep
130
+ Pod::UI.puts "本地 #{each.name} 不存在,进行 clone 。参数:#{options}".green
131
+ else
132
+ Pod::UI.puts "本地 #{each.name} 已存在,不进行变更,如需更新请删除。位置:#{target_path}".yellow
118
133
  end
119
134
  end
120
135
  else
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module CocoapodsSoulComponentPlugin
3
- VERSION = '0.0.7'
3
+ VERSION = '0.0.8'
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.7
4
+ version: 0.0.8
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-16 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