pindo 5.11.4 → 5.12.2
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/base/githelper.rb +16 -0
- data/lib/pindo/base/pindocontext.rb +13 -4
- data/lib/pindo/command/android/autobuild.rb +108 -185
- data/lib/pindo/command/android/build.rb +10 -2
- data/lib/pindo/command/ios/autobuild.rb +116 -213
- data/lib/pindo/command/ios/build.rb +12 -3
- data/lib/pindo/command/jps/upload.rb +253 -118
- data/lib/pindo/command/unity/autobuild.rb +297 -227
- data/lib/pindo/command/unity.rb +0 -3
- data/lib/pindo/command/utils/boss.rb +18 -15
- data/lib/pindo/command/utils/clearcert.rb +26 -18
- data/lib/pindo/command/utils/device.rb +28 -19
- data/lib/pindo/command/utils/feishu.rb +11 -4
- data/lib/pindo/command/utils/icon.rb +26 -20
- data/lib/pindo/command/utils/renewcert.rb +35 -29
- data/lib/pindo/command/utils/renewproj.rb +32 -25
- data/lib/pindo/command/utils/repoinit.rb +1 -1
- data/lib/pindo/command/utils/tag.rb +6 -180
- data/lib/pindo/command/utils/tgate.rb +34 -28
- data/lib/pindo/command/utils/xcassets.rb +30 -20
- data/lib/pindo/command/web/autobuild.rb +148 -128
- data/lib/pindo/module/android/android_build_helper.rb +0 -6
- data/lib/pindo/module/android/android_config_helper.rb +4 -26
- data/lib/pindo/module/build/build_helper.rb +18 -294
- data/lib/pindo/module/build/git_repo_helper.rb +530 -0
- data/lib/pindo/module/build/icon_downloader.rb +85 -0
- data/lib/pindo/module/pgyer/pgyerhelper.rb +16 -11
- data/lib/pindo/module/task/model/build/android_dev_build_task.rb +209 -0
- data/lib/pindo/module/task/model/build/android_release_build_task.rb +29 -0
- data/lib/pindo/module/task/model/build/ios_adhoc_build_task.rb +53 -0
- data/lib/pindo/module/task/model/build/ios_dev_build_task.rb +251 -0
- data/lib/pindo/module/task/model/build/ios_release_build_task.rb +53 -0
- data/lib/pindo/module/task/model/build/web_dev_build_task.rb +43 -0
- data/lib/pindo/module/task/model/build_task.rb +125 -301
- data/lib/pindo/module/task/model/git_tag_task.rb +80 -0
- data/lib/pindo/module/task/model/unity_export_task.rb +53 -41
- data/lib/pindo/module/task/model/upload_task.rb +149 -208
- data/lib/pindo/module/task/pindo_task.rb +135 -95
- data/lib/pindo/module/task/task_manager.rb +202 -352
- data/lib/pindo/module/unity/unity_helper.rb +7 -3
- data/lib/pindo/module/xcode/xcode_build_config.rb +4 -10
- data/lib/pindo/module/xcode/xcode_build_helper.rb +19 -0
- data/lib/pindo/version.rb +1 -1
- metadata +10 -4
- data/lib/pindo/command/unity/apk.rb +0 -185
- data/lib/pindo/command/unity/ipa.rb +0 -198
- data/lib/pindo/command/unity/web.rb +0 -163
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
require 'highline/import'
|
|
2
|
-
require 'xcodeproj'
|
|
3
|
-
require 'find'
|
|
4
|
-
require 'fileutils'
|
|
5
|
-
require 'pindo/base/executable'
|
|
6
|
-
require 'pindo/module/unity/unity_helper'
|
|
7
|
-
require 'pindo/module/build/build_helper'
|
|
8
|
-
|
|
9
|
-
module Pindo
|
|
10
|
-
class Command
|
|
11
|
-
class Unity < Command
|
|
12
|
-
class Web < Unity
|
|
13
|
-
|
|
14
|
-
include Appselect
|
|
15
|
-
|
|
16
|
-
include Pindo::Githelper
|
|
17
|
-
# Unity WebGL包编译和上传命令
|
|
18
|
-
self.summary = 'Unity工程编译Web(优先使用pindo web autobuild命令)'
|
|
19
|
-
|
|
20
|
-
# 启用缓存机制
|
|
21
|
-
def self.use_cache?
|
|
22
|
-
true # 此命令启用缓存
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# 详细说明
|
|
26
|
-
self.description = <<-DESC
|
|
27
|
-
Unity工程编译Web(优先使用pindo web autobuild命令)
|
|
28
|
-
|
|
29
|
-
支持功能:
|
|
30
|
-
|
|
31
|
-
* 自动检测Unity版本
|
|
32
|
-
|
|
33
|
-
* 编译生成WebGL包
|
|
34
|
-
|
|
35
|
-
* 支持上传到JPS测试平台
|
|
36
|
-
|
|
37
|
-
* 支持发送测试通知
|
|
38
|
-
|
|
39
|
-
* 支持CI/CD自动化构建
|
|
40
|
-
|
|
41
|
-
使用示例:
|
|
42
|
-
|
|
43
|
-
$ pindo unity web # 编译WebGL
|
|
44
|
-
|
|
45
|
-
$ pindo unity web --upload # 编译并上传到JPS
|
|
46
|
-
|
|
47
|
-
$ pindo unity web --send # 编译、上传并发送通知
|
|
48
|
-
|
|
49
|
-
$ pindo unity web --proj="My App" # 指定项目名称
|
|
50
|
-
|
|
51
|
-
$ pindo unity web --base # Unity lib模式
|
|
52
|
-
DESC
|
|
53
|
-
|
|
54
|
-
# 命令参数
|
|
55
|
-
self.arguments = [
|
|
56
|
-
# 暂无参数
|
|
57
|
-
]
|
|
58
|
-
|
|
59
|
-
# 命令选项
|
|
60
|
-
def self.options
|
|
61
|
-
[
|
|
62
|
-
['--proj', '指定上传到测试平台的项目名称'],
|
|
63
|
-
['--upload', '上传编译后的WebGL到测试平台(上传成功后会自动发送消息给自己)'],
|
|
64
|
-
['--send', '发送消息到项目群(注意:不带此参数也会发送给自己)'],
|
|
65
|
-
['--base', 'Unity工程编译lib模式'],
|
|
66
|
-
['--unity-version', '切换Unity版本']
|
|
67
|
-
].concat(super)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def initialize(argv)
|
|
72
|
-
|
|
73
|
-
@args_proj_name = argv.option('proj')
|
|
74
|
-
@args_upload_flag = argv.flag?('upload', false)
|
|
75
|
-
@args_send_flag = argv.flag?('send', false)
|
|
76
|
-
@args_deploy_flag = argv.flag?('deploy', false)
|
|
77
|
-
@args_base_flag = argv.flag?('base', false)
|
|
78
|
-
@force_select_unity = argv.flag?('unity-version', false)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if @args_send_flag
|
|
82
|
-
@args_upload_flag = true
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
super
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def run
|
|
90
|
-
pindo_project_dir = Dir.pwd
|
|
91
|
-
|
|
92
|
-
# 加载 JPS 配置(如果存在)
|
|
93
|
-
context = Pindo::PindoContext.instance
|
|
94
|
-
context.load_and_apply_jps_config(pindo_project_dir)
|
|
95
|
-
|
|
96
|
-
# 确认并应用缓存(如果有)
|
|
97
|
-
context.confirm_and_apply_cache
|
|
98
|
-
|
|
99
|
-
# 检查是否是Unity工程
|
|
100
|
-
unity_helper = Pindo::Client::UnityHelper.share_instance
|
|
101
|
-
unless unity_helper.unity_project?(pindo_project_dir)
|
|
102
|
-
raise Informative, "当前目录不是Unity工程,请在Unity工程根目录下执行此命令"
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
if @args_upload_flag
|
|
106
|
-
build_helper = Pindo::BuildHelper.share_instance
|
|
107
|
-
is_need_add_tag,tag_action_parms = build_helper.check_is_need_add_tag?(pindo_project_dir)
|
|
108
|
-
if is_need_add_tag
|
|
109
|
-
Pindo::Command::Utils::Tag::run(tag_action_parms)
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
project_unity_version = unity_helper.get_unity_version(pindo_project_dir)
|
|
114
|
-
puts
|
|
115
|
-
puts "工程的Unity版本: #{project_unity_version}"
|
|
116
|
-
unity_exe_path = unity_helper.find_unity_path(project_unity_version:project_unity_version, force_change_version: @force_select_unity)
|
|
117
|
-
puts "选择的Unity路径: #{unity_exe_path}"
|
|
118
|
-
puts
|
|
119
|
-
|
|
120
|
-
app_info_obj = nil
|
|
121
|
-
workflow_info = nil
|
|
122
|
-
proj_name = @args_proj_name
|
|
123
|
-
# 传入 package_type 获取 workflow_info
|
|
124
|
-
app_info_obj, workflow_info = PgyerHelper.share_instace.prepare_upload(
|
|
125
|
-
working_directory: Dir.pwd,
|
|
126
|
-
proj_name: proj_name,
|
|
127
|
-
package_type: 'zip'
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
isLibrary = @args_base_flag
|
|
132
|
-
|
|
133
|
-
ios_export_lib_dir = File.join(pindo_project_dir, "GoodPlatform/BaseiOS")
|
|
134
|
-
if File.directory?(ios_export_lib_dir)
|
|
135
|
-
isLibrary = true
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
pindo_ios_project_dir = File.join(pindo_project_dir, "GoodPlatform/iOS")
|
|
139
|
-
if isLibrary
|
|
140
|
-
pindo_ios_project_dir = ios_export_lib_dir
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
# 获取 ipaCount 用于传递给 Unity 构建
|
|
144
|
-
ipa_count = app_info_obj&.dig("ipaCount") || -1
|
|
145
|
-
|
|
146
|
-
begin
|
|
147
|
-
unity_helper.build_project(unity_exe_full_path:unity_exe_path, project_path:pindo_project_dir, platform:'iOS', isLibrary:isLibrary, indexNo:ipa_count)
|
|
148
|
-
rescue => e
|
|
149
|
-
Funlog.instance.fancyinfo_error("调用GoodUnityBuild导出工程失败!")
|
|
150
|
-
Funlog.instance.fancyinfo_error("错误信息: #{e.message}")
|
|
151
|
-
raise e
|
|
152
|
-
end
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
end
|
|
161
|
-
end
|
|
162
|
-
end
|
|
163
|
-
end
|