pindo 5.10.4 → 5.10.8
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/funlog.rb +12 -1
- data/lib/pindo/base/pindocontext.rb +3 -0
- data/lib/pindo/command/android/autobuild.rb +62 -9
- data/lib/pindo/command/android/build.rb +6 -6
- data/lib/pindo/command/android/debug.rb +9 -9
- data/lib/pindo/command/deploy/build.rb +5 -2
- data/lib/pindo/command/deploy/cert.rb +6 -7
- data/lib/pindo/command/deploy/configproj.rb +3 -3
- data/lib/pindo/command/deploy/confusecode.rb +1 -1
- data/lib/pindo/command/deploy/confuseproj.rb +1 -1
- data/lib/pindo/command/deploy/pem.rb +3 -4
- data/lib/pindo/command/dev/autobuild.rb +2 -2
- data/lib/pindo/command/dev/build.rb +2 -2
- data/lib/pindo/command/dev/feishu.rb +1 -1
- data/lib/pindo/command/gplay/pullconfig.rb +48 -0
- data/lib/pindo/command/gplay.rb +6 -5
- data/lib/pindo/command/ios/adhoc.rb +7 -6
- data/lib/pindo/command/ios/autobuild.rb +25 -25
- data/lib/pindo/command/ios/build.rb +7 -6
- data/lib/pindo/command/ios/debug.rb +2 -1
- data/lib/pindo/command/ipa/autoresign.rb +2 -2
- data/lib/pindo/command/ipa/import.rb +3 -4
- data/lib/pindo/command/ipa/output.rb +3 -4
- data/lib/pindo/command/jps/upload.rb +6 -5
- data/lib/pindo/command/repo/login.rb +1 -1
- data/lib/pindo/command/unity/apk.rb +19 -2
- data/lib/pindo/command/unity/autobuild.rb +58 -63
- data/lib/pindo/command/unity/initpack.rb +1 -1
- data/lib/pindo/command/unity/ipa.rb +17 -14
- data/lib/pindo/command/unity/pack.rb +1 -1
- data/lib/pindo/command/unity/upload.rb +1 -1
- data/lib/pindo/command/unity/web.rb +2 -2
- data/lib/pindo/command/utils/device.rb +4 -4
- data/lib/pindo/command/utils/icon.rb +1 -1
- data/lib/pindo/command/utils/renewcert.rb +2 -3
- data/lib/pindo/command/utils/renewproj.rb +9 -10
- data/lib/pindo/command/web/autobuild.rb +3 -3
- data/lib/pindo/command/web/run.rb +1 -1
- data/lib/pindo/command.rb +2 -1
- data/lib/pindo/module/android/android_build_config_helper.rb +267 -35
- data/lib/pindo/module/android/android_build_helper.rb +300 -0
- data/lib/pindo/module/android/android_project_helper.rb +279 -0
- data/lib/pindo/module/android/gp_compliance_helper.rb +33 -87
- data/lib/pindo/module/android/gradle_helper.rb +524 -255
- data/lib/pindo/module/android/java_env_helper.rb +633 -0
- data/lib/pindo/module/android/keystore_helper.rb +1118 -0
- data/lib/pindo/module/appselect.rb +109 -0
- data/lib/pindo/module/appstore/appstore_in_app_purchase.rb +1 -1
- data/lib/pindo/module/build/{buildhelper.rb → build_helper.rb} +1 -2
- data/lib/pindo/module/build/{commonconfuseproj.rb → confuse_xcodeproj.rb} +2 -2
- data/lib/pindo/module/cert/cert_helper.rb +245 -0
- data/lib/pindo/module/cert/keychain_helper.rb +152 -0
- data/lib/pindo/module/cert/pem_helper.rb +67 -0
- data/lib/pindo/module/cert/xcodecerthelper.rb +6 -5
- data/lib/pindo/module/pgyer/pgyerhelper.rb +5 -5
- data/lib/pindo/module/{build/unityhelper.rb → unity/unity_helper.rb} +0 -17
- data/lib/pindo/module/xcode/{xcodereshandler.rb → res/xcode_res_handler.rb} +1 -1
- data/lib/pindo/module/xcode/{xcodebuildconfig.rb → xcode_build_config.rb} +7 -6
- data/lib/pindo/module/xcode/{xcodebuildhelper.rb → xcode_build_helper.rb} +84 -2
- data/lib/pindo/module/xcode/{xcodehelper.rb → xcode_project_helper.rb} +4 -2
- data/lib/pindo/module/xcode/{xcodereshelper.rb → xcode_res_helper.rb} +12 -9
- data/lib/pindo/version.rb +185 -7
- data/lib/pindo.rb +14 -9
- metadata +24 -23
- data/lib/pindo/module/android/apk_helper.rb +0 -138
- data/lib/pindo/module/android/base_helper.rb +0 -964
- data/lib/pindo/module/android/build_helper.rb +0 -128
- data/lib/pindo/module/android/so_helper.rb +0 -18
- data/lib/pindo/module/cert/certhelper.rb +0 -246
- data/lib/pindo/module/cert/keychainhelper.rb +0 -150
- data/lib/pindo/module/cert/pemhelper.rb +0 -65
- /data/lib/pindo/module/android/{androidreshelper.rb → android_res_helper.rb} +0 -0
- /data/lib/pindo/module/appstore/{iap_tier.json → appstore_iap_tier.json} +0 -0
- /data/lib/pindo/module/build/{swarkhelper.rb → swark_helper.rb} +0 -0
- /data/lib/pindo/module/build/{versionhelper.rb → version_helper.rb} +0 -0
- /data/lib/pindo/module/cert/{provisioninghelper.rb → provisioning_helper.rb} +0 -0
- /data/lib/pindo/module/unity/{nugethelper.rb → nuget_helper.rb} +0 -0
- /data/lib/pindo/module/xcode/{xcoderesconstant.rb → res/xcode_res_constant.rb} +0 -0
|
@@ -3,9 +3,9 @@ require 'xcodeproj'
|
|
|
3
3
|
require 'find'
|
|
4
4
|
require 'fileutils'
|
|
5
5
|
require 'pindo/base/executable'
|
|
6
|
-
require 'pindo/module/build/
|
|
7
|
-
require 'pindo/module/build/
|
|
8
|
-
require 'pindo/module/xcode/
|
|
6
|
+
require 'pindo/module/build/build_helper'
|
|
7
|
+
require 'pindo/module/build/version_helper'
|
|
8
|
+
require 'pindo/module/xcode/xcode_build_config'
|
|
9
9
|
require 'pindo/base/pindocontext'
|
|
10
10
|
|
|
11
11
|
module Pindo
|
|
@@ -15,7 +15,7 @@ module Pindo
|
|
|
15
15
|
|
|
16
16
|
include Appselect
|
|
17
17
|
include Pindo::Githelper
|
|
18
|
-
# 命令的简要说明 - 打包iOS
|
|
18
|
+
# 命令的简要说明 - 打包iOS工程并发布到JPS
|
|
19
19
|
self.summary = '打包iOS工程并发布到测试平台'
|
|
20
20
|
|
|
21
21
|
# 启用缓存机制
|
|
@@ -91,10 +91,22 @@ module Pindo
|
|
|
91
91
|
# 加载 JPS 配置(如果存在)
|
|
92
92
|
context = Pindo::PindoContext.instance
|
|
93
93
|
context.load_and_apply_jps_config(pindo_project_dir)
|
|
94
|
-
|
|
95
94
|
# 确认并应用缓存(如果有)
|
|
96
95
|
context.confirm_and_apply_cache
|
|
97
96
|
|
|
97
|
+
|
|
98
|
+
@mainapp_bundleid= nil
|
|
99
|
+
if @args_bundle_id
|
|
100
|
+
@mainapp_bundleid = @args_bundle_id
|
|
101
|
+
else
|
|
102
|
+
if @args_deploy_flag
|
|
103
|
+
@mainapp_bundleid = get_selected_deploy_bundleid()
|
|
104
|
+
else
|
|
105
|
+
@mainapp_bundleid = get_selected_dev_bundleid()
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
|
|
98
110
|
build_helper = Pindo::BuildHelper.share_instance
|
|
99
111
|
project_type = build_helper.project_type(pindo_project_dir)
|
|
100
112
|
|
|
@@ -102,7 +114,7 @@ module Pindo
|
|
|
102
114
|
args_temp << "--proj=#{@args_proj_name}" if @args_proj_name
|
|
103
115
|
args_temp << "--upload" if @args_upload_flag
|
|
104
116
|
args_temp << "--send" if @args_send_flag
|
|
105
|
-
args_temp << "--bundleid=#{@
|
|
117
|
+
args_temp << "--bundleid=#{@mainapp_bundleid}" if @mainapp_bundleid
|
|
106
118
|
case project_type
|
|
107
119
|
when :ios
|
|
108
120
|
ios_autobuild
|
|
@@ -133,19 +145,7 @@ module Pindo
|
|
|
133
145
|
if !new_project_fullname.nil? && File.exist?(new_project_fullname)
|
|
134
146
|
build_helper.delete_libtarget_firebase_shell(pindo_project_dir)
|
|
135
147
|
end
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
mainapp_bundleid= nil
|
|
139
|
-
puts "args_bundle_id: #{@args_bundle_id}"
|
|
140
|
-
if @args_bundle_id
|
|
141
|
-
mainapp_bundleid = @args_bundle_id
|
|
142
|
-
else
|
|
143
|
-
if @args_deploy_flag
|
|
144
|
-
mainapp_bundleid = get_selected_deploy_bundleid()
|
|
145
|
-
else
|
|
146
|
-
mainapp_bundleid = get_selected_dev_bundleid()
|
|
147
|
-
end
|
|
148
|
-
end
|
|
148
|
+
|
|
149
149
|
|
|
150
150
|
app_info_obj = nil
|
|
151
151
|
workflow_info = nil
|
|
@@ -159,16 +159,16 @@ module Pindo
|
|
|
159
159
|
|
|
160
160
|
# ===== 使用 workflow 配置更新项目 =====
|
|
161
161
|
if workflow_info && workflow_info[:package_name]
|
|
162
|
-
|
|
162
|
+
workflow_packname = workflow_info[:package_name]
|
|
163
163
|
project_id = app_info_obj ? app_info_obj["id"] : nil
|
|
164
164
|
|
|
165
165
|
puts "\n使用工作流配置更新 iOS 项目:"
|
|
166
|
-
puts " Package Name: #{
|
|
166
|
+
puts " Workflow Package Name: #{workflow_packname}"
|
|
167
167
|
|
|
168
168
|
# 一次性更新 Display Name、Bundle ID、URL Schemes 和 JPS 快捷操作
|
|
169
|
-
Pindo::XcodeBuildConfig.
|
|
169
|
+
Pindo::XcodeBuildConfig.update_project_with_workflow(
|
|
170
170
|
project_dir: pindo_project_dir,
|
|
171
|
-
|
|
171
|
+
workflow_packname: workflow_packname,
|
|
172
172
|
project_id: project_id
|
|
173
173
|
)
|
|
174
174
|
else
|
|
@@ -206,7 +206,7 @@ module Pindo
|
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
args_temp = []
|
|
209
|
-
args_temp << mainapp_bundleid
|
|
209
|
+
args_temp << @mainapp_bundleid
|
|
210
210
|
Pindo::Command::Deploy::Pullconfig::run(args_temp)
|
|
211
211
|
|
|
212
212
|
Dir.chdir(pindo_project_dir)
|
|
@@ -272,7 +272,7 @@ module Pindo
|
|
|
272
272
|
# 因为 Cert::run 可能会修改 PRODUCT_BUNDLE_IDENTIFIER
|
|
273
273
|
Pindo::XcodeBuildConfig.update_url_schemes_with_bundleid(
|
|
274
274
|
project_dir: pindo_project_dir,
|
|
275
|
-
package_name:
|
|
275
|
+
package_name: workflow_packname
|
|
276
276
|
)
|
|
277
277
|
|
|
278
278
|
Dir.chdir(pindo_project_dir)
|
|
@@ -3,7 +3,8 @@ require 'fileutils'
|
|
|
3
3
|
require 'json'
|
|
4
4
|
require 'xcodeproj'
|
|
5
5
|
require 'gym'
|
|
6
|
-
require 'pindo/module/build/
|
|
6
|
+
require 'pindo/module/build/build_helper'
|
|
7
|
+
require 'pindo/module/xcode/xcode_build_config'
|
|
7
8
|
|
|
8
9
|
module Pindo
|
|
9
10
|
class Command
|
|
@@ -123,23 +124,23 @@ module Pindo
|
|
|
123
124
|
|
|
124
125
|
# ===== 使用 workflow 配置更新项目 =====
|
|
125
126
|
if workflow_info && workflow_info[:package_name]
|
|
126
|
-
|
|
127
|
+
workflow_packname = workflow_info[:package_name]
|
|
127
128
|
project_id = app_info_obj ? app_info_obj["id"] : nil
|
|
128
129
|
|
|
129
130
|
puts "\n使用工作流配置更新 iOS 项目:"
|
|
130
|
-
puts " Package Name: #{
|
|
131
|
+
puts " Workflow Package Name: #{workflow_packname}"
|
|
131
132
|
|
|
132
133
|
# 一次性更新 Display Name、Bundle ID、URL Schemes 和 JPS 快捷操作
|
|
133
|
-
Pindo::XcodeBuildConfig.
|
|
134
|
+
Pindo::XcodeBuildConfig.update_project_with_workflow(
|
|
134
135
|
project_dir: pindo_project_dir,
|
|
135
|
-
|
|
136
|
+
workflow_packname: workflow_packname,
|
|
136
137
|
project_id: project_id
|
|
137
138
|
)
|
|
138
139
|
|
|
139
140
|
# 根据实际的 Bundle ID 更新 URL Schemes
|
|
140
141
|
Pindo::XcodeBuildConfig.update_url_schemes_with_bundleid(
|
|
141
142
|
project_dir: pindo_project_dir,
|
|
142
|
-
package_name:
|
|
143
|
+
package_name: workflow_packname
|
|
143
144
|
)
|
|
144
145
|
else
|
|
145
146
|
raise Informative, "未获取到工作流信息"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'fileutils'
|
|
2
|
+
require 'pindo/module/xcode/xcode_build_config'
|
|
2
3
|
|
|
3
4
|
module Pindo
|
|
4
5
|
class Command
|
|
@@ -42,7 +43,7 @@ module Pindo
|
|
|
42
43
|
['--deploy', '默认使用开发环境的bundle id,使用此选项切换为发布环境的bundle id'],
|
|
43
44
|
['--adhoc', '默认使用开发证书,使用此选项切换为adhoc证书'],
|
|
44
45
|
['--macos', '指定为macOS平台的证书'],
|
|
45
|
-
['--upload', '
|
|
46
|
+
['--upload', '生成用于上传到JPS平台的证书'],
|
|
46
47
|
].concat(super)
|
|
47
48
|
end
|
|
48
49
|
|
|
@@ -41,8 +41,8 @@ module Pindo
|
|
|
41
41
|
[
|
|
42
42
|
['--ipa', 'iap file name.'],
|
|
43
43
|
['--proj', '指定哪个项目(忽略大小写空格等等字符): --proj=\"prancksoundv4\"'],
|
|
44
|
-
['--upload', '编译完成后是否上传ipa到
|
|
45
|
-
['--send', '上传到
|
|
44
|
+
['--upload', '编译完成后是否上传ipa到JPS: --upload'],
|
|
45
|
+
['--send', '上传到JPS之后是否发送测试信息: --send'],
|
|
46
46
|
['--ipa', '强制指定重签名的ipa包,用法: --ipa=path/to/demo.ipa'],
|
|
47
47
|
['--dev', '使用dev证书,默认使用adhoc证书: --dev'],
|
|
48
48
|
['--test', '使用测试的bundle id, 默认是用发布bundle id,用法:--test'],
|
|
@@ -5,7 +5,7 @@ require 'find'
|
|
|
5
5
|
require 'fileutils'
|
|
6
6
|
require 'pindo/base/executable'
|
|
7
7
|
require 'pindo/module/xcode/xcodeappconfig'
|
|
8
|
-
require 'pindo/module/xcode/
|
|
8
|
+
require 'pindo/module/xcode/xcode_build_helper'
|
|
9
9
|
|
|
10
10
|
module Pindo
|
|
11
11
|
class Command
|
|
@@ -14,7 +14,6 @@ module Pindo
|
|
|
14
14
|
|
|
15
15
|
include Command::DeployOptions
|
|
16
16
|
include Pindo::XcodeAppConfig
|
|
17
|
-
include XcodeBuildHelper
|
|
18
17
|
include Appselect
|
|
19
18
|
|
|
20
19
|
self.summary = '提交时设置Xcode工程编译参数'
|
|
@@ -50,7 +49,7 @@ module Pindo
|
|
|
50
49
|
['--build', '修改完工程之后直接编译,用法:pindo ipa import --build'],
|
|
51
50
|
['--increase', '自动增加编译的app版本号,用法:pindo ipa import --increase'],
|
|
52
51
|
['--proj', '指定哪个项目(忽略大小写空格等等字符): --proj=\"prancksoundv4\"'],
|
|
53
|
-
['--upload', '编译完成后是否上传ipa到
|
|
52
|
+
['--upload', '编译完成后是否上传ipa到JPS: 用法:pindo ipa import --upload'],
|
|
54
53
|
['--send', '上传到之后是否发送测试信息,用法:pindo ipa import --send'],
|
|
55
54
|
['--resign', '上传到之后是否发送测试信息,用法:pindo ipa import --resign'],
|
|
56
55
|
|
|
@@ -176,7 +175,7 @@ module Pindo
|
|
|
176
175
|
|
|
177
176
|
if File.exist?(File.join(pindo_new_project_dir, "Podfile"))
|
|
178
177
|
|
|
179
|
-
pull_podfile_lock(project_dir:pindo_new_project_dir, app_config_dir:app_config_dir)
|
|
178
|
+
Pindo::XcodeBuildHelper.pull_podfile_lock(project_dir:pindo_new_project_dir, app_config_dir:app_config_dir)
|
|
180
179
|
Pindo::Command::Lib::Update::run([])
|
|
181
180
|
begin
|
|
182
181
|
remove_test_pod_modue(project_dir:pindo_new_project_dir)
|
|
@@ -3,7 +3,7 @@ require 'xcodeproj'
|
|
|
3
3
|
require 'find'
|
|
4
4
|
require 'fileutils'
|
|
5
5
|
require 'pindo/base/executable'
|
|
6
|
-
require 'pindo/module/xcode/
|
|
6
|
+
require 'pindo/module/xcode/xcode_build_helper'
|
|
7
7
|
require 'pindo/module/xcode/xcodeappconfig'
|
|
8
8
|
|
|
9
9
|
module Pindo
|
|
@@ -13,7 +13,6 @@ module Pindo
|
|
|
13
13
|
|
|
14
14
|
include Command::DeployOptions
|
|
15
15
|
|
|
16
|
-
include XcodeBuildHelper
|
|
17
16
|
include XcodeAppConfig
|
|
18
17
|
include Appselect
|
|
19
18
|
|
|
@@ -51,7 +50,7 @@ module Pindo
|
|
|
51
50
|
def self.options
|
|
52
51
|
[
|
|
53
52
|
['--proj', '指定哪个项目(忽略大小写空格等等字符): --proj=\"prancksoundv4\"'],
|
|
54
|
-
['--upload', '编译完成后是否上传ipa到
|
|
53
|
+
['--upload', '编译完成后是否上传ipa到JPS: 用法:pindo ipa output --upload'],
|
|
55
54
|
['--send', '上传到之后是否发送测试信息,用法:pindo ipa output --send'],
|
|
56
55
|
['--increase', '自动增加编译的app版本号,用法:pindo ipa output --increase'],
|
|
57
56
|
|
|
@@ -212,7 +211,7 @@ module Pindo
|
|
|
212
211
|
raise Informative, "pod install失败!!先pod install 完成后成编译 !"
|
|
213
212
|
end
|
|
214
213
|
|
|
215
|
-
backup_podfile_lock(project_dir:pindo_new_project_dir, app_config_dir:app_config_dir, appversion:@config_json["app_info"]["app_build_version"])
|
|
214
|
+
Pindo::XcodeBuildHelper.backup_podfile_lock(project_dir:pindo_new_project_dir, app_config_dir:app_config_dir, appversion:@config_json["app_info"]["app_build_version"])
|
|
216
215
|
|
|
217
216
|
end
|
|
218
217
|
|
|
@@ -3,7 +3,7 @@ require 'fileutils'
|
|
|
3
3
|
require 'json'
|
|
4
4
|
require 'faraday'
|
|
5
5
|
require 'pindo/module/pgyer/pgyerhelper'
|
|
6
|
-
require 'pindo/module/build/
|
|
6
|
+
require 'pindo/module/build/build_helper'
|
|
7
7
|
|
|
8
8
|
module Pindo
|
|
9
9
|
class Command
|
|
@@ -122,7 +122,8 @@ module Pindo
|
|
|
122
122
|
build_path = File.join(current_project_dir, "build", "*.{ipa,app}")
|
|
123
123
|
@args_ipa_file = Dir.glob(build_path).max_by {|f| File.mtime(f)}
|
|
124
124
|
when :android
|
|
125
|
-
|
|
125
|
+
# 搜索 build 目录下的所有 apk 文件(包括子目录)
|
|
126
|
+
build_path = File.join(current_project_dir, "build", "**", "*.{apk}")
|
|
126
127
|
@args_ipa_file = Dir.glob(build_path).max_by {|f| File.mtime(f)}
|
|
127
128
|
when :unity
|
|
128
129
|
# Unity 工程支持三种平台的包:iOS、Android 和 WebGL
|
|
@@ -139,14 +140,14 @@ module Pindo
|
|
|
139
140
|
all_packages.concat(Dir.glob(ios_build_path))
|
|
140
141
|
end
|
|
141
142
|
|
|
142
|
-
# 检测 Android 包(收集所有 Android
|
|
143
|
+
# 检测 Android 包(收集所有 Android 包,包括子目录)
|
|
143
144
|
if File.exist?(File.join(current_project_dir, "GoodPlatform/BaseAndroid/build"))
|
|
144
|
-
android_build_path = File.join(current_project_dir, "GoodPlatform/BaseAndroid/build", "*.{apk,aab}")
|
|
145
|
+
android_build_path = File.join(current_project_dir, "GoodPlatform/BaseAndroid/build", "**", "*.{apk,aab}")
|
|
145
146
|
all_packages.concat(Dir.glob(android_build_path))
|
|
146
147
|
end
|
|
147
148
|
|
|
148
149
|
if File.exist?(File.join(current_project_dir, "GoodPlatform/Android/build"))
|
|
149
|
-
android_build_path = File.join(current_project_dir, "GoodPlatform/Android/build", "*.{apk,aab}")
|
|
150
|
+
android_build_path = File.join(current_project_dir, "GoodPlatform/Android/build", "**", "*.{apk,aab}")
|
|
150
151
|
all_packages.concat(Dir.glob(android_build_path))
|
|
151
152
|
end
|
|
152
153
|
|
|
@@ -3,13 +3,14 @@ require 'xcodeproj'
|
|
|
3
3
|
require 'find'
|
|
4
4
|
require 'fileutils'
|
|
5
5
|
require 'pindo/base/executable'
|
|
6
|
-
require 'pindo/module/
|
|
7
|
-
require 'pindo/module/build/
|
|
6
|
+
require 'pindo/module/unity/unity_helper'
|
|
7
|
+
require 'pindo/module/build/build_helper'
|
|
8
8
|
|
|
9
9
|
module Pindo
|
|
10
10
|
class Command
|
|
11
11
|
class Unity < Command
|
|
12
12
|
class Apk < Unity
|
|
13
|
+
include Appselect
|
|
13
14
|
|
|
14
15
|
# 命令的简要说明 - 编译Unity工程生成Android APK
|
|
15
16
|
self.summary = '编译Unity工程生成Android APK并支持上传到测试平台'
|
|
@@ -52,6 +53,7 @@ DESC
|
|
|
52
53
|
def self.options
|
|
53
54
|
[
|
|
54
55
|
['--proj=NAME', '指定上传到测试平台的项目名称'],
|
|
56
|
+
['--bundle_name=NAME', '指定Android Package Name(如com.example.app,会拉取对应配置)'],
|
|
55
57
|
['--upload', '编译后上传到测试平台(自动发送给自己)'],
|
|
56
58
|
['--send', '发送通知到测试群组(同时发送给自己)']
|
|
57
59
|
].concat(super)
|
|
@@ -60,6 +62,7 @@ DESC
|
|
|
60
62
|
def initialize(argv)
|
|
61
63
|
|
|
62
64
|
@args_proj_name = argv.option('proj')
|
|
65
|
+
@args_bundle_name = argv.option('bundle_name')
|
|
63
66
|
@args_upload_flag = argv.flag?('upload', false)
|
|
64
67
|
@args_send_flag = argv.flag?('send', false)
|
|
65
68
|
|
|
@@ -80,6 +83,14 @@ DESC
|
|
|
80
83
|
# 确认并应用缓存(如果有)
|
|
81
84
|
context.confirm_and_apply_cache
|
|
82
85
|
|
|
86
|
+
@main_bundle_name = nil
|
|
87
|
+
if @args_bundle_name
|
|
88
|
+
@main_bundle_name = @args_bundle_name
|
|
89
|
+
else
|
|
90
|
+
@main_bundle_name = get_selected_dev_bundle_name()
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
|
|
83
94
|
# 检查是否是Unity工程
|
|
84
95
|
unity_helper = Pindo::Client::UnityHelper.share_instance
|
|
85
96
|
unless unity_helper.unity_project?(pindo_project_dir)
|
|
@@ -136,8 +147,14 @@ DESC
|
|
|
136
147
|
)
|
|
137
148
|
|
|
138
149
|
puts "Unity项目构建完成,准备处理Android项目..."
|
|
150
|
+
|
|
139
151
|
args_temp = []
|
|
140
152
|
|
|
153
|
+
# 传递 bundle_name 参数
|
|
154
|
+
if @main_bundle_name
|
|
155
|
+
args_temp << "--bundle_name=#{@main_bundle_name}"
|
|
156
|
+
end
|
|
157
|
+
|
|
141
158
|
if @args_upload_flag
|
|
142
159
|
args_temp << "--proj=#{app_info_obj["projectName"]}"
|
|
143
160
|
args_temp << "--upload"
|
|
@@ -3,8 +3,8 @@ require 'xcodeproj'
|
|
|
3
3
|
require 'find'
|
|
4
4
|
require 'fileutils'
|
|
5
5
|
require 'pindo/base/executable'
|
|
6
|
-
require 'pindo/module/
|
|
7
|
-
require 'pindo/module/build/
|
|
6
|
+
require 'pindo/module/unity/unity_helper'
|
|
7
|
+
require 'pindo/module/build/build_helper'
|
|
8
8
|
|
|
9
9
|
module Pindo
|
|
10
10
|
class Command
|
|
@@ -14,16 +14,26 @@ module Pindo
|
|
|
14
14
|
include Appselect
|
|
15
15
|
|
|
16
16
|
include Pindo::Githelper
|
|
17
|
-
# Unity
|
|
18
|
-
self.summary = '编译Unity工程生成iOS
|
|
17
|
+
# Unity 多平台编译和上传命令
|
|
18
|
+
self.summary = '编译Unity工程生成iOS/Android/WebGL并支持上传到测试平台'
|
|
19
19
|
|
|
20
20
|
# 详细说明
|
|
21
21
|
self.description = <<-DESC
|
|
22
|
-
编译Unity
|
|
22
|
+
编译Unity工程并生成iOS IPA、Android APK和WebGL包,支持上传到测试平台。
|
|
23
|
+
|
|
24
|
+
编译顺序: iOS → Android → WebGL
|
|
25
|
+
|
|
26
|
+
支持平台:
|
|
27
|
+
|
|
28
|
+
* iOS - 生成IPA文件
|
|
29
|
+
|
|
30
|
+
* Android - 生成APK文件
|
|
31
|
+
|
|
32
|
+
* WebGL - 生成Web包
|
|
23
33
|
|
|
24
34
|
支持功能:
|
|
25
35
|
|
|
26
|
-
*
|
|
36
|
+
* 多平台自动构建
|
|
27
37
|
|
|
28
38
|
* 上传到测试平台
|
|
29
39
|
|
|
@@ -31,11 +41,17 @@ module Pindo
|
|
|
31
41
|
|
|
32
42
|
使用示例:
|
|
33
43
|
|
|
34
|
-
$ pindo unity autobuild #
|
|
44
|
+
$ pindo unity autobuild # 编译所有平台 (iOS → Android → WebGL)
|
|
35
45
|
|
|
36
46
|
$ pindo unity autobuild --upload # 编译并上传
|
|
37
47
|
|
|
38
48
|
$ pindo unity autobuild --proj=myapp # 指定项目名称
|
|
49
|
+
|
|
50
|
+
$ pindo unity autobuild --base # Unity lib模式
|
|
51
|
+
|
|
52
|
+
$ pindo unity autobuild --bundle_name=com.example.app # 指定Android包名
|
|
53
|
+
|
|
54
|
+
$ pindo unity autobuild --bundleid=com.test.ios --bundle_name=com.test.android # 同时指定iOS和Android包名
|
|
39
55
|
DESC
|
|
40
56
|
|
|
41
57
|
# 命令参数
|
|
@@ -46,10 +62,11 @@ DESC
|
|
|
46
62
|
# 命令选项
|
|
47
63
|
def self.options
|
|
48
64
|
[
|
|
49
|
-
['--bundleid', '
|
|
50
|
-
['--
|
|
51
|
-
['--
|
|
52
|
-
['--
|
|
65
|
+
['--bundleid=ID', '指定iOS打包的bundleID'],
|
|
66
|
+
['--bundle_name=NAME', '指定Android Package Name(如com.example.app,会拉取对应配置)'],
|
|
67
|
+
['--proj=NAME', '指定上传到测试平台的项目名称'],
|
|
68
|
+
['--upload', '上传编译后的IPA/APK到测试平台'],
|
|
69
|
+
['--base', 'Unity工程编译lib模式(生成库而非完整应用)'],
|
|
53
70
|
].concat(super)
|
|
54
71
|
end
|
|
55
72
|
|
|
@@ -60,7 +77,8 @@ DESC
|
|
|
60
77
|
@args_upload_flag = argv.flag?('upload', false)
|
|
61
78
|
@args_base_flag = argv.flag?('base', false)
|
|
62
79
|
@args_bundle_id = argv.option('bundleid')
|
|
63
|
-
|
|
80
|
+
@args_bundle_name = argv.option('bundle_name')
|
|
81
|
+
|
|
64
82
|
|
|
65
83
|
super
|
|
66
84
|
end
|
|
@@ -69,7 +87,6 @@ DESC
|
|
|
69
87
|
def run
|
|
70
88
|
|
|
71
89
|
pindo_project_dir = Dir.pwd
|
|
72
|
-
|
|
73
90
|
# 检查是否是Unity工程
|
|
74
91
|
unity_helper = Pindo::Client::UnityHelper.share_instance
|
|
75
92
|
unless unity_helper.unity_project?(pindo_project_dir)
|
|
@@ -92,34 +109,38 @@ DESC
|
|
|
92
109
|
puts
|
|
93
110
|
|
|
94
111
|
proj_name = @args_proj_name
|
|
95
|
-
app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
|
|
96
|
-
pindo_project_dir = Dir.pwd
|
|
112
|
+
@app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
|
|
97
113
|
|
|
114
|
+
|
|
115
|
+
pindo_project_dir = Dir.pwd
|
|
116
|
+
Dir.chdir(pindo_project_dir)
|
|
98
117
|
ios_autobuild(unity_helper:unity_helper, unity_exe_path:unity_exe_path)
|
|
118
|
+
|
|
99
119
|
Dir.chdir(pindo_project_dir)
|
|
100
|
-
|
|
101
120
|
and_autobuild(unity_helper:unity_helper, unity_exe_path:unity_exe_path)
|
|
121
|
+
|
|
102
122
|
Dir.chdir(pindo_project_dir)
|
|
103
|
-
|
|
104
123
|
web_autobuild(unity_helper:unity_helper, unity_exe_path:unity_exe_path)
|
|
105
|
-
Dir.chdir(pindo_project_dir)
|
|
106
124
|
|
|
107
125
|
end
|
|
108
126
|
|
|
109
127
|
def web_autobuild(unity_helper:nil, unity_exe_path:nil)
|
|
110
|
-
pindo_project_dir = Dir.pwd
|
|
111
128
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
# 获取 zipCount 用于传递给 Unity 构建
|
|
115
|
-
zip_count = app_info_obj&.dig("zipCount") || -1
|
|
129
|
+
args_temp = []
|
|
116
130
|
|
|
117
|
-
|
|
131
|
+
if @main_bundle_name
|
|
132
|
+
args_temp << "--bundle_name=#{@main_bundle_name}"
|
|
133
|
+
end
|
|
118
134
|
|
|
119
|
-
|
|
135
|
+
if @args_upload_flag
|
|
136
|
+
args_temp << "--proj=#{@app_info_obj["projectName"]}"
|
|
137
|
+
args_temp << "--upload"
|
|
138
|
+
end
|
|
120
139
|
|
|
140
|
+
Pindo::Command::Android::Autobuild::run(args_temp)
|
|
121
141
|
|
|
122
142
|
end
|
|
143
|
+
|
|
123
144
|
|
|
124
145
|
def ios_autobuild(unity_helper:nil, unity_exe_path:nil)
|
|
125
146
|
|
|
@@ -134,31 +155,15 @@ DESC
|
|
|
134
155
|
mainapp_bundleid = get_selected_dev_bundleid()
|
|
135
156
|
end
|
|
136
157
|
end
|
|
137
|
-
isLibrary = @args_base_flag
|
|
138
|
-
ios_export_lib_dir = File.join(pindo_project_dir, "GoodPlatform/BaseiOS")
|
|
139
|
-
if File.directory?(ios_export_lib_dir)
|
|
140
|
-
isLibrary = true
|
|
141
|
-
end
|
|
142
|
-
pindo_ios_project_dir = File.join(pindo_project_dir, "GoodPlatform/iOS")
|
|
143
|
-
if isLibrary
|
|
144
|
-
pindo_ios_project_dir = ios_export_lib_dir
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
# 获取 ipaCount 用于传递给 Unity 构建
|
|
148
|
-
ipa_count = app_info_obj&.dig("ipaCount") || -1
|
|
149
|
-
|
|
150
|
-
unity_helper.build_project(unity_exe_full_path:unity_exe_path, project_path:pindo_project_dir, platform:'iOS', isLibrary:isLibrary, indexNo:ipa_count)
|
|
151
|
-
|
|
152
158
|
|
|
153
159
|
args_temp = []
|
|
154
160
|
args_temp << "--bundleid=#{mainapp_bundleid}"
|
|
155
161
|
|
|
156
|
-
if @args_upload_flag
|
|
157
|
-
args_temp << "--proj=#{app_info_obj["projectName"]}"
|
|
162
|
+
if @args_upload_flag
|
|
163
|
+
args_temp << "--proj=#{@app_info_obj["projectName"]}"
|
|
158
164
|
args_temp << "--upload"
|
|
159
165
|
end
|
|
160
166
|
|
|
161
|
-
Dir.chdir(pindo_ios_project_dir)
|
|
162
167
|
|
|
163
168
|
Pindo::Command::Ios::Autobuild::run(args_temp)
|
|
164
169
|
|
|
@@ -166,36 +171,26 @@ DESC
|
|
|
166
171
|
|
|
167
172
|
def and_autobuild(unity_helper:nil, unity_exe_path:nil)
|
|
168
173
|
|
|
169
|
-
pindo_project_dir = Dir.pwd
|
|
170
|
-
isLibrary = @args_base_flag
|
|
171
|
-
|
|
172
|
-
android_export_lib_dir = File.join(pindo_project_dir, "GoodPlatform/BaseAndroid")
|
|
173
|
-
if File.directory?(android_export_lib_dir)
|
|
174
|
-
isLibrary = true
|
|
175
|
-
end
|
|
176
174
|
|
|
177
|
-
|
|
178
|
-
if
|
|
179
|
-
|
|
175
|
+
@main_bundle_name = nil
|
|
176
|
+
if @args_bundle_name
|
|
177
|
+
@main_bundle_name = @args_bundle_name
|
|
178
|
+
else
|
|
179
|
+
@main_bundle_name = get_selected_dev_bundle_name()
|
|
180
180
|
end
|
|
181
181
|
|
|
182
|
-
# 获取 apkCount 用于传递给 Unity 构建
|
|
183
|
-
apk_count = app_info_obj&.dig("apkCount") || -1
|
|
184
|
-
|
|
185
|
-
puts "开始构建Unity项目..."
|
|
186
|
-
|
|
187
|
-
unity_helper.build_project(unity_exe_full_path: unity_exe_path, project_path: pindo_project_dir, platform: 'Android', isLibrary: isLibrary, indexNo: apk_count)
|
|
188
|
-
|
|
189
182
|
puts "Unity项目构建完成,准备处理Android项目..."
|
|
190
183
|
args_temp = []
|
|
191
184
|
|
|
185
|
+
if @main_bundle_name
|
|
186
|
+
args_temp << "--bundle_name=#{@main_bundle_name}"
|
|
187
|
+
end
|
|
188
|
+
|
|
192
189
|
if @args_upload_flag
|
|
193
|
-
args_temp << "--proj=#{app_info_obj["projectName"]}"
|
|
190
|
+
args_temp << "--proj=#{@app_info_obj["projectName"]}"
|
|
194
191
|
args_temp << "--upload"
|
|
195
192
|
end
|
|
196
193
|
|
|
197
|
-
Dir.chdir(pindo_android_project_dir)
|
|
198
|
-
|
|
199
194
|
Pindo::Command::Android::Autobuild::run(args_temp)
|
|
200
195
|
|
|
201
196
|
end
|
|
@@ -3,8 +3,8 @@ require 'xcodeproj'
|
|
|
3
3
|
require 'find'
|
|
4
4
|
require 'fileutils'
|
|
5
5
|
require 'pindo/base/executable'
|
|
6
|
-
require 'pindo/module/
|
|
7
|
-
require 'pindo/module/build/
|
|
6
|
+
require 'pindo/module/unity/unity_helper'
|
|
7
|
+
require 'pindo/module/build/build_helper'
|
|
8
8
|
require 'pindo/base/pindocontext'
|
|
9
9
|
|
|
10
10
|
module Pindo
|
|
@@ -99,6 +99,20 @@ DESC
|
|
|
99
99
|
# 确认并应用缓存(如果有)
|
|
100
100
|
context.confirm_and_apply_cache
|
|
101
101
|
|
|
102
|
+
|
|
103
|
+
@mainapp_bundleid= nil
|
|
104
|
+
if @args_bundle_id
|
|
105
|
+
@mainapp_bundleid = @args_bundle_id
|
|
106
|
+
else
|
|
107
|
+
if @args_deploy_flag
|
|
108
|
+
@mainapp_bundleid = get_selected_deploy_bundleid()
|
|
109
|
+
else
|
|
110
|
+
@mainapp_bundleid = get_selected_dev_bundleid()
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
102
116
|
# 检查是否是Unity工程
|
|
103
117
|
unity_helper = Pindo::Client::UnityHelper.share_instance
|
|
104
118
|
unless unity_helper.unity_project?(pindo_project_dir)
|
|
@@ -130,17 +144,6 @@ DESC
|
|
|
130
144
|
package_type: 'ipa'
|
|
131
145
|
)
|
|
132
146
|
|
|
133
|
-
mainapp_bundleid= nil
|
|
134
|
-
if @args_bundle_id
|
|
135
|
-
mainapp_bundleid = @args_bundle_id
|
|
136
|
-
else
|
|
137
|
-
if @args_deploy_flag
|
|
138
|
-
mainapp_bundleid = get_selected_deploy_bundleid()
|
|
139
|
-
else
|
|
140
|
-
mainapp_bundleid = get_selected_dev_bundleid()
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
|
|
144
147
|
isLibrary = @args_base_flag
|
|
145
148
|
|
|
146
149
|
ios_export_lib_dir = File.join(pindo_project_dir, "GoodPlatform/BaseiOS")
|
|
@@ -160,7 +163,7 @@ DESC
|
|
|
160
163
|
|
|
161
164
|
|
|
162
165
|
args_temp = []
|
|
163
|
-
args_temp << "--bundleid=#{mainapp_bundleid}"
|
|
166
|
+
args_temp << "--bundleid=#{@mainapp_bundleid}"
|
|
164
167
|
|
|
165
168
|
if @args_upload_flag
|
|
166
169
|
args_temp << "--proj=#{app_info_obj["projectName"]}"
|