pindo 5.11.3 → 5.12.1
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 +111 -184
- data/lib/pindo/command/android/build.rb +10 -2
- data/lib/pindo/command/ios/autobuild.rb +115 -210
- data/lib/pindo/command/ios/build.rb +12 -3
- data/lib/pindo/command/jps/upload.rb +257 -117
- data/lib/pindo/command/unity/autobuild.rb +308 -220
- 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 +519 -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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 298ff00b838b7929bf82b9d0f1751afa68a7aa09cb00b3aa64991b807cb101f8
|
|
4
|
+
data.tar.gz: 21ae02b4b9edc916262eb1a72ed417e7fd875454a6870af99bfb699d404f7783
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ccc097a2e5400394bcdcb3dfffc44bb366ff590163af4643d6e5be910884127e15c589c94b5fe408844c7de4eeff4a9e3830c0303f1399e2a82076484122e5a9
|
|
7
|
+
data.tar.gz: 342289896b13603e77226b8d6ef18a8c1549b8fe265050ba3f9e869b3c3f7e327f5623aa300b0dbdef526a39f839977cb55837d2fa209ab48e214937b7738e98
|
|
@@ -5,6 +5,11 @@ require 'pindo/module/build/build_helper'
|
|
|
5
5
|
require 'pindo/module/build/version_helper'
|
|
6
6
|
require 'pindo/module/android/android_build_helper'
|
|
7
7
|
require 'pindo/module/android/android_config_helper'
|
|
8
|
+
require 'pindo/module/task/task_manager'
|
|
9
|
+
require 'pindo/module/task/model/git_tag_task'
|
|
10
|
+
require 'pindo/module/task/model/unity_export_task'
|
|
11
|
+
require 'pindo/module/task/model/build_task'
|
|
12
|
+
require 'pindo/module/task/model/upload_task'
|
|
8
13
|
|
|
9
14
|
module Pindo
|
|
10
15
|
class Command
|
|
@@ -85,214 +90,136 @@ module Pindo
|
|
|
85
90
|
# 确认并应用缓存(如果有)
|
|
86
91
|
context.confirm_and_apply_cache
|
|
87
92
|
|
|
93
|
+
# 准备配置
|
|
94
|
+
config = prepare_android_config(pindo_project_dir)
|
|
88
95
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
@main_bundle_name = @args_bundle_name
|
|
92
|
-
else
|
|
93
|
-
@main_bundle_name = get_selected_dev_bundle_name()
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
+
# 创建并执行任务
|
|
97
|
+
tasks = make_build_task(config)
|
|
96
98
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
args_temp << "--bundle_name=#{@main_bundle_name}" if @main_bundle_name
|
|
103
|
-
args_temp << "--upload" if @args_upload_flag
|
|
104
|
-
args_temp << "--send" if @args_send_flag
|
|
99
|
+
# 添加到任务管理器并执行
|
|
100
|
+
task_manager = Pindo::TaskSystem::TaskManager.instance
|
|
101
|
+
task_manager.clear_all
|
|
102
|
+
tasks.each { |task| task_manager.add_task(task) }
|
|
103
|
+
task_manager.start
|
|
105
104
|
|
|
106
|
-
|
|
107
|
-
when :ios
|
|
108
|
-
puts "iOS 工程, 请使用 pindo ios build"
|
|
109
|
-
when :android
|
|
110
|
-
android_autobuild
|
|
111
|
-
when :unity
|
|
112
|
-
Pindo::Command::Unity::Apk::run(args_temp)
|
|
113
|
-
else
|
|
114
|
-
raise Informative, "当前目录不是工程目录,不能编译"
|
|
115
|
-
end
|
|
105
|
+
system "open #{pindo_project_dir}"
|
|
116
106
|
end
|
|
117
107
|
|
|
118
108
|
private
|
|
119
109
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
pindo_project_dir = Dir.pwd
|
|
110
|
+
# 准备 Android 配置
|
|
111
|
+
def prepare_android_config(pindo_project_dir)
|
|
112
|
+
# 获取 Bundle Name
|
|
113
|
+
bundle_name = @args_bundle_name || get_selected_dev_bundle_name()
|
|
125
114
|
|
|
126
|
-
|
|
127
|
-
if @args_upload_flag
|
|
128
|
-
is_need_add_tag,tag_action_parms = build_helper.check_is_need_add_tag?(pindo_project_dir)
|
|
129
|
-
if is_need_add_tag
|
|
130
|
-
Pindo::Command::Utils::Tag::run(tag_action_parms)
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
app_info_obj = nil
|
|
137
|
-
workflow_info = nil
|
|
138
|
-
proj_name = @args_proj_name
|
|
139
|
-
# 传入 package_type 获取 workflow_info
|
|
115
|
+
# 获取 JPS 配置
|
|
140
116
|
app_info_obj, workflow_info = PgyerHelper.share_instace.prepare_upload(
|
|
141
|
-
working_directory:
|
|
142
|
-
proj_name:
|
|
117
|
+
working_directory: pindo_project_dir,
|
|
118
|
+
proj_name: @args_proj_name,
|
|
143
119
|
package_type: 'apk'
|
|
144
120
|
)
|
|
145
121
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
# 一次性更新 App Name、Application ID 和 URL Schemes
|
|
154
|
-
Pindo::AndroidConfigHelper.update_project_with_workflow(
|
|
155
|
-
project_dir: pindo_project_dir,
|
|
156
|
-
workflow_packname: workflow_packname
|
|
157
|
-
)
|
|
158
|
-
else
|
|
159
|
-
raise Informative, "未获取到工作流信息"
|
|
160
|
-
end
|
|
122
|
+
{
|
|
123
|
+
project_path: pindo_project_dir,
|
|
124
|
+
bundle_name: bundle_name,
|
|
125
|
+
app_info_obj: app_info_obj,
|
|
126
|
+
workflow_info: workflow_info
|
|
127
|
+
}
|
|
128
|
+
end
|
|
161
129
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
)
|
|
130
|
+
# 创建构建任务
|
|
131
|
+
def make_build_task(config)
|
|
132
|
+
# 检测项目类型
|
|
133
|
+
build_helper = Pindo::BuildHelper.share_instance
|
|
134
|
+
project_type = build_helper.project_type(config[:project_path])
|
|
168
135
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
136
|
+
case project_type
|
|
137
|
+
when :ios
|
|
138
|
+
raise Informative, "iOS 工程, 请使用 pindo ios build"
|
|
139
|
+
when :android, :unity
|
|
140
|
+
# 判断是否是 Unity 工程
|
|
141
|
+
is_unity = (project_type == :unity)
|
|
142
|
+
|
|
143
|
+
tasks = []
|
|
144
|
+
|
|
145
|
+
# 1. Git 标签任务(如果需要上传)
|
|
146
|
+
if @args_upload_flag
|
|
147
|
+
git_tag_task = Pindo::TaskSystem::GitTagTask.new(
|
|
148
|
+
config[:project_path]
|
|
149
|
+
)
|
|
150
|
+
tasks << git_tag_task
|
|
172
151
|
end
|
|
173
|
-
else
|
|
174
|
-
Funlog.warning("未配置 Icon URL,跳过 Icon 替换")
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
# ===== 更新版本号和Build号(仅在Git仓库中)=====
|
|
178
|
-
version_helper = Pindo::VersionHelper.share_instance
|
|
179
|
-
version_info = version_helper.get_version_info(project_dir: pindo_project_dir)
|
|
180
|
-
|
|
181
|
-
if version_info[:is_git_repo]
|
|
182
|
-
# 更新Android工程版本
|
|
183
|
-
Pindo::AndroidConfigHelper.update_android_project_version(
|
|
184
|
-
project_dir: pindo_project_dir,
|
|
185
|
-
version_name: version_info[:version],
|
|
186
|
-
version_code: version_info[:build_number]
|
|
187
|
-
)
|
|
188
|
-
else
|
|
189
|
-
Funlog.warning("非Git仓库,保持工程原有版本号")
|
|
190
|
-
end
|
|
191
152
|
|
|
153
|
+
# 2. Unity 导出任务(仅 Unity 工程)
|
|
154
|
+
if is_unity
|
|
155
|
+
# 确定 Android 导出路径
|
|
156
|
+
base_android_path = File.join(config[:project_path], "GoodPlatform", "BaseAndroid")
|
|
157
|
+
android_path = File.join(config[:project_path], "GoodPlatform", "Android")
|
|
158
|
+
android_export_path = File.exist?(base_android_path) ? base_android_path : android_path
|
|
159
|
+
|
|
160
|
+
unity_context = {}
|
|
161
|
+
unity_context[:project_name] = @args_proj_name if @args_proj_name
|
|
162
|
+
|
|
163
|
+
unity_task = Pindo::TaskSystem::UnityExportTask.new(
|
|
164
|
+
'android',
|
|
165
|
+
project_path: config[:project_path],
|
|
166
|
+
export_path: android_export_path,
|
|
167
|
+
context: unity_context
|
|
168
|
+
)
|
|
169
|
+
unity_task.dependencies << tasks.first.id if tasks.any?
|
|
170
|
+
tasks << unity_task
|
|
171
|
+
end
|
|
192
172
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
if @main_bundle_name && !@main_bundle_name.empty?
|
|
196
|
-
puts "\n正在处理指定的 Bundle Name: #{@main_bundle_name}..."
|
|
197
|
-
|
|
198
|
-
# 检查是否为通配符或通用 bundle_name
|
|
199
|
-
# 如果是 com.test.* 或 com.test 这样的通配符,跳过配置更新
|
|
200
|
-
is_wildcard = @main_bundle_name.include?('*') ||
|
|
201
|
-
@main_bundle_name.end_with?('.') ||
|
|
202
|
-
['com.test', 'com.example', 'com.demo'].include?(@main_bundle_name)
|
|
173
|
+
# 3. 构建任务
|
|
174
|
+
build_mode = @args_release_flag ? :release : :dev
|
|
203
175
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
176
|
+
# 确定 Android 项目路径
|
|
177
|
+
if is_unity
|
|
178
|
+
android_project_path = android_export_path
|
|
207
179
|
else
|
|
208
|
-
|
|
209
|
-
# 直接使用 clong_buildconfig_repo 拉取配置仓库
|
|
210
|
-
config_repo_dir = clong_buildconfig_repo(repo_name: @main_bundle_name)
|
|
211
|
-
|
|
212
|
-
if config_repo_dir && File.exist?(config_repo_dir)
|
|
213
|
-
# 1. 拷贝 google-services.json 到 launcher 目录
|
|
214
|
-
Pindo::AndroidConfigHelper.copy_google_services_from_config_repo(
|
|
215
|
-
config_repo_dir: config_repo_dir,
|
|
216
|
-
project_dir: pindo_project_dir
|
|
217
|
-
)
|
|
218
|
-
|
|
219
|
-
# 2. 更新 Application ID 为指定的 bundle_name(覆盖工作流设置)
|
|
220
|
-
Pindo::AndroidConfigHelper.update_application_id(
|
|
221
|
-
project_dir: pindo_project_dir,
|
|
222
|
-
application_id: @main_bundle_name
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
puts " ✓ Bundle Name 配置处理完成"
|
|
226
|
-
else
|
|
227
|
-
raise Informative, "无法获取配置仓库"
|
|
228
|
-
end
|
|
180
|
+
android_project_path = config[:project_path]
|
|
229
181
|
end
|
|
230
|
-
end
|
|
231
182
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
app_info_obj: app_info_obj,
|
|
267
|
-
app_version_info_obj: result_data["data"],
|
|
268
|
-
chatEnv: "DevTest",
|
|
269
|
-
receiveType: "chat"
|
|
270
|
-
)
|
|
271
|
-
end
|
|
272
|
-
end
|
|
183
|
+
build_options = {
|
|
184
|
+
project_path: android_project_path,
|
|
185
|
+
bundle_name: config[:bundle_name],
|
|
186
|
+
proj_name: @args_proj_name,
|
|
187
|
+
upload: @args_upload_flag,
|
|
188
|
+
send: @args_send_flag,
|
|
189
|
+
app_info_obj: config[:app_info_obj],
|
|
190
|
+
workflow_info: config[:workflow_info]
|
|
191
|
+
}
|
|
192
|
+
build_options[:unity_root_path] = config[:project_path] if is_unity
|
|
193
|
+
|
|
194
|
+
build_task = Pindo::TaskSystem::BuildTask.create_task(
|
|
195
|
+
platform: :android,
|
|
196
|
+
mode: build_mode,
|
|
197
|
+
options: build_options
|
|
198
|
+
)
|
|
199
|
+
build_task.dependencies << tasks.last.id if tasks.any?
|
|
200
|
+
tasks << build_task
|
|
201
|
+
|
|
202
|
+
# 4. 上传任务(如果需要)
|
|
203
|
+
if @args_upload_flag
|
|
204
|
+
upload_task = Pindo::TaskSystem::UploadTask.new(
|
|
205
|
+
'apk',
|
|
206
|
+
File.join(android_project_path, 'build'),
|
|
207
|
+
nil,
|
|
208
|
+
app_info_obj: config[:app_info_obj],
|
|
209
|
+
workflow_info: config[:workflow_info],
|
|
210
|
+
project_name: @args_proj_name,
|
|
211
|
+
context: {
|
|
212
|
+
send_to_chat: @args_send_flag
|
|
213
|
+
},
|
|
214
|
+
dependencies: [build_task.id]
|
|
215
|
+
)
|
|
216
|
+
tasks << upload_task
|
|
273
217
|
end
|
|
274
218
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
seconds = (total_time % 60).to_i
|
|
279
|
-
|
|
280
|
-
if minutes > 0
|
|
281
|
-
puts "\e[32m构建完成!总耗时: #{minutes}分#{seconds}秒\e[0m"
|
|
282
|
-
else
|
|
283
|
-
puts "\e[32m构建完成!总耗时: #{seconds}秒\e[0m"
|
|
284
|
-
end
|
|
285
|
-
|
|
286
|
-
puts "\e[32m正在打开目标文件夹...\e[0m"
|
|
287
|
-
system "open #{pindo_project_dir}"
|
|
288
|
-
|
|
289
|
-
rescue => e
|
|
290
|
-
puts "\e[31m构建失败: #{e.message}\e[0m"
|
|
291
|
-
puts "\e[33m正在打开项目文件夹以便检查错误...\e[0m"
|
|
292
|
-
system "open #{pindo_project_dir}"
|
|
293
|
-
raise e
|
|
219
|
+
tasks
|
|
220
|
+
else
|
|
221
|
+
raise Informative, "当前目录不是工程目录,不能编译"
|
|
294
222
|
end
|
|
295
|
-
|
|
296
223
|
end
|
|
297
224
|
end
|
|
298
225
|
end
|
|
@@ -2,6 +2,7 @@ require 'highline/import'
|
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'json'
|
|
4
4
|
require 'pindo/module/build/build_helper'
|
|
5
|
+
require 'pindo/module/build/git_repo_helper'
|
|
5
6
|
require 'pindo/module/android/android_build_helper'
|
|
6
7
|
|
|
7
8
|
module Pindo
|
|
@@ -82,9 +83,16 @@ module Pindo
|
|
|
82
83
|
pindo_project_dir = Dir.pwd
|
|
83
84
|
build_helper = Pindo::BuildHelper.share_instance
|
|
84
85
|
if @args_upload_flag
|
|
85
|
-
|
|
86
|
+
git_repo_helper = Pindo::GitRepoHelper.share_instance
|
|
87
|
+
is_need_add_tag, tag_action_parms = git_repo_helper.check_is_need_add_tag?(pindo_project_dir)
|
|
86
88
|
if is_need_add_tag
|
|
87
|
-
|
|
89
|
+
git_repo_helper.create_and_push_tag(
|
|
90
|
+
project_dir: pindo_project_dir,
|
|
91
|
+
mode: 'minor',
|
|
92
|
+
force_retag: tag_action_parms&.include?('--retag') || false,
|
|
93
|
+
custom_tag: nil,
|
|
94
|
+
release_branch: 'master'
|
|
95
|
+
)
|
|
88
96
|
end
|
|
89
97
|
end
|
|
90
98
|
|