pindo 5.18.3 → 5.18.5
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/pindo/command/android/autobuild.rb +27 -25
- data/lib/pindo/command/appstore/adhocbuild.rb +3 -3
- data/lib/pindo/command/appstore/autobuild.rb +3 -3
- data/lib/pindo/command/appstore/autoresign.rb +6 -2
- data/lib/pindo/command/appstore/cert.rb +12 -6
- data/lib/pindo/command/appstore/getitcinfo.rb +10 -8
- data/lib/pindo/command/appstore/iap.rb +9 -9
- data/lib/pindo/command/appstore/initconfig.rb +6 -7
- data/lib/pindo/command/appstore/itcinfo.rb +12 -12
- data/lib/pindo/command/appstore/metadata.rb +7 -6
- data/lib/pindo/command/appstore/screenshots.rb +7 -6
- data/lib/pindo/command/appstore/tag.rb +7 -4
- data/lib/pindo/command/gplay/iap.rb +7 -6
- data/lib/pindo/command/gplay/metadata.rb +7 -6
- data/lib/pindo/command/gplay/screenshots.rb +7 -6
- data/lib/pindo/command/ios/applovin.rb +9 -8
- data/lib/pindo/command/ios/autobuild.rb +1 -1
- data/lib/pindo/command/ios/autoresign.rb +6 -2
- data/lib/pindo/command/ios/cert.rb +11 -6
- data/lib/pindo/command/ios/fixproj.rb +9 -6
- data/lib/pindo/command/ios/podlint.rb +10 -5
- data/lib/pindo/command/ios/podpush.rb +13 -6
- data/lib/pindo/command/ios/podupdate.rb +10 -6
- data/lib/pindo/command/jps/apptest.rb +2 -2
- data/lib/pindo/command/jps/bind.rb +1 -1
- data/lib/pindo/command/jps/download.rb +11 -10
- data/lib/pindo/command/jps/login.rb +8 -7
- data/lib/pindo/command/jps/media.rb +1 -1
- data/lib/pindo/command/jps/upload.rb +56 -31
- data/lib/pindo/command/repo.rb +0 -6
- data/lib/pindo/command/unity/autobuild.rb +33 -41
- data/lib/pindo/command/unity/packpush.rb +14 -8
- data/lib/pindo/command/utils/renewcert.rb +15 -13
- data/lib/pindo/command/utils/repoinit.rb +12 -6
- data/lib/pindo/command/utils.rb +7 -7
- data/lib/pindo/command/web/autobuild.rb +29 -28
- data/lib/pindo/command/web/run.rb +9 -8
- data/lib/pindo/module/android/android_build_helper.rb +6 -6
- data/lib/pindo/module/android/keystore_helper.rb +1 -1
- data/lib/pindo/module/build/build_helper.rb +37 -3
- data/lib/pindo/module/cert/cert_helper.rb +1 -1
- data/lib/pindo/module/pgyer/pgyerhelper.rb +3 -3
- data/lib/pindo/module/task/core/task_executor.rb +2 -0
- data/lib/pindo/module/task/task_manager.rb +8 -0
- data/lib/pindo/options/core/global_options_state.rb +1 -1
- data/lib/pindo/options/core/option_item.rb +1 -1
- data/lib/pindo/options/groups/appstore_options.rb +114 -0
- data/lib/pindo/options/groups/build_options.rb +93 -4
- data/lib/pindo/options/groups/cert_options.rb +0 -52
- data/lib/pindo/options/groups/common_options.rb +27 -0
- data/lib/pindo/options/groups/global_options.rb +18 -0
- data/lib/pindo/options/groups/ios_tool_options.rb +60 -0
- data/lib/pindo/options/groups/jps_options.rb +41 -0
- data/lib/pindo/options/groups/option_group.rb +1 -1
- data/lib/pindo/options/groups/pod_options.rb +37 -0
- data/lib/pindo/options/groups/unity_options.rb +4 -4
- data/lib/pindo/options/groups/utils_options.rb +125 -0
- data/lib/pindo/options/options.rb +6 -0
- data/lib/pindo/version.rb +2 -2
- metadata +7 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'highline/import'
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'json'
|
|
4
|
+
require 'pindo/options/options'
|
|
4
5
|
|
|
5
6
|
module Pindo
|
|
6
7
|
class Command
|
|
@@ -30,7 +31,7 @@ module Pindo
|
|
|
30
31
|
|
|
31
32
|
$ pindo ios podlint MyPod.podspec # 指定podspec文件
|
|
32
33
|
|
|
33
|
-
$ pindo ios podlint --
|
|
34
|
+
$ pindo ios podlint --path=~/MyPod # 指定pod库目录
|
|
34
35
|
|
|
35
36
|
$ pindo ios podlint --verbose # 显示详细输出
|
|
36
37
|
DESC
|
|
@@ -40,15 +41,19 @@ module Pindo
|
|
|
40
41
|
CLAide::Argument.new('podspec', true)
|
|
41
42
|
]
|
|
42
43
|
|
|
44
|
+
def self.option_items
|
|
45
|
+
@option_items ||= Pindo::Options::PodOptions.select(:path)
|
|
46
|
+
end
|
|
47
|
+
|
|
43
48
|
def self.options
|
|
44
|
-
|
|
45
|
-
['--p', '指定需要lint的pod库所在目录, 例如 --p=~/Users/xxx/MyPod'],
|
|
46
|
-
].concat(super)
|
|
49
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
47
50
|
end
|
|
48
51
|
|
|
49
52
|
def initialize(argv)
|
|
50
53
|
@pod_spec_file = argv.shift_argument || nil
|
|
51
|
-
|
|
54
|
+
|
|
55
|
+
@options = initialize_options(argv)
|
|
56
|
+
@project_dir = @options[:path]
|
|
52
57
|
|
|
53
58
|
super(argv)
|
|
54
59
|
@additional_args = argv.remainder!
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'highline/import'
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'json'
|
|
4
|
+
require 'pindo/options/options'
|
|
4
5
|
|
|
5
6
|
module Pindo
|
|
6
7
|
class Command
|
|
@@ -37,17 +38,23 @@ module Pindo
|
|
|
37
38
|
CLAide::Argument.new('podspec', true)
|
|
38
39
|
]
|
|
39
40
|
|
|
41
|
+
def self.option_items
|
|
42
|
+
@option_items ||= Pindo::Options::OptionGroup.merge(
|
|
43
|
+
Pindo::Options::PodOptions.select(:path),
|
|
44
|
+
Pindo::Options::CommonOptions.select(:force)
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
40
48
|
def self.options
|
|
41
|
-
|
|
42
|
-
['--p', '指定需要lint的pod库所在目录, 例如 --p=~/Users/xxx/MyPod'],
|
|
43
|
-
['--force', '强制推送,跳过验证步骤(相当于原forcepush命令)'],
|
|
44
|
-
].concat(super)
|
|
49
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
45
50
|
end
|
|
46
51
|
|
|
47
52
|
def initialize(argv)
|
|
48
53
|
@pod_spec_file = argv.shift_argument || nil
|
|
49
|
-
|
|
50
|
-
@
|
|
54
|
+
|
|
55
|
+
@options = initialize_options(argv)
|
|
56
|
+
@project_dir = @options[:path]
|
|
57
|
+
@force_push = @options[:force] || false
|
|
51
58
|
|
|
52
59
|
super(argv)
|
|
53
60
|
@additional_args = argv.remainder!
|
|
@@ -2,6 +2,7 @@ require 'highline/import'
|
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'json'
|
|
4
4
|
require 'pindo/module/xcode/cocoapods_helper'
|
|
5
|
+
require 'pindo/options/options'
|
|
5
6
|
|
|
6
7
|
module Pindo
|
|
7
8
|
class Command
|
|
@@ -32,16 +33,19 @@ module Pindo
|
|
|
32
33
|
|
|
33
34
|
]
|
|
34
35
|
|
|
36
|
+
def self.option_items
|
|
37
|
+
@option_items ||= Pindo::Options::PodOptions.select(:path, :install)
|
|
38
|
+
end
|
|
39
|
+
|
|
35
40
|
def self.options
|
|
36
|
-
|
|
37
|
-
['--install', '更新完lib之后执行pod install, pindo ios podupdate --install'],
|
|
38
|
-
['--p', '指定需要lint的pod库所在目录, 例如 --p=~/Users/xxx/MyPod'],
|
|
39
|
-
].concat(super)
|
|
41
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
40
42
|
end
|
|
41
43
|
|
|
42
44
|
def initialize(argv)
|
|
43
|
-
@
|
|
44
|
-
|
|
45
|
+
@options = initialize_options(argv)
|
|
46
|
+
|
|
47
|
+
@args_install_flag = @options[:install] || false
|
|
48
|
+
@project_dir = @options[:path]
|
|
45
49
|
|
|
46
50
|
@additional_args = argv.remainder!
|
|
47
51
|
super(argv)
|
|
@@ -172,7 +172,7 @@ module Pindo
|
|
|
172
172
|
tasks.each { |task| task_manager.add_task(task) }
|
|
173
173
|
task_manager.start
|
|
174
174
|
|
|
175
|
-
# 6.
|
|
175
|
+
# 6. 输出结果(任务失败时 start 会自动抛出异常;这里仍要求至少成功一个任务)
|
|
176
176
|
report = task_manager.execution_report
|
|
177
177
|
if report[:success] > 0
|
|
178
178
|
puts "\n✅ 消息发送完成!"
|
|
@@ -184,4 +184,4 @@ module Pindo
|
|
|
184
184
|
end
|
|
185
185
|
end
|
|
186
186
|
end
|
|
187
|
-
end
|
|
187
|
+
end
|
|
@@ -165,7 +165,7 @@ module Pindo
|
|
|
165
165
|
tasks.each { |task| task_manager.add_task(task) }
|
|
166
166
|
task_manager.start
|
|
167
167
|
|
|
168
|
-
# 7.
|
|
168
|
+
# 7. 输出结果(任务失败时 start 会自动抛出异常;这里仍要求至少成功一个任务)
|
|
169
169
|
report = task_manager.execution_report
|
|
170
170
|
if report[:success] > 0
|
|
171
171
|
puts "\n✅ 绑定完成! 成功绑定 #{app_version_list.size} 个包到 Git Workflow"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'highline/import'
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'pindo/module/pgyer/pgyerhelper'
|
|
4
|
+
require 'pindo/options/options'
|
|
4
5
|
require 'open-uri'
|
|
5
6
|
|
|
6
7
|
|
|
@@ -34,21 +35,21 @@ module Pindo
|
|
|
34
35
|
|
|
35
36
|
]
|
|
36
37
|
|
|
37
|
-
def self.
|
|
38
|
-
|
|
39
|
-
['--login', '强制再次登录jps网站'],
|
|
40
|
-
['--list', '列出上传记录并选择,用法:pindo jps download --list'],
|
|
41
|
-
['--conf', '指定 JPSBuildConfig.json 配置文件路径,用法:pindo jps download --conf=./JPSBuildConfig.json'],
|
|
42
|
-
].concat(super)
|
|
38
|
+
def self.option_items
|
|
39
|
+
@option_items ||= Pindo::Options::JPSOptions.select(:login, :list, :conf, :index)
|
|
43
40
|
end
|
|
44
41
|
|
|
42
|
+
def self.options
|
|
43
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
44
|
+
end
|
|
45
45
|
|
|
46
46
|
def initialize(argv)
|
|
47
|
+
@options = initialize_options(argv)
|
|
47
48
|
|
|
48
|
-
@args_login_flag =
|
|
49
|
-
@args_list_flag =
|
|
50
|
-
@args_conf =
|
|
51
|
-
@app_version_index =
|
|
49
|
+
@args_login_flag = @options[:login] || false
|
|
50
|
+
@args_list_flag = @options[:list] || false
|
|
51
|
+
@args_conf = @options[:conf]
|
|
52
|
+
@app_version_index = @options[:index]
|
|
52
53
|
|
|
53
54
|
super(argv)
|
|
54
55
|
@additional_args = argv.remainder!
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'highline/import'
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'pindo/module/pgyer/pgyerhelper'
|
|
4
|
+
require 'pindo/options/options'
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
module Pindo
|
|
@@ -31,17 +32,17 @@ module Pindo
|
|
|
31
32
|
|
|
32
33
|
]
|
|
33
34
|
|
|
34
|
-
def self.
|
|
35
|
-
|
|
36
|
-
['--force', '强制重新登录jps'],
|
|
37
|
-
].concat(super)
|
|
35
|
+
def self.option_items
|
|
36
|
+
@option_items ||= Pindo::Options::CommonOptions.select(:force)
|
|
38
37
|
end
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
def self.options
|
|
40
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
41
|
+
end
|
|
41
42
|
|
|
42
43
|
def initialize(argv)
|
|
43
|
-
|
|
44
|
-
@args_login_flag =
|
|
44
|
+
@options = initialize_options(argv)
|
|
45
|
+
@args_login_flag = @options[:force] || false
|
|
45
46
|
|
|
46
47
|
super(argv)
|
|
47
48
|
@additional_args = argv.remainder!
|
|
@@ -25,7 +25,8 @@ module Pindo
|
|
|
25
25
|
支持功能:
|
|
26
26
|
|
|
27
27
|
* 上传ipa/apk/app/exe/html安装包
|
|
28
|
-
* Unity工程自动检测iOS/Android/WebGL/Windows包
|
|
28
|
+
* Unity工程自动检测iOS/Android/WebGL/macOS/Windows包
|
|
29
|
+
* 通过 --types 指定要上传的包类型(与 unity autobuild 一致)
|
|
29
30
|
* 添加版本描述
|
|
30
31
|
* 上传附件
|
|
31
32
|
* 重签名
|
|
@@ -37,6 +38,12 @@ module Pindo
|
|
|
37
38
|
|
|
38
39
|
$ pindo jps upload path/to/setup.exe # 上传 Windows 安装包
|
|
39
40
|
|
|
41
|
+
$ pindo jps upload --types=ipa # 仅上传 IPA
|
|
42
|
+
|
|
43
|
+
$ pindo jps upload --types=ipa,apk # 上传 IPA 和 APK
|
|
44
|
+
|
|
45
|
+
$ pindo jps upload --types=html # 仅上传 WebGL
|
|
46
|
+
|
|
40
47
|
$ pindo jps upload --proj=demo # 上传到指定项目
|
|
41
48
|
|
|
42
49
|
$ pindo jps upload --desc="版本说明" # 添加版本描述
|
|
@@ -59,36 +66,34 @@ module Pindo
|
|
|
59
66
|
# 定义此命令使用的参数项
|
|
60
67
|
def self.option_items
|
|
61
68
|
@option_items ||= Pindo::Options::OptionGroup.merge(
|
|
62
|
-
Pindo::Options::
|
|
69
|
+
Pindo::Options::BuildOptions.select(:types),
|
|
70
|
+
Pindo::Options::JPSOptions.select(:conf, :send, :desc, :resign, :login, :file, :attach),
|
|
63
71
|
Pindo::Options::GitOptions.all
|
|
64
72
|
)
|
|
65
73
|
end
|
|
66
74
|
|
|
67
75
|
def self.options
|
|
68
|
-
|
|
69
|
-
['--login', '强制再次登录jps网站'],
|
|
70
|
-
['--ipa', '强制指定上传的ipa文件'],
|
|
71
|
-
['--attach', '指定需要和ipa一起上传的附件'],
|
|
72
|
-
].concat(option_items.map(&:to_claide_option)).concat(super)
|
|
76
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
73
77
|
end
|
|
74
78
|
|
|
75
79
|
|
|
76
80
|
def initialize(argv)
|
|
77
81
|
@args_ipa_file = argv.shift_argument
|
|
78
|
-
@ipa_file = argv.option('ipa')
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
# 使用 Options 系统解析参数
|
|
84
|
+
@options = initialize_options(argv)
|
|
85
|
+
|
|
86
|
+
file_option = @options[:file]
|
|
87
|
+
if !file_option.nil?
|
|
88
|
+
@args_ipa_file = file_option
|
|
82
89
|
end
|
|
83
90
|
if @args_ipa_file && !@args_ipa_file.empty?
|
|
84
91
|
@args_ipa_file = @args_ipa_file.strip.gsub(/\"/, '')
|
|
85
92
|
end
|
|
86
93
|
|
|
87
|
-
@args_login_flag =
|
|
88
|
-
@args_attach_name =
|
|
89
|
-
|
|
90
|
-
# 使用 Options 系统解析参数
|
|
91
|
-
@options = initialize_options(argv)
|
|
94
|
+
@args_login_flag = @options[:login] || false
|
|
95
|
+
@args_attach_name = @options[:attach]
|
|
96
|
+
@args_types = @options[:types]
|
|
92
97
|
|
|
93
98
|
# JPS 参数
|
|
94
99
|
@args_conf = @options[:conf]
|
|
@@ -283,22 +288,39 @@ module Pindo
|
|
|
283
288
|
end
|
|
284
289
|
end
|
|
285
290
|
|
|
291
|
+
# 解析 --types 参数,返回允许的类型数组,nil 表示不限制
|
|
292
|
+
def parse_types_filter
|
|
293
|
+
return nil unless @args_types
|
|
294
|
+
|
|
295
|
+
available_types = %w[ipa apk html mac exe]
|
|
296
|
+
types = @args_types.downcase.split(',').map(&:strip)
|
|
297
|
+
|
|
298
|
+
invalid_types = types - available_types
|
|
299
|
+
unless invalid_types.empty?
|
|
300
|
+
raise Informative, "无效的包类型: #{invalid_types.join(', ')}。可用类型: #{available_types.join(', ')}"
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
types
|
|
304
|
+
end
|
|
305
|
+
|
|
286
306
|
# 查找并确认 Unity 包(可能有多个平台)
|
|
287
307
|
def find_and_confirm_unity_packages(project_dir, tasks)
|
|
308
|
+
types_filter = parse_types_filter
|
|
309
|
+
|
|
288
310
|
# 1. 查找所有平台的文件
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
found_files
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
311
|
+
all_candidates = [
|
|
312
|
+
{ file: find_unity_ios_package(project_dir), type: 'ipa', name: 'iOS' },
|
|
313
|
+
{ file: find_unity_macos_package(project_dir), type: 'mac', name: 'macOS' },
|
|
314
|
+
{ file: find_unity_android_package(project_dir), type: 'apk', name: 'Android' },
|
|
315
|
+
{ file: find_unity_webgl_package(project_dir), type: 'html', name: 'WebGL' },
|
|
316
|
+
{ file: find_unity_windows_package(project_dir), type: 'exe', name: 'Windows' }
|
|
317
|
+
]
|
|
318
|
+
|
|
319
|
+
# 2. 过滤:去掉未找到的文件,按 --types 过滤
|
|
320
|
+
found_files = all_candidates.select { |info| info[:file] }
|
|
321
|
+
if types_filter
|
|
322
|
+
found_files = found_files.select { |info| types_filter.include?(info[:type]) }
|
|
323
|
+
end
|
|
302
324
|
|
|
303
325
|
# 3. 如果没有找到任何文件,直接返回
|
|
304
326
|
return if found_files.empty?
|
|
@@ -440,10 +462,13 @@ module Pindo
|
|
|
440
462
|
windows_files.max_by {|f| File.mtime(f)} if windows_files.any?
|
|
441
463
|
end
|
|
442
464
|
|
|
443
|
-
#
|
|
465
|
+
# 确认文件(交互式,设置 PINDO_AUTO_CONFIRM 时自动确认)
|
|
444
466
|
def confirm_file(file_path)
|
|
445
|
-
|
|
446
|
-
|
|
467
|
+
if ENV['PINDO_AUTO_CONFIRM'] && !ENV['PINDO_AUTO_CONFIRM'].empty?
|
|
468
|
+
puts "自动确认上传文件: #{file_path}"
|
|
469
|
+
return true
|
|
470
|
+
end
|
|
471
|
+
agree("需要上传文件: #{file_path} ?(Y/n)")
|
|
447
472
|
end
|
|
448
473
|
|
|
449
474
|
# 根据文件扩展名确定文件类型
|
data/lib/pindo/command/repo.rb
CHANGED
|
@@ -101,10 +101,10 @@ module Pindo
|
|
|
101
101
|
# 定义此命令使用的参数项
|
|
102
102
|
def self.option_items
|
|
103
103
|
@option_items ||= Pindo::Options::OptionGroup.merge(
|
|
104
|
-
Pindo::Options::BuildOptions.select(:bundleid, :bundle_name
|
|
104
|
+
Pindo::Options::BuildOptions.select(:bundleid, :bundle_name, :types, :release, :adhoc, :skipclean, :skipvalidate, :injectsigning),
|
|
105
105
|
Pindo::Options::JPSOptions.select(:conf, :upload, :send, :media, :bind),
|
|
106
106
|
Pindo::Options::UnityOptions.select(:skiplib, :skipyoo, :kill_unity),
|
|
107
|
-
Pindo::Options::UnityOptions.select_with_defaults(
|
|
107
|
+
Pindo::Options::UnityOptions.select_with_defaults(skipmacro: true),
|
|
108
108
|
Pindo::Options::TaskOptions.select(:multi),
|
|
109
109
|
Pindo::Options::GitOptions.all
|
|
110
110
|
)
|
|
@@ -112,12 +112,7 @@ module Pindo
|
|
|
112
112
|
|
|
113
113
|
# 命令选项
|
|
114
114
|
def self.options
|
|
115
|
-
|
|
116
|
-
['--types=TYPES', '指定要构建的类型,逗号分隔(如:ipa,apk,html),默认全部类型'],
|
|
117
|
-
['--adhoc', '使用AdHoc证书打包iOS(默认使用Dev证书)'],
|
|
118
|
-
['--deploy', '使用发布证书打包iOS'],
|
|
119
|
-
['--release', '使用Release模式构建Android(默认使用Debug)']
|
|
120
|
-
].concat(option_items.map(&:to_claide_option)).concat(super)
|
|
115
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
121
116
|
end
|
|
122
117
|
|
|
123
118
|
|
|
@@ -125,12 +120,11 @@ module Pindo
|
|
|
125
120
|
@options = initialize_options(argv)
|
|
126
121
|
|
|
127
122
|
@args_conf = @options[:conf]
|
|
128
|
-
@args_adhoc_flag =
|
|
129
|
-
@
|
|
130
|
-
@args_release_flag = argv.flag?('release', false)
|
|
123
|
+
@args_adhoc_flag = @options[:adhoc] || false
|
|
124
|
+
@args_release_flag = @options[:release] || false
|
|
131
125
|
@args_bundle_id = @options[:bundleid] # 从 @options 获取,确保能被缓存
|
|
132
126
|
@args_bundle_name = @options[:bundle_name] # 从 @options 获取,确保能被缓存
|
|
133
|
-
@args_types =
|
|
127
|
+
@args_types = @options[:types]
|
|
134
128
|
|
|
135
129
|
# send、media 或 bind 都依赖 upload:如果指定了任一参数,自动启用 upload
|
|
136
130
|
@args_upload_flag = @options[:send] || @options[:bind] || @options[:media] || @options[:upload]
|
|
@@ -201,38 +195,36 @@ module Pindo
|
|
|
201
195
|
raise Informative, "当前目录不是Unity工程,请在Unity工程根目录下执行此命令"
|
|
202
196
|
end
|
|
203
197
|
|
|
204
|
-
|
|
205
|
-
|
|
198
|
+
begin
|
|
199
|
+
# 加载 JPS 配置(缓存 project_name,并通过映射表解析 bundle_id)
|
|
200
|
+
Pindo::BuildHelper.share_instance.load_jps_build_config(pindo_project_dir, conf: @args_conf)
|
|
206
201
|
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
# 1. 获取要构建的类型列表
|
|
203
|
+
selected_platforms = get_selected_build_types()
|
|
209
204
|
|
|
210
|
-
|
|
211
|
-
|
|
205
|
+
# 2. 按平台顺序准备所有配置(iOS → Android → Web)
|
|
206
|
+
all_platform_configs = prepare_all_platform_configs(selected_platforms)
|
|
212
207
|
|
|
213
|
-
|
|
214
|
-
|
|
208
|
+
# 3. 按平台顺序创建所有任务(包含 GitTagTask)
|
|
209
|
+
all_tasks = make_task_with_config(selected_platforms, all_platform_configs)
|
|
215
210
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
211
|
+
# 4. 统一添加到任务管理器并执行
|
|
212
|
+
task_manager = Pindo::TaskSystem::TaskManager.instance
|
|
213
|
+
task_manager.clear_all # 清空之前的任务
|
|
219
214
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
# # 启用输出管理(自动处理多线程日志隔离)
|
|
226
|
-
# task_manager.enable_output_management(
|
|
227
|
-
# log_dir: File.join(pindo_project_dir, 'pindo_logs'),
|
|
228
|
-
# max_lines_per_task: 0
|
|
229
|
-
# )
|
|
215
|
+
# 按顺序添加所有任务
|
|
216
|
+
all_tasks.each do |task|
|
|
217
|
+
task_manager.add_task(task)
|
|
218
|
+
end
|
|
230
219
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
220
|
+
# 执行任务(根据 --multi 参数决定模式)
|
|
221
|
+
if @args_multi_flag
|
|
222
|
+
task_manager.start(mode: :concurrent, max_workers: 3)
|
|
223
|
+
else
|
|
224
|
+
task_manager.start(mode: :serial)
|
|
225
|
+
end
|
|
226
|
+
ensure
|
|
227
|
+
Pindo::Options::GlobalOptionsState.instance.clear
|
|
236
228
|
end
|
|
237
229
|
end
|
|
238
230
|
|
|
@@ -594,7 +586,7 @@ module Pindo
|
|
|
594
586
|
|
|
595
587
|
# prepare_upload 可能会创建/更新 JPSBuildConfig.json(尤其是首次执行)
|
|
596
588
|
# 这里需要重新加载一次,以便通过映射表解析出 bundleid/bundle_name
|
|
597
|
-
Pindo::BuildHelper.share_instance.load_jps_build_config(Dir.pwd)
|
|
589
|
+
Pindo::BuildHelper.share_instance.load_jps_build_config(Dir.pwd, conf: @args_conf)
|
|
598
590
|
|
|
599
591
|
# 保存 app_info_obj 到共享配置(所有平台共享同一个项目)
|
|
600
592
|
if configs["app_info_obj"].nil?
|
|
@@ -618,7 +610,7 @@ module Pindo
|
|
|
618
610
|
cached = Pindo::Options::GlobalOptionsState.instance[:bundleid]
|
|
619
611
|
if cached && !cached.empty?
|
|
620
612
|
platform_config["bundle_id"] = cached
|
|
621
|
-
elsif @
|
|
613
|
+
elsif @args_release_flag
|
|
622
614
|
platform_config["bundle_id"] = get_selected_deploy_bundleid()
|
|
623
615
|
else
|
|
624
616
|
platform_config["bundle_id"] = get_selected_dev_bundleid()
|
|
@@ -745,7 +737,7 @@ module Pindo
|
|
|
745
737
|
case platform
|
|
746
738
|
when 'ios'
|
|
747
739
|
# iOS 支持 dev/adhoc/release
|
|
748
|
-
return :release if @
|
|
740
|
+
return :release if @args_release_flag
|
|
749
741
|
return :adhoc if @args_adhoc_flag
|
|
750
742
|
return :dev
|
|
751
743
|
when 'android'
|
|
@@ -48,20 +48,26 @@ module Pindo
|
|
|
48
48
|
]
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def self.option_items
|
|
52
|
+
@option_items ||= Pindo::Options::OptionGroup.merge(
|
|
53
|
+
Pindo::Options::UtilsOptions.select(:nupkg),
|
|
54
|
+
Pindo::Options::CommonOptions.select(:force)
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
51
58
|
def self.options
|
|
52
|
-
|
|
53
|
-
['--nupkg', '指定要上传的 .nupkg 文件路径'],
|
|
54
|
-
['--force', '跳过确认,直接上传(等同于设置 NUGET_UPLOAD_FORCE=1)'],
|
|
55
|
-
].concat(super)
|
|
59
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
56
60
|
end
|
|
57
61
|
|
|
58
62
|
def initialize(argv)
|
|
59
63
|
@args_nupkg_file = argv.shift_argument
|
|
60
|
-
@nupkg_file = argv.option('nupkg')
|
|
61
|
-
@force_flag = argv.flag?('force', false)
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
@options = initialize_options(argv)
|
|
66
|
+
@force_flag = @options[:force] || false
|
|
67
|
+
nupkg_option = @options[:nupkg]
|
|
68
|
+
|
|
69
|
+
if !nupkg_option.nil?
|
|
70
|
+
@args_nupkg_file = nupkg_option
|
|
65
71
|
end
|
|
66
72
|
if @args_nupkg_file && !@args_nupkg_file.empty?
|
|
67
73
|
@args_nupkg_file = @args_nupkg_file.strip.gsub(/\"/, '')
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'fileutils'
|
|
2
2
|
require 'pindo/module/cert/cert_helper'
|
|
3
|
+
require 'pindo/options/options'
|
|
3
4
|
|
|
4
5
|
module Pindo
|
|
5
6
|
class Command
|
|
@@ -50,24 +51,25 @@ module Pindo
|
|
|
50
51
|
|
|
51
52
|
]
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
['--fixedid', '重新更新bundle id的功能,检查bundle id的功能是否更新'],
|
|
59
|
-
['--renew', '重新生成证书']
|
|
60
|
-
].concat(super)
|
|
54
|
+
def self.option_items
|
|
55
|
+
@option_items ||= Pindo::Options::OptionGroup.merge(
|
|
56
|
+
Pindo::Options::UtilsOptions.select(:fast, :fixedid),
|
|
57
|
+
Pindo::Options::CertOptions.select(:upload, :renew)
|
|
58
|
+
)
|
|
61
59
|
end
|
|
62
60
|
|
|
61
|
+
def self.options
|
|
62
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
63
|
+
end
|
|
63
64
|
|
|
64
65
|
def initialize(argv)
|
|
66
|
+
@options = initialize_options(argv)
|
|
65
67
|
|
|
66
|
-
@fast_flag =
|
|
67
|
-
@fixedid_flag =
|
|
68
|
-
@upload_flag =
|
|
69
|
-
@renew_cert_flag =
|
|
70
|
-
super
|
|
68
|
+
@fast_flag = @options[:fast] || false
|
|
69
|
+
@fixedid_flag = @options[:fixedid] || false
|
|
70
|
+
@upload_flag = @options[:upload] || false
|
|
71
|
+
@renew_cert_flag = @options[:renew] || false
|
|
72
|
+
super
|
|
71
73
|
|
|
72
74
|
end
|
|
73
75
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'highline/import'
|
|
2
2
|
require 'fileutils'
|
|
3
|
+
require 'pindo/options/options'
|
|
3
4
|
|
|
4
5
|
module Pindo
|
|
5
6
|
class Command
|
|
@@ -27,19 +28,24 @@ module Pindo
|
|
|
27
28
|
# 命令的参数列表
|
|
28
29
|
self.arguments = []
|
|
29
30
|
|
|
31
|
+
def self.option_items
|
|
32
|
+
@option_items ||= Pindo::Options::UtilsOptions.select(:mode, :retag)
|
|
33
|
+
end
|
|
34
|
+
|
|
30
35
|
def self.options
|
|
31
|
-
|
|
32
|
-
].concat(super)
|
|
36
|
+
option_items.map(&:to_claide_option).concat(super)
|
|
33
37
|
end
|
|
34
38
|
|
|
35
39
|
def initialize(argv)
|
|
36
|
-
@
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
@options = initialize_options(argv)
|
|
41
|
+
|
|
42
|
+
@mode = @options[:mode] || 'minor'
|
|
43
|
+
@force_retag = @options[:retag] || false
|
|
44
|
+
|
|
39
45
|
unless ['major', 'minor', 'patch'].include?(@mode)
|
|
40
46
|
raise Informative, "mode参数必须是 major, minor 或 patch"
|
|
41
47
|
end
|
|
42
|
-
|
|
48
|
+
|
|
43
49
|
super
|
|
44
50
|
@additional_args = argv.remainder!
|
|
45
51
|
end
|
data/lib/pindo/command/utils.rb
CHANGED
|
@@ -7,16 +7,16 @@ require 'pindo/command/utils/device'
|
|
|
7
7
|
# require 'pindo/command/utils/tgate'
|
|
8
8
|
# require 'pindo/command/utils/boss'
|
|
9
9
|
require 'pindo/command/utils/renewcert'
|
|
10
|
-
require 'pindo/command/utils/renewbundleid'
|
|
11
|
-
require 'pindo/command/utils/copyconfig'
|
|
12
|
-
require 'pindo/command/utils/allcopyconfig'
|
|
10
|
+
# require 'pindo/command/utils/renewbundleid'
|
|
11
|
+
# require 'pindo/command/utils/copyconfig'
|
|
12
|
+
# require 'pindo/command/utils/allcopyconfig'
|
|
13
13
|
require 'pindo/command/utils/repoinit'
|
|
14
|
-
require 'pindo/command/utils/tag'
|
|
14
|
+
# require 'pindo/command/utils/tag'
|
|
15
15
|
require 'pindo/command/utils/updateconfig'
|
|
16
16
|
require 'pindo/command/utils/fabric'
|
|
17
|
-
require 'pindo/command/utils/encrypt'
|
|
18
|
-
require 'pindo/command/utils/decrypt'
|
|
19
|
-
require 'pindo/command/utils/installskills'
|
|
17
|
+
# require 'pindo/command/utils/encrypt'
|
|
18
|
+
# require 'pindo/command/utils/decrypt'
|
|
19
|
+
# require 'pindo/command/utils/installskills'
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
module Pindo
|