cocoapods-soul-component-plugin 0.0.6 → 0.0.10

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: ce6b57121b7fc51be564b7532e7ea361c2ee0226e75a0cd0edf35d636ab05a66
4
- data.tar.gz: f6157e2ab76a60a161ac1f9406676fd719e144f3600d1af3669908bae0da2971
3
+ metadata.gz: 17ca100ec2abac1731f0880fbc3eab77c3bcae0ebf0a85573f8d165dfdd928b4
4
+ data.tar.gz: 3e63e527cf6bd1b66bdf4c86cbe2b62dd81b6c9ce5e21e3e8c5a892511885309
5
5
  SHA512:
6
- metadata.gz: da2e70e89937eacdae81800af75524afe984a3dc52964ff02f95f09589293c7a15faf3133adc7bb320fda126ebc660247ce0f2962144e5e6020e45874c475e27
7
- data.tar.gz: 81f9e21bf89ec98f801b76f1c50abf3f9dcb0cc91fe45fee2a329453c5b314d8730c5e909dcb3ccfc33ab0727d86c77548cd9b03cbbb6518f2f01f135b939b6b
6
+ metadata.gz: 9df3393644ecf49435921ba68cd96128c888cb83065c479f1473bb1d5d6cabc2e6793dcefe75fed6c7394544975730e4db8bd62082f05978a27b50173644a3a0
7
+ data.tar.gz: 58455b25be1648957bf8561cba12477c5b41878c856ea71e0531613f4c261afb7681dcac45f37b613d5c91c187d1a39157b36389ad91d9df1ebe74861f55b33c
@@ -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
@@ -75,7 +85,7 @@ module CocoapodsSoulComponentPlugin
75
85
  group = project.main_group
76
86
  group.set_source_tree('SOURCE_ROOT')
77
87
  # 向group中添加 文件引用
78
- file_ref = group.new_reference("#{Pod::Config.instance.sandbox.root}../devops/component.json")
88
+ file_ref = group.new_reference(self.component_file_path)
79
89
  # podfile_local排序
80
90
  podfile_local_group = group.children.last
81
91
  group.children.pop
@@ -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
122
  target_path = "#{root_path}/LocalPods/#{local_path}"
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
+ Pod::UI.puts "本地依赖 #{each.name} 不存在,即将进行下载 。参数:#{options}".green
130
+ downloader.download_deep
131
+ else
132
+ Pod::UI.puts "本地依赖 #{each.name} 已存在,不进行变更,如需更新请删除重新 install。位置:#{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.6'
3
+ VERSION = '0.0.10'
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.6
4
+ version: 0.0.10
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