pindo 5.6.2 → 5.6.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74540551eee20b918542b7de441e214fcfcbcaa4d747348efdd9bcd312d36d67
4
- data.tar.gz: 6f4d6e175b6ff344b9bb26fe85f3a349348a3487ca0999fb86b847d8e37446de
3
+ metadata.gz: 380db3ee1ad0c4583d215d3186a2481f7daa9c66d1f1c64b4b92cf249a410ecf
4
+ data.tar.gz: 6051ed21964c7d499718593e24e9f36211f86478109752467fe37673f76e5a9e
5
5
  SHA512:
6
- metadata.gz: 31a3e0cfef6eb95d8deaa16f95a15da7c91fb33f10acc642e57e9e4e26a0f315114fec8572ca35e0c1ebb83bdc163101e10155555ef23a30171a0f3fbd18f96b
7
- data.tar.gz: 31fd9e169330f6a8713d9d7472c96d26a74bb32afb3e6c9ad3d6d36dd3a84f76f939ee4e50f478650916cc9a101170e27bcb8d861d69296f2802bc6613da6221
6
+ metadata.gz: 667ea2d4a16d1b8d5581bf69b920158c1e34711fa29fe8f532074d0e85b34629668b641fa4df7436e830466a100e78506b83107f744980520f1439cb2b6fcff5
7
+ data.tar.gz: 073d4acec0c92f7592b1ce7a64a1eb0fc2db7858b89a82fd543f9e95da250da5c8eb100b8218b201547a39ab8863d1ece4d57c8ecddbb914bcfae5808464eadd
@@ -18,7 +18,8 @@ module Pindo
18
18
 
19
19
  支持功能:
20
20
 
21
- * 上传ipa/apk安装包
21
+ * 上传ipa/apk/html安装包
22
+ * Unity工程自动检测iOS/Android/WebGL包
22
23
  * 添加版本描述
23
24
  * 上传附件
24
25
  * 重签名
@@ -124,13 +125,44 @@ module Pindo
124
125
  build_path = File.join(current_project_dir, "build", "*.{apk}")
125
126
  @args_ipa_file = Dir.glob(build_path).max_by {|f| File.mtime(f)}
126
127
  when :unity
128
+ # Unity 工程支持三种平台的包:iOS、Android 和 WebGL
129
+ all_packages = []
127
130
 
128
- if File.exist?(File.join(current_project_dir, "GoodPlatform/BaseiOS"))
129
- build_path = File.join(current_project_dir, "GoodPlatform/BaseiOS/build", "*.{ipa,app}")
130
- @args_ipa_file = Dir.glob(build_path).max_by {|f| File.mtime(f)}
131
+ # 检测 iOS 包(收集所有 iOS 包)
132
+ if File.exist?(File.join(current_project_dir, "GoodPlatform/BaseiOS/build"))
133
+ ios_build_path = File.join(current_project_dir, "GoodPlatform/BaseiOS/build", "*.{ipa,app}")
134
+ all_packages.concat(Dir.glob(ios_build_path))
135
+ end
136
+
137
+ if File.exist?(File.join(current_project_dir, "GoodPlatform/iOS/build"))
138
+ ios_build_path = File.join(current_project_dir, "GoodPlatform/iOS/build", "*.{ipa,app}")
139
+ all_packages.concat(Dir.glob(ios_build_path))
140
+ end
141
+
142
+ # 检测 Android 包(收集所有 Android 包)
143
+ 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
+ all_packages.concat(Dir.glob(android_build_path))
146
+ end
147
+
148
+ 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
+ all_packages.concat(Dir.glob(android_build_path))
151
+ end
152
+
153
+ # 检测 WebGL 包(HTML 文件)
154
+ if File.exist?(File.join(current_project_dir, "GoodPlatform/WebGL/build"))
155
+ webgl_build_path = File.join(current_project_dir, "GoodPlatform/WebGL/build", "index.html")
156
+ webgl_files = Dir.glob(webgl_build_path)
157
+ all_packages.concat(webgl_files)
158
+ end
159
+
160
+ # 从所有找到的包中选择最新的一个
161
+ if all_packages.length > 0
162
+ # 选择修改时间最新的文件
163
+ @args_ipa_file = all_packages.max_by {|f| File.mtime(f)}
131
164
  else
132
- build_path = File.join(current_project_dir, "GoodPlatform/iOS/build", "*.{ipa,app}")
133
- @args_ipa_file = Dir.glob(build_path).max_by {|f| File.mtime(f)}
165
+ @args_ipa_file = nil
134
166
  end
135
167
  else
136
168
  raise Informative, "当前目录不是工程目录,不能编译"
@@ -138,7 +170,7 @@ module Pindo
138
170
 
139
171
 
140
172
  if @args_ipa_file.nil?
141
- build_path = File.join(current_project_dir, "*.{ipa,app,apk}")
173
+ build_path = File.join(current_project_dir, "*.{ipa,app,apk,html}")
142
174
  @args_ipa_file = Dir.glob(build_path).max_by {|f| File.mtime(f)}
143
175
  end
144
176
 
@@ -140,8 +140,9 @@ module Pindo
140
140
 
141
141
  build_path = File.join(web_export_dir, "build", "index.{html}")
142
142
  html_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
143
- puts "html_file_upload: #{html_file_upload}"
144
- puts "app_info_obj: #{app_info_obj}"
143
+ # 调试输出已移除,保持界面简洁
144
+ # puts "html_file_upload: #{html_file_upload}"
145
+ # puts "app_info_obj: #{app_info_obj}"
145
146
 
146
147
  if !html_file_upload.nil? && !app_info_obj.nil?
147
148
  description = nil
@@ -231,19 +231,21 @@ module Pindo
231
231
  web_res_path = File.dirname(ipa_file_upload)
232
232
  web_zip_dir = File.dirname(web_res_path)
233
233
  web_build_name = "webgl_build"
234
- # web_build_version = "1.0.0"
234
+ web_build_version = "1.0.0"
235
235
  begin
236
- if File.exist?(File.join(web_zip_dir, "web_build_info.json"))
237
- json_data = JSON.parse(File.read(File.join(web_zip_dir, "web_build_info.json")))
236
+ # web_build_info.json 应该和 index.html 在同一目录
237
+ if File.exist?(File.join(web_res_path, "web_build_info.json"))
238
+ json_data = JSON.parse(File.read(File.join(web_res_path, "web_build_info.json")))
238
239
  web_build_name = json_data["productName"]
239
- # web_build_version = json_data["version"]
240
+ web_build_version = json_data["version"]
241
+
240
242
  end
241
243
  rescue StandardError => e
242
244
 
243
245
  end
244
246
  current_project_dir = Dir.pwd
245
247
  web_build_name = web_build_name.downcase.strip.gsub(/[\s\-_]/, '')
246
- web_res_zip_fullname = File.join(web_zip_dir, web_build_name + ".zip")
248
+ web_res_zip_fullname = File.join(web_zip_dir, web_build_name + "_" + web_build_version + ".zip")
247
249
  if File.exist?(web_res_zip_fullname)
248
250
  FileUtils.rm_rf(web_res_zip_fullname)
249
251
  end
data/lib/pindo/version.rb CHANGED
@@ -6,7 +6,7 @@ require 'time'
6
6
 
7
7
  module Pindo
8
8
 
9
- VERSION = "5.6.2"
9
+ VERSION = "5.6.3"
10
10
 
11
11
  class VersionCheck
12
12
  RUBYGEMS_API = 'https://rubygems.org/api/v1/gems/pindo.json'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pindo
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.2
4
+ version: 5.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - wade
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-05 00:00:00.000000000 Z
10
+ date: 2025-10-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: claide