cocoapods-hooks 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-hooks/command/change_color.rb +10 -2
- data/lib/cocoapods-hooks/command/fastlane_sign.rb +5 -1
- data/lib/cocoapods-hooks/command/git_clone.rb +13 -8
- data/lib/cocoapods-hooks/command/oem_config.rb +16 -7
- data/lib/cocoapods-hooks/gem_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54b1cae95f9a8281df734d94cb4f40633cf879f94116ad76dae91480fdaa879c
|
4
|
+
data.tar.gz: d393b3338821f95ad776805a4a56d3cb439ae5f7a3362aa8fb9bc9f38c7bcfc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0152af04ce2300d74bc1ffe0d7eb392da5bc533dce713b582bbf4da206dbca51e2cd79cbfe8579332bdd437235f0aa3c74b545e83627ca0f1387b6a004ad71b9
|
7
|
+
data.tar.gz: 155391bb41a176307b13720d704e9bf7b0b56ae65e9bd3c9e3489a945db175a29f7bcfd2de0c1669077f9c63b8aee2ffe305dce329b52bd53e4f13609b8789af
|
@@ -29,9 +29,17 @@ module Pod
|
|
29
29
|
|
30
30
|
def self.changeThemeColor()
|
31
31
|
# 改变 theme 文件夹的图片颜色
|
32
|
-
system("python3 ChangeColor.py")
|
32
|
+
result = system("python3 ChangeColor.py")
|
33
|
+
unless result
|
34
|
+
puts "command execution failed. Exiting..."
|
35
|
+
exist 1
|
36
|
+
end
|
33
37
|
# 改变 mutableTheme 文件夹的图片颜色
|
34
|
-
system("python3 svg2png.py")
|
38
|
+
result = system("python3 svg2png.py")
|
39
|
+
unless result
|
40
|
+
puts "command execution failed. Exiting..."
|
41
|
+
exist 1
|
42
|
+
end
|
35
43
|
end
|
36
44
|
|
37
45
|
end
|
@@ -8,33 +8,38 @@ module Pod
|
|
8
8
|
def self.options
|
9
9
|
[
|
10
10
|
['--tenantid=TENANTID', 'Specify the tenant ID'],
|
11
|
-
['--
|
11
|
+
['--version=Version', 'Specify the sdk version for git clone']
|
12
12
|
].concat(super)
|
13
13
|
end
|
14
14
|
|
15
15
|
def initialize(argv)
|
16
16
|
@tenantid = argv.option('tenantid')
|
17
|
-
@
|
17
|
+
@version = argv.option('version')
|
18
18
|
super
|
19
19
|
end
|
20
20
|
|
21
21
|
def validate!
|
22
22
|
super
|
23
23
|
help! 'A tenant ID is required.' unless @tenantid
|
24
|
+
help! 'A sdk version is required.' unless @version
|
24
25
|
end
|
25
26
|
|
26
27
|
def run
|
27
28
|
UI.puts "Downloading OEM configuration for tenant #{@tenantid}"
|
29
|
+
if @tenantid.nil? || @tenantid.empty?
|
30
|
+
UI.puts "没有传入 tenantid, 直接退出程序"
|
31
|
+
exit 1
|
32
|
+
end
|
28
33
|
# 执行你的业务逻辑
|
29
|
-
if @
|
30
|
-
UI.puts "
|
31
|
-
|
34
|
+
if @version.nil? || @version.empty?
|
35
|
+
UI.puts "没有传入指定版本,直接退出程序"
|
36
|
+
exit 1
|
32
37
|
end
|
33
|
-
self.class.git_clone_project_config(@tenantid, @
|
38
|
+
self.class.git_clone_project_config(@tenantid, @version)
|
34
39
|
end
|
35
40
|
|
36
41
|
private
|
37
|
-
def self.git_clone_project_config(tenant_id,
|
42
|
+
def self.git_clone_project_config(tenant_id, version)
|
38
43
|
puts "start download ios project config with tenantid: #{tenant_id}"
|
39
44
|
# 先尝试删除源目录
|
40
45
|
if Dir.exist?('ios_project_config')
|
@@ -42,7 +47,7 @@ module Pod
|
|
42
47
|
FileUtils.rm_r('ios_project_config')
|
43
48
|
end
|
44
49
|
ios_project_config_git_url = 'ssh://git@192.168.31.7:7999/ios_module/ios_project_config.git'
|
45
|
-
success = system("git clone -b #{
|
50
|
+
success = system("git clone -b #{version} #{ios_project_config_git_url}")
|
46
51
|
puts "当前命令的路径为:#{Dir.pwd}"
|
47
52
|
if success
|
48
53
|
puts "repository cloned to #{Dir.pwd}"
|
@@ -3,35 +3,44 @@ require 'cocoapods/command'
|
|
3
3
|
module Pod
|
4
4
|
class Command
|
5
5
|
class OemConfig < Command
|
6
|
-
|
6
|
+
|
7
|
+
gem_version_path = File.expand_path('../../gem_version.rb', __FILE__)
|
8
|
+
VERSION = File.read(gem_version_path).match(/VERSION = "(.*)"/)[1]
|
9
|
+
self.summary = "插件版本是: #{VERSION}。根据 tenantid 配置所有的 OEM 配置,包含三步:1. 根据 tenant_id 下载相关的配置文件 2. 修改图片的主题色 3. 修改工程配置, 进行签名"
|
7
10
|
|
8
11
|
def self.options
|
9
12
|
[
|
10
13
|
['--tenantid=TENANTID', 'Specify the tenant ID'],
|
11
|
-
['--
|
14
|
+
['--version=Version', 'Specify the sdk version for git clone']
|
12
15
|
].concat(super)
|
13
16
|
end
|
14
17
|
|
15
18
|
def initialize(argv)
|
16
19
|
@tenantid = argv.option('tenantid')
|
17
|
-
@
|
20
|
+
@version = argv.option('version')
|
18
21
|
super
|
19
22
|
end
|
20
23
|
|
21
24
|
def validate!
|
22
25
|
super
|
23
26
|
help! 'A tenant ID is required.' unless @tenantid
|
27
|
+
help! 'A sdk version is required.' unless @version
|
24
28
|
end
|
25
29
|
|
26
30
|
def run
|
27
31
|
UI.puts "Downloading OEM configuration for tenant #{@tenantid}"
|
28
32
|
# 执行你的业务逻辑
|
29
|
-
if @
|
30
|
-
UI.puts "
|
31
|
-
|
33
|
+
if @tenantid.nil? || @tenantid.empty?
|
34
|
+
UI.puts "没有传入 tenantid, 直接退出程序"
|
35
|
+
exit 1
|
36
|
+
end
|
37
|
+
# 执行你的业务逻辑
|
38
|
+
if @version.nil? || @version.empty?
|
39
|
+
UI.puts "没有传入指定版本,直接退出程序"
|
40
|
+
exit 1
|
32
41
|
end
|
33
42
|
# 1. 根据 tenant_id 下载相关的配置文件
|
34
|
-
result = system("pod git-clone --tenantid=#{@tenantid} --
|
43
|
+
result = system("pod git-clone --tenantid=#{@tenantid} --version=#{@version}")
|
35
44
|
unless result
|
36
45
|
puts "pod git-clone command execution failed. Exiting..."
|
37
46
|
exist 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-hooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- huafeng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|