ykfastlane 0.3.12 → 0.3.13
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 +4 -4
- data/lib/actions/YKFastlaneExecute.rb +2 -2
- data/lib/actions/archive.rb +44 -50
- data/lib/actions/certificate.rb +17 -14
- data/lib/actions/init.rb +106 -45
- data/lib/interface.rb +24 -9
- data/lib/ykfastlane/tools.rb +6 -6
- data/lib/ykfastlane/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: 7959ecb85d8b27a4bf726afeed53e243cb4616b8c64aa035a2ceddd49b31d08c
|
|
4
|
+
data.tar.gz: a6e024e21c19776d1d38458b821c616a3fbf0f624b02a8224f1ae8192bee75e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1baf606d3b195439495c2f04de26a1139290a1ada1d582fba5cd53a2c09ac3a92169c5ac9a598fa7afd091a17b5ee66dbd0850af9498d3ff09ee2281f664b98
|
|
7
|
+
data.tar.gz: 4a7fad8bacaa36d0578f59cd61deda876f026ffb36a84a5a6dd4d836a6ebf3b381d70f478ae64e3e6c08499973630151e03f9195ccdd4ef3ff0b440353196b48
|
|
@@ -23,8 +23,8 @@ module YKFastlane
|
|
|
23
23
|
class YKFastlaneExecute
|
|
24
24
|
def self.executeCommand(commandShell_pre, commandShell, workTitle)
|
|
25
25
|
excuteStr = " "
|
|
26
|
-
excuteStr << "#{commandShell_pre}
|
|
27
|
-
excuteStr << commandShell unless commandShell.blank?
|
|
26
|
+
excuteStr << "#{commandShell_pre}" unless commandShell_pre.blank?
|
|
27
|
+
excuteStr << " && #{commandShell}" unless commandShell.blank?
|
|
28
28
|
|
|
29
29
|
puts "START COMMAND:#{excuteStr}"
|
|
30
30
|
code = 1
|
data/lib/actions/archive.rb
CHANGED
|
@@ -14,53 +14,36 @@ module YKFastlane
|
|
|
14
14
|
YKFastlane::Tools.UI(YKARCHIVE_PRODUCT_PATH)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
K_archiveEnv_pgyer_api => options[:pgyer_api],
|
|
29
|
-
K_archiveEnv_pgyer_user => options[:pgyer_user]
|
|
30
|
-
}
|
|
31
|
-
self.update_archive_map(YKFastlane::ArchiveHelper::K_archiveEnv_config_pgyer, pgyerinfo)
|
|
32
|
-
puts "archive update pgyer info success"
|
|
33
|
-
end
|
|
17
|
+
no_commands {
|
|
18
|
+
def platform_edit_user_execute(options)
|
|
19
|
+
puts("#{method(:platform_edit_user_execute)}:#{options}")
|
|
20
|
+
if options[:pgyer_user].blank? == false && options[:pgyer_api].blank? == false # pgyer
|
|
21
|
+
pgyerinfo = {
|
|
22
|
+
K_archiveEnv_pgyer_api => options[:pgyer_api],
|
|
23
|
+
K_archiveEnv_pgyer_user => options[:pgyer_user]
|
|
24
|
+
}
|
|
25
|
+
self.update_archive_map(YKFastlane::ArchiveHelper::K_archiveEnv_config_pgyer, pgyerinfo)
|
|
26
|
+
puts "archive update pgyer info success"
|
|
27
|
+
end
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
if options[:fir_api_token].blank? == false #fir
|
|
30
|
+
fir_info = {
|
|
31
|
+
K_archiveEnv_firApiToken => options[:fir_api_token]
|
|
32
|
+
}
|
|
33
|
+
self.update_archive_map(YKFastlane::ArchiveHelper::K_archiveEnv_config_fir, fir_info)
|
|
34
|
+
puts "archive update fir info success"
|
|
35
|
+
end
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
if options[:apple_password].blank? == false && options[:apple_password].blank? == false # tf
|
|
38
|
+
tf_info = {
|
|
39
|
+
K_archiveEnv_tf_account => options[:apple_account],
|
|
40
|
+
K_archiveEnv_tf_password => options[:apple_password]
|
|
41
|
+
}
|
|
42
|
+
self.update_archive_map(YKFastlane::ArchiveHelper::K_archiveEnv_config_tf, tf_info)
|
|
43
|
+
puts "archive update tf info success"
|
|
44
|
+
end
|
|
50
45
|
end
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
desc "list_platform_user", "display the ipa bump platform user map"
|
|
54
|
-
|
|
55
|
-
def list_platform_user()
|
|
56
|
-
self.list_user_map()
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
desc "list_profiles", "print archive profiles info"
|
|
60
|
-
def list_profiles()
|
|
61
|
-
code = YKFastlaneExecute.executeFastlaneLane("list_profile_configs", options)
|
|
62
|
-
exit(code)
|
|
63
|
-
end
|
|
46
|
+
}
|
|
64
47
|
|
|
65
48
|
desc "upload_tf", "upload ipa to test flight, will send failed message to enterprise robot \'#{Helper::YKWECHAT_ROBOT_TOKEN}\'"
|
|
66
49
|
option :ipa, :required => true, :type => :string, :aliases => :i, :desc => 'scheme name'
|
|
@@ -77,7 +60,7 @@ module YKFastlane
|
|
|
77
60
|
end
|
|
78
61
|
|
|
79
62
|
code = YKFastlaneExecute.executeFastlaneLane("upload_ipa_to_tf", options)
|
|
80
|
-
exit(code)
|
|
63
|
+
exit(code) unless code == 0
|
|
81
64
|
end
|
|
82
65
|
|
|
83
66
|
desc "tf", "archive ios project and upload to TF, will send failed message to enterprise robot \'#{Helper::YKWECHAT_ROBOT_TOKEN}\'"
|
|
@@ -101,7 +84,7 @@ module YKFastlane
|
|
|
101
84
|
end
|
|
102
85
|
|
|
103
86
|
code = YKFastlaneExecute.executeFastlaneLane("archive_tf", options)
|
|
104
|
-
exit(code)
|
|
87
|
+
exit(code) unless code == 0
|
|
105
88
|
end
|
|
106
89
|
|
|
107
90
|
desc "pgyer", "archive ios project and upload to pgyer, will send failed message to enterprise robot \'#{Helper::YKWECHAT_ROBOT_TOKEN}\'"
|
|
@@ -113,7 +96,7 @@ module YKFastlane
|
|
|
113
96
|
option :xcworkspace, :type => :string, :aliases => :x, :desc => '.xcworkspace 文件相对于指令工作目录的相对路径, 如果.xcworkspace文件在工程根目录,则可以不传递此参数'
|
|
114
97
|
option :cocoapods, :type => :numeric, :aliases => :c, :desc => '是否需要执行pod install, 默认不执行pod install 指令, 1:执行, 非1:不执行'
|
|
115
98
|
option :flutter_directory, :type => :string, :aliases => :d, :desc => '如果有flutter混编, 此参数是 flutter项目的相对路径.'
|
|
116
|
-
option :export, :type => :string, :aliases => :e, :desc => '包的类型, app-store,
|
|
99
|
+
option :export, :type => :string, :aliases => :e, :desc => '包的类型, app-store, ad-hoc, enterprise 默认为enterprise'
|
|
117
100
|
|
|
118
101
|
def pgyer()
|
|
119
102
|
puts "archive_pgyer"
|
|
@@ -124,7 +107,7 @@ module YKFastlane
|
|
|
124
107
|
end
|
|
125
108
|
|
|
126
109
|
code = YKFastlaneExecute.executeFastlaneLane("archive_pgyer", options)
|
|
127
|
-
exit(code)
|
|
110
|
+
exit(code) unless code == 0
|
|
128
111
|
end
|
|
129
112
|
|
|
130
113
|
desc "fir", "archive ios project and upload to fir, will send failed message to enterprise robot \'#{Helper::YKWECHAT_ROBOT_TOKEN}\'"
|
|
@@ -135,7 +118,7 @@ module YKFastlane
|
|
|
135
118
|
option :xcworkspace, :type => :string, :aliases => :x, :desc => '.xcworkspace 文件相对于指令工作目录的相对路径, 如果.xcworkspace文件在工程根目录,则可以不传递此参数'
|
|
136
119
|
option :cocoapods, :type => :numeric, :aliases => :c, :desc => '是否需要执行pod install, 默认不执行pod install 指令, 1:执行, 非1:不执行'
|
|
137
120
|
option :flutter_directory, :type => :string, :aliases => :d, :desc => '如果有flutter混编, 此参数是 flutter项目的相对路径.'
|
|
138
|
-
option :export, :type => :string, :aliases => :e, :desc => '包的类型,
|
|
121
|
+
option :export, :type => :string, :aliases => :e, :desc => '包的类型, app-store, ad-hoc, enterprise 默认为enterprise'
|
|
139
122
|
|
|
140
123
|
def fir()
|
|
141
124
|
puts "archive_fir"
|
|
@@ -145,7 +128,18 @@ module YKFastlane
|
|
|
145
128
|
end
|
|
146
129
|
|
|
147
130
|
code = YKFastlaneExecute.executeFastlaneLane("archive_fir", options)
|
|
148
|
-
exit(code)
|
|
131
|
+
exit(code) unless code == 0
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
no_commands do
|
|
135
|
+
def list_platform_user_execute()
|
|
136
|
+
self.list_user_map()
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def list_profiles_execute()
|
|
140
|
+
code = YKFastlaneExecute.executeFastlaneLane("list_profile_configs", options)
|
|
141
|
+
exit(code) unless code == 0
|
|
142
|
+
end
|
|
149
143
|
end
|
|
150
144
|
|
|
151
145
|
end
|
data/lib/actions/certificate.rb
CHANGED
|
@@ -28,7 +28,7 @@ module YKFastlane
|
|
|
28
28
|
|
|
29
29
|
puts "options_formatter:#{options}"
|
|
30
30
|
code = YKFastlaneExecute.executeFastlaneLane("sync_apple_profile", options)
|
|
31
|
-
exit! code
|
|
31
|
+
exit! code unless code == 0
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
desc "update_profile", "Update one profile"
|
|
@@ -50,7 +50,7 @@ module YKFastlane
|
|
|
50
50
|
options[:profile_path] = str unless str.blank?
|
|
51
51
|
puts "options:#{options}"
|
|
52
52
|
code = YKFastlaneExecute.executeFastlaneLane("update_profiles", options)
|
|
53
|
-
exit! code
|
|
53
|
+
exit! code unless code == 0
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
desc "update_cer", "edit certificate & profile for project schem or target"
|
|
@@ -68,25 +68,28 @@ module YKFastlane
|
|
|
68
68
|
para[:password] = options[:cer_password]
|
|
69
69
|
|
|
70
70
|
code = YKFastlaneExecute.executeFastlaneLane("update_certificate_p12", para)
|
|
71
|
-
exit! code
|
|
71
|
+
exit! code unless code == 0
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
desc "sync_git", "sync certificate & profile git
|
|
75
|
-
option :remote_url, :require => false, :type => :string, :aliases => :r, :desc => "git remote url, example:#{YKFastlane::Helper.default_certificate_git_remote}"
|
|
76
|
-
|
|
74
|
+
desc "sync_git", "sync certificate & profile git"
|
|
77
75
|
def sync_git()
|
|
78
76
|
puts "#{method(:sync_git)}--options:#{options}"
|
|
79
|
-
|
|
80
|
-
exit! code
|
|
77
|
+
self.sync_git_execute({})
|
|
81
78
|
end
|
|
82
79
|
|
|
83
|
-
|
|
80
|
+
no_commands {
|
|
81
|
+
def sync_git_execute(options)
|
|
82
|
+
puts "#{method(:sync_git_execute)}--options:#{options}"
|
|
83
|
+
code = YKFastlaneExecute.executeFastlaneLane("sync_certificate_profile", options)
|
|
84
|
+
exit! code unless code == 0
|
|
85
|
+
end
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
def list_details_execute()
|
|
88
|
+
puts("certificate list_details")
|
|
89
|
+
code = YKFastlaneExecute.executeFastlaneLane("list_profile_certificate_config", options)
|
|
90
|
+
exit! code unless code == 0
|
|
91
|
+
end
|
|
92
|
+
}
|
|
90
93
|
|
|
91
94
|
end
|
|
92
95
|
end
|
data/lib/actions/init.rb
CHANGED
|
@@ -9,59 +9,49 @@ module YKFastlane
|
|
|
9
9
|
class Init < YKFastlane::SubCommandBase
|
|
10
10
|
include Helper
|
|
11
11
|
|
|
12
|
-
desc "
|
|
12
|
+
desc "execute_configs", "execute configs that user defines"
|
|
13
|
+
|
|
14
|
+
option :all, :aliases => :a, :type => :boolean, :require => false, :desc => "execute all configs"
|
|
15
|
+
option :script, :aliases => :s, :type => :boolean, :require => false, :desc => "execute script config"
|
|
16
|
+
option :profile, :aliases => :p, :type => :boolean, :require => false, :desc => "execute profile config"
|
|
17
|
+
|
|
18
|
+
def execute_configs()
|
|
19
|
+
puts("options:#{options}")
|
|
20
|
+
self.execute_config_execute(options)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "edit_configs", "update all configurations"
|
|
13
24
|
long_desc <<-LONGDESC
|
|
14
|
-
|
|
25
|
+
本指令集只是一个门户指令,核心打包功能是通过调用fastlane脚本实现的。\n
|
|
26
|
+
需要配置:\n
|
|
27
|
+
1. 配置fastlane脚本的远程仓库;\n
|
|
28
|
+
2. 配置任务失败时候的反馈企业微信机器人 企业微信机器人配置: \033[0;32m https://developer.work.weixin.qq.com/document/path/91770 \e[0m\n
|
|
29
|
+
3. p12 与 profile 的托管仓库\n
|
|
30
|
+
4. fir, pgyer, tf 的账号口令\n
|
|
15
31
|
LONGDESC
|
|
16
|
-
option :fastfile_remote, :aliases => :f, :type => :string, :desc => "fastlane 文件仓库地址, 如果未传递,则使用env中配置的,#{Helper::YKCONFIG_PATH}"
|
|
17
32
|
|
|
18
|
-
|
|
19
|
-
fastfile_remote = options[:fastfile_remote].blank? ? Helper::load_config_value(Helper::K_fastfile_remote) : options[:fastfile_remote]
|
|
33
|
+
option :fastfile_remote, :aliases => :l, :type => :string, :desc => "fastlane 文件的 git remote, 可用参数:#{Helper.default_fast_file_remote()}"
|
|
20
34
|
|
|
21
|
-
|
|
22
|
-
puts "no remote, work failed"
|
|
23
|
-
exit false
|
|
24
|
-
end
|
|
35
|
+
option :wx_access_token, :aliases => :t, :type => :string, :desc => "enterprise wechat robot token"
|
|
25
36
|
|
|
26
|
-
|
|
27
|
-
p_temp = p + "_temp"
|
|
28
|
-
FileUtils.remove_dir(p_temp, force: true)
|
|
37
|
+
option :profile_remote_url, :aliases => :r, :require => false, :type => :string, :desc => "profile & certificate git remote url, example:#{YKFastlane::Helper.default_certificate_git_remote}"
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exit cloneResult
|
|
33
|
-
end
|
|
39
|
+
option :pgyer_user, :aliases => :u, :type => :string, :required => false, :desc => 'pgyer 平台 user'
|
|
40
|
+
option :pgyer_api, :aliases => :a, :type => :string, :required => false, :desc => 'pgyer 平台 api, 配置链接: \033[0;32m https://appleid.apple.com/account/manage \e[0m'
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
FileUtils.remove_dir(p, true)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
if File.exist?(File.dirname(p)) == false
|
|
41
|
-
FileUtils.mkdir_p(File.dirname(p))
|
|
42
|
-
end
|
|
43
|
-
FileUtils.mv(p_temp, p, force: true, verbose: true)
|
|
42
|
+
option :apple_account, :aliases => :c, :type => :string, :required => false, :desc => 'apple id'
|
|
43
|
+
option :apple_password, :aliases => :p, :type => :string, :required => false, :desc => 'apple id 专属app密钥, 配置链接: \033[0;32m https://appleid.apple.com/account/manage \e[0m'
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
system("bundle install --verbose")
|
|
47
|
-
end
|
|
48
|
-
return 0
|
|
49
|
-
end
|
|
45
|
+
option :fir_api_token, :aliases => :f, :type => :string, :required => false, :desc => 'fir 平台 api token'
|
|
50
46
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
LONGDESC
|
|
56
|
-
option :fastfile_remote, :aliases => :f, :type => :string, :desc => "fastlane 文件的git remote, 可用参数:#{Helper.default_fast_file_remote()}"
|
|
57
|
-
option :wx_access_token, :aliases => :t, :type => :string, :desc => "enterprise wechat robot token"
|
|
47
|
+
def edit_configs()
|
|
48
|
+
require 'actions/certificate'
|
|
49
|
+
require 'actions/archive'
|
|
50
|
+
puts("all_config:#{options}")
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Helper.update_config('', Helper::K_wx_access_token, options[:wx_access_token]) unless options[:wx_access_token].blank?
|
|
63
|
-
YKFastlane::ArchiveHelper.update_archive_map(Helper::K_wx_access_token, options[:wx_access_token]) unless options[:wx_access_token].blank?
|
|
64
|
-
Helper.display_config_yml
|
|
52
|
+
YKFastlane::Init.new().config_execute(options)
|
|
53
|
+
YKFastlane::Archive.new().platform_edit_user_execute(options)
|
|
54
|
+
YKFastlane::Certificate.new().sync_git_execute(options) unless options[:profile_remote_url].blank?
|
|
65
55
|
end
|
|
66
56
|
|
|
67
57
|
desc 'define_fast_execute_path', "指定fastlane文件的路径,此处是为了调试fastlane脚本"
|
|
@@ -73,12 +63,83 @@ module YKFastlane
|
|
|
73
63
|
Helper.update_config("execute path", Helper::K_YK_CONFIG_FASTLANE_SCRIPT, options[:fastfile_path].blank? ? "" : options[:fastfile_path])
|
|
74
64
|
end
|
|
75
65
|
|
|
76
|
-
desc "
|
|
66
|
+
desc "list_all_configs", "print the env config file: #{Helper::YKCONFIG_PATH}"
|
|
67
|
+
|
|
68
|
+
def list_all_configs()
|
|
69
|
+
require 'actions/certificate'
|
|
70
|
+
require 'actions/archive'
|
|
77
71
|
|
|
78
|
-
|
|
72
|
+
YKFastlane::Certificate.new().list_details_execute()
|
|
73
|
+
|
|
74
|
+
YKFastlane::Archive.new().list_platform_user_execute()
|
|
79
75
|
Helper.display_config_yml
|
|
76
|
+
YKFastlane::Archive.new().list_profiles_execute()
|
|
80
77
|
end
|
|
81
78
|
|
|
79
|
+
no_commands {
|
|
80
|
+
def execute_config_execute(options)
|
|
81
|
+
require 'actions/certificate'
|
|
82
|
+
|
|
83
|
+
if options[:all_config] = true
|
|
84
|
+
self.sync_script_execute({})
|
|
85
|
+
YKFastlane::Certificate.new().sync_git_execute({})
|
|
86
|
+
else
|
|
87
|
+
if options[:script] == true
|
|
88
|
+
self.sync_script_execute({})
|
|
89
|
+
end
|
|
90
|
+
if options[:profile] == true
|
|
91
|
+
YKFastlane::Certificate.new().sync_git_execute({})
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def sync_script_execute(options)
|
|
97
|
+
fastfile_remote = options[:fastfile_remote].blank? ? Helper::load_config_value(Helper::K_fastfile_remote) : options[:fastfile_remote]
|
|
98
|
+
|
|
99
|
+
if fastfile_remote.blank?
|
|
100
|
+
puts "no remote, work failed"
|
|
101
|
+
exit false
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
p = Helper::YKFastlne_SCRIPT_PATH
|
|
105
|
+
p_temp = p + "_temp"
|
|
106
|
+
FileUtils.remove_dir(p_temp, force: true)
|
|
107
|
+
|
|
108
|
+
cloneResult = YKFastlane::Tools.clone_git_repository(fastfile_remote, p_temp)
|
|
109
|
+
if cloneResult != 0
|
|
110
|
+
exit cloneResult
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if Dir.exist?(p)
|
|
114
|
+
puts "directory exist, so we delete it:#{p}"
|
|
115
|
+
FileUtils.remove_dir(p, true)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if File.exist?(File.dirname(p)) == false
|
|
119
|
+
FileUtils.mkdir_p(File.dirname(p))
|
|
120
|
+
end
|
|
121
|
+
FileUtils.mv(p_temp, p, force: true, verbose: true)
|
|
122
|
+
|
|
123
|
+
Dir.chdir(p) do
|
|
124
|
+
system("bundle install --verbose")
|
|
125
|
+
end
|
|
126
|
+
return 0
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def config_execute(options)
|
|
130
|
+
puts("#{method(:config_execute)}:#{options}")
|
|
131
|
+
|
|
132
|
+
if options[:fastfile_remote].blank? == false
|
|
133
|
+
Helper.update_config('', Helper::K_fastfile_remote, options[:fastfile_remote]) unless options[:fastfile_remote].blank?
|
|
134
|
+
self.sync_script_execute({})
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
Helper.update_config('', Helper::K_wx_access_token, options[:wx_access_token]) unless options[:wx_access_token].blank?
|
|
138
|
+
YKFastlane::ArchiveHelper.update_archive_map(Helper::K_wx_access_token, options[:wx_access_token]) unless options[:wx_access_token].blank?
|
|
139
|
+
Helper.display_config_yml
|
|
140
|
+
end
|
|
141
|
+
}
|
|
142
|
+
|
|
82
143
|
end
|
|
83
144
|
|
|
84
145
|
end
|
data/lib/interface.rb
CHANGED
|
@@ -20,24 +20,39 @@ module YKFastlane
|
|
|
20
20
|
true
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
desc "lanes", 'list all lanes'
|
|
24
|
-
|
|
25
|
-
def lanes()
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
end
|
|
23
|
+
# desc "lanes", 'list all lanes'
|
|
24
|
+
#
|
|
25
|
+
# def lanes()
|
|
26
|
+
# puts "lanes"
|
|
27
|
+
# code = YKFastlane::YKFastlaneExecute.executeFastlaneLane("lanes", options)
|
|
28
|
+
# exit(code)
|
|
29
|
+
# end
|
|
30
30
|
|
|
31
31
|
desc "archive", "archive functions"
|
|
32
32
|
subcommand "archive", YKFastlane::Archive
|
|
33
33
|
|
|
34
|
-
desc "pod", "cocoapods functions"
|
|
35
|
-
subcommand "pod", YKFastlane::Pod
|
|
34
|
+
# desc "pod", "cocoapods functions"
|
|
35
|
+
# subcommand "pod", YKFastlane::Pod
|
|
36
36
|
|
|
37
37
|
desc "init", "init ykfastlane"
|
|
38
38
|
subcommand "init", YKFastlane::Init
|
|
39
39
|
|
|
40
40
|
desc "certificate", "manager ios certificate & profile files"
|
|
41
41
|
subcommand "certificate", YKFastlane::Certificate
|
|
42
|
+
|
|
43
|
+
desc "update", "update ykfastlane"
|
|
44
|
+
def update()
|
|
45
|
+
require 'actions/YKFastlaneExecute'
|
|
46
|
+
code = YKFastlane::YKFastlaneExecute.executeCommand("gem uninstall ykfastlane -a -x", "gem install ykfastlane", "")
|
|
47
|
+
exit! code unless code == 0
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
desc "uninstall", "uninstall self"
|
|
51
|
+
def uninstall()
|
|
52
|
+
require 'actions/YKFastlaneExecute'
|
|
53
|
+
code = YKFastlane::YKFastlaneExecute.executeCommand("gem uninstall ykfastlane -a -x", "", "")
|
|
54
|
+
exit! code unless code == 0
|
|
55
|
+
end
|
|
56
|
+
|
|
42
57
|
end
|
|
43
58
|
end
|
data/lib/ykfastlane/tools.rb
CHANGED
|
@@ -90,16 +90,16 @@ module YKFastlane
|
|
|
90
90
|
re
|
|
91
91
|
end
|
|
92
92
|
|
|
93
|
-
def self.update_yml(
|
|
93
|
+
def self.update_yml(question, path, key, value)
|
|
94
94
|
yml = load_yml(path)
|
|
95
95
|
|
|
96
96
|
updateFlag = :yes
|
|
97
97
|
if value.blank? #外部未传该参数需要通过问答形式,获取该参数
|
|
98
|
-
value = Tools.yk_ask("please input #{Tools::green(
|
|
98
|
+
value = Tools.yk_ask("please input #{Tools::green(question)}")
|
|
99
99
|
|
|
100
100
|
if yml[key].blank? == false #需要确认修改
|
|
101
101
|
puts "#{key} existed:#{yml[key]}"
|
|
102
|
-
updateFlag = Tools.yk_ask_with_answers("Are you sure to update #{self.green(
|
|
102
|
+
updateFlag = Tools.yk_ask_with_answers("Are you sure to update #{self.green(question)}", ["Yes", "No"]).to_sym
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
yml[key] = value unless updateFlag != :yes
|
|
@@ -145,11 +145,11 @@ module YKFastlane
|
|
|
145
145
|
def self.git_commit(path, msg)
|
|
146
146
|
git = Git::open(path)
|
|
147
147
|
git.add()
|
|
148
|
-
|
|
148
|
+
cur_branch = git.current_branch
|
|
149
149
|
begin
|
|
150
150
|
git.commit("update:#{msg}")
|
|
151
151
|
rescue Git::GitExecuteError => e
|
|
152
|
-
puts "commit update
|
|
152
|
+
puts "commit update exception:#{e}"
|
|
153
153
|
end
|
|
154
154
|
|
|
155
155
|
status = git.status()
|
|
@@ -158,7 +158,7 @@ module YKFastlane
|
|
|
158
158
|
return 1
|
|
159
159
|
else
|
|
160
160
|
puts "git clean, work success"
|
|
161
|
-
git.push('origin',
|
|
161
|
+
git.push('origin', cur_branch)
|
|
162
162
|
return 0
|
|
163
163
|
end
|
|
164
164
|
end
|
data/lib/ykfastlane/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ykfastlane
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- stephen.chen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-10-
|
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: git
|