cocoapods-tdf-bin 0.0.16 → 0.0.17

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: cf063e0d4570d17654e501c087cd63ae676b990238bb720cf5ff5303972a6984
4
- data.tar.gz: c230891ecb4fbaacf6dcdedcb70f1c92610a164c31f75965a125fac8a49034de
3
+ metadata.gz: 3f577bfd3e7fcecd47e17b0e1bcbcde05f610607a643bb17108cf302ee3d380c
4
+ data.tar.gz: e716d34c5ffbd2dba9b565fbd62f6c84b4e5013278f3e1d0f46733ace03377ac
5
5
  SHA512:
6
- metadata.gz: e682d524e2a7ab92f8be63fd9aafa1ec1fb190b2397d5991e9e7873294d1cee4390c510390ef240a772580685633098970af651772289464323c0c3cd8cbe2b4
7
- data.tar.gz: 7a6c7498c6fc74a2972c157b92c6cf7181350e936ddf03e6c43defd9f4ed4063f67dd6b0ce3f03d6843f40c57fee36fbb086f13f91058e83cee1aa78727f52b2
6
+ metadata.gz: 913994c6be4e81d2bc8a9678f288b2b9b3496d128a081cd174f0b2838bad714f4fc2dd4adbf2616f075e031c0e44566c04104faf7c3ec25dcf3c89e26873b58e
7
+ data.tar.gz: b74dcc1705407ada38305239078378f22b3a379e14a2065ebd6895a2f43608773c828fb427a0e55c67bf17fc35c824174004db3b6c3bb6eb1029742dab2e24d2
@@ -0,0 +1,51 @@
1
+ require 'cocoapods-tdf-bin/native/podfile_env'
2
+ require 'cocoapods-tdf-bin/native/podfile'
3
+ require 'cocoapods-tdf-bin/helpers/string_helper'
4
+
5
+ module Pod
6
+ class Command
7
+ class Bin < Command
8
+ class Batch < Bin
9
+
10
+ self.summary = "批量操作本地依赖组件的 git 命令"
11
+ self.description = <<-DESC
12
+ 用来批量操作通过 batch_pod_local 本地依赖的组件库,比如 pod bin batch pull, pod bin batch checkout master 等等;
13
+ 操作的是是通过 batch_pod_local 依赖的本地组件
14
+ DESC
15
+
16
+ def self.options
17
+ [
18
+ ['pull', '本地库全部拉取'],
19
+ ['push', '本地库全部推送'],
20
+ ['chenckout {分支名}', '切换指定分支'],
21
+ ['chenckout -b {分支名}', '切出指定分支'],
22
+ ]
23
+ end
24
+
25
+ def initialize(argv)
26
+ @arguments = argv.arguments
27
+ super
28
+ end
29
+
30
+ def run
31
+ podfile = File.join(Pathname.pwd, "Podfile")
32
+ podfile_instance = Pod::Podfile.from_file(podfile)
33
+ podfile_instance.get_batch_local_pods.each_value do |value|
34
+ path = value[0][:path]
35
+ arg = @arguments.join(" ")
36
+ puts "============== #{path} 开始执行 git #{arg} 命令 ==============".blue
37
+ puts `git -C #{path} #{arg}`
38
+ end
39
+ end
40
+
41
+ def validate!
42
+ git = `which git`
43
+ if git.empty?
44
+ help! "没有安装 git 命令"
45
+ end
46
+ end
47
+
48
+ end
49
+ end
50
+ end
51
+ end
@@ -7,6 +7,7 @@ require 'cocoapods-tdf-bin/command/bin/code'
7
7
  require 'cocoapods-tdf-bin/command/bin/update'
8
8
  require 'cocoapods-tdf-bin/command/bin/install'
9
9
  require 'cocoapods-tdf-bin/command/bin/imy'
10
+ require 'cocoapods-tdf-bin/command/bin/batch'
10
11
 
11
12
  require 'cocoapods-tdf-bin/helpers'
12
13
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.0.16'
3
+ VERSION = '0.0.17'
4
4
  end
5
5
 
6
6
  module Pod
@@ -0,0 +1,30 @@
1
+ class String
2
+ # colorization
3
+ def colorize(color_code)
4
+ "\e[#{color_code}m#{self}\e[0m"
5
+ end
6
+
7
+ def red
8
+ colorize(31)
9
+ end
10
+
11
+ def green
12
+ colorize(32)
13
+ end
14
+
15
+ def yellow
16
+ colorize(33)
17
+ end
18
+
19
+ def blue
20
+ colorize(34)
21
+ end
22
+
23
+ def pink
24
+ colorize(35)
25
+ end
26
+
27
+ def light_blue
28
+ colorize(36)
29
+ end
30
+ end
@@ -21,6 +21,7 @@ module Pod
21
21
  def use_frameworks_value
22
22
  {:linkage => :static}
23
23
  end
24
+
24
25
  end
25
26
  end
26
27
  end
@@ -12,6 +12,43 @@ module Pod
12
12
  set_internal_hash_value(ALLOW_PRERELEASE, true)
13
13
  end
14
14
 
15
+ def batch_pod_local(pods, path = "../../")
16
+ pod_hash = Hash.new
17
+ pods.each do |name|
18
+ pod_hash[name] = [ :path => "#{path}#{name}" ]
19
+ end
20
+ if get_batch_local_pods.nil?
21
+ set_internal_hash_value(BATCH_POD_LOCAL, pod_hash)
22
+ else
23
+ set_internal_hash_value(BATCH_POD_LOCAL, get_internal_hash_value(BATCH_POD_LOCAL).merge(pod_hash))
24
+ end
25
+ end
26
+
27
+ def batch_pod_remote(pods, branch , group = 'ios')
28
+ pod_hash = Hash.new
29
+ pods.each do |name|
30
+ pod_hash[name] = [ :git => "git@git.2dfire.net:#{group}/#{name}.git", :branch => "#{branch}" ]
31
+ end
32
+ if get_batch_remote_pods.nil?
33
+ set_internal_hash_value(BATCH_POD_REMOTE, pod_hash)
34
+ else
35
+ set_internal_hash_value(BATCH_POD_REMOTE, get_internal_hash_value(BATCH_POD_REMOTE).merge(pod_hash))
36
+ end
37
+ end
38
+
39
+ def pod(name = nil, *requirements)
40
+ unless name
41
+ raise StandardError, 'A dependency requires a name.'
42
+ end
43
+
44
+ local_pod_hash = get_batch_local_pods
45
+ remote_pod_hash = get_batch_remote_pods
46
+ requirements = remote_pod_hash[name].nil? ? requirements : remote_pod_hash[name];
47
+ requirements = local_pod_hash[name].nil? ? requirements : local_pod_hash[name];
48
+
49
+ current_target_definition.store_pod(name, *requirements)
50
+ end
51
+
15
52
  def use_binaries!(flag = true)
16
53
  set_internal_hash_value(USE_BINARIES, flag)
17
54
  end
@@ -61,6 +98,14 @@ module Pod
61
98
  get_internal_hash_value(USE_BINARIES, false) || ENV[USE_BINARIES] == 'true'
62
99
  end
63
100
 
101
+ def get_batch_local_pods
102
+ get_internal_hash_value(BATCH_POD_LOCAL)
103
+ end
104
+
105
+ def get_batch_remote_pods
106
+ get_internal_hash_value(BATCH_POD_REMOTE)
107
+ end
108
+
64
109
  def use_source_pods
65
110
  get_internal_hash_value(USE_SOURCE_PODS, []) + String(ENV[USE_SOURCE_PODS]).split('|').uniq
66
111
  end
@@ -8,6 +8,8 @@ module Pod
8
8
  ALLOW_PRERELEASE = 'allow_prerelease'
9
9
  USE_PLUGINS = 'use_plugins'
10
10
  CONFIGURATION_ENV = 'configuration_env'
11
+ BATCH_POD_LOCAL = 'batch_pod_local'
12
+ BATCH_POD_REMOTE = 'batch_pod_remote'
11
13
 
12
14
  module ENVExecutor
13
15
  def execute_with_bin_plugin(&block)
@@ -36,6 +36,7 @@ module Pod
36
36
  end
37
37
 
38
38
  use_frameworks!(generator.use_frameworks_value)
39
+ use_binaries!
39
40
 
40
41
  if (supported_swift_versions = generator.supported_swift_versions)
41
42
  supports_swift_versions(supported_swift_versions)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-tdf-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - gaijiaofan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -95,6 +95,7 @@ files:
95
95
  - lib/cocoapods-tdf-bin/command/bin.rb
96
96
  - lib/cocoapods-tdf-bin/command/bin/archive.rb
97
97
  - lib/cocoapods-tdf-bin/command/bin/auto.rb
98
+ - lib/cocoapods-tdf-bin/command/bin/batch.rb
98
99
  - lib/cocoapods-tdf-bin/command/bin/code.rb
99
100
  - lib/cocoapods-tdf-bin/command/bin/imy.rb
100
101
  - lib/cocoapods-tdf-bin/command/bin/init.rb
@@ -123,6 +124,7 @@ files:
123
124
  - lib/cocoapods-tdf-bin/helpers/spec_creator.rb
124
125
  - lib/cocoapods-tdf-bin/helpers/spec_files_helper.rb
125
126
  - lib/cocoapods-tdf-bin/helpers/spec_source_creator.rb
127
+ - lib/cocoapods-tdf-bin/helpers/string_helper.rb
126
128
  - lib/cocoapods-tdf-bin/helpers/upload_helper.rb
127
129
  - lib/cocoapods-tdf-bin/native.rb
128
130
  - lib/cocoapods-tdf-bin/native/acknowledgements.rb