ocean_package 0.9.0 → 0.10.0
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/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/ocean_package/command.rb +30 -5
- data/lib/ocean_package/package.rb +12 -2
- data/lib/ocean_package/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1cc955eed6aa74ce48c6a3cc59c5bda438162073b8e86f04ec75261badf3e10
|
4
|
+
data.tar.gz: 5bfbf7f168a9436e6c07245c9ec2455ab66e3e4b5df4e517d52202a599afb778
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10f73f3b8c22d9551656918c397475cc82ddc2bedaac49bb6b57164b38033166a65d4e81cb7815ab589ecb3b2a38ca1fe52d84da41084cd66b7364a1f420fa74
|
7
|
+
data.tar.gz: c6af45c8b814831a267e29a43c6f89ba328b6bc7d0784a11e676328bc74c631152cea7b693438bf4124e06514eafae39761b362e758a019f8d545ffc3b321aa4
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -22,6 +22,9 @@ module OceanPackage
|
|
22
22
|
# @ 的手机号
|
23
23
|
attr_accessor :at_mobiles
|
24
24
|
|
25
|
+
# 自定义的ipa文件路径
|
26
|
+
attr_accessor :custom_ipa_file_path
|
27
|
+
|
25
28
|
def initialize(params = [])
|
26
29
|
argv = CLAide::ARGV.new(params)
|
27
30
|
|
@@ -46,7 +49,15 @@ module OceanPackage
|
|
46
49
|
export_options_plist = argv.option("export-options-plist", "")
|
47
50
|
Log.info("export_options_plist: #{export_options_plist}")
|
48
51
|
|
49
|
-
|
52
|
+
##### 自定义的 ipa 文件 #####
|
53
|
+
ipa_file_path = argv.option("ipa-file-path", "")
|
54
|
+
Log.info("ipa_file_path: #{ipa_file_path}")
|
55
|
+
@custom_ipa_file_path = ipa_file_path
|
56
|
+
|
57
|
+
# 自定义ipa文件,使用该文件作为 archive path
|
58
|
+
tmp_archive_path = has_custom_ipa_file ? File.dirname("#{ipa_file_path}") : archive_path
|
59
|
+
Log.info("tmp_archive_path: #{tmp_archive_path}")
|
60
|
+
@package = OceanPackage::Package.new(workspace_path, scheme, configuration, tmp_archive_path, company_name, export_options_plist)
|
50
61
|
|
51
62
|
fir_token = argv.option("fir-token", "")
|
52
63
|
Log.info("fir_token: #{fir_token}")
|
@@ -56,11 +67,11 @@ module OceanPackage
|
|
56
67
|
Log.info("change_log: #{change_log}")
|
57
68
|
|
58
69
|
fir_log_path = @package.final_archive_path + 'fir.log'
|
59
|
-
@fir = OceanPackage::Fir.new(fir_token, final_change_log,
|
70
|
+
@fir = OceanPackage::Fir.new(fir_token, final_change_log, final_ipa_file_path, fir_log_path)
|
60
71
|
|
61
72
|
##### 蒲公英 #####
|
62
73
|
pgy_api_key = argv.option("pgy-api-key", "")
|
63
|
-
@pgy = OceanPackage::Pgy.new(pgy_api_key, final_change_log,
|
74
|
+
@pgy = OceanPackage::Pgy.new(pgy_api_key, final_change_log, final_ipa_file_path)
|
64
75
|
Log.info("pgy_api_key: #{pgy_api_key}")
|
65
76
|
|
66
77
|
##### oss #####
|
@@ -94,8 +105,22 @@ module OceanPackage
|
|
94
105
|
end
|
95
106
|
end
|
96
107
|
|
108
|
+
# 是否设置了自定义的ipa文件
|
109
|
+
def has_custom_ipa_file
|
110
|
+
"#{@custom_ipa_file_path}".empty? ? false : true
|
111
|
+
end
|
112
|
+
|
113
|
+
# 最终的ipa文件路径
|
114
|
+
def final_ipa_file_path
|
115
|
+
has_custom_ipa_file ? "#{@custom_ipa_file_path}" : @package.ipa_file_path
|
116
|
+
end
|
117
|
+
|
118
|
+
# 运行
|
97
119
|
def run
|
98
|
-
|
120
|
+
# 没有自定义ipa文件,需要执行打包命令
|
121
|
+
unless has_custom_ipa_file
|
122
|
+
package.run
|
123
|
+
end
|
99
124
|
upload
|
100
125
|
send_ding_talk_msg
|
101
126
|
finished
|
@@ -157,7 +182,7 @@ module OceanPackage
|
|
157
182
|
|
158
183
|
# web hook 消息内容
|
159
184
|
def make_web_hook_message
|
160
|
-
ipa = OceanPackage::Ipa.new(
|
185
|
+
ipa = OceanPackage::Ipa.new(final_ipa_file_path)
|
161
186
|
ipa.run
|
162
187
|
|
163
188
|
# markdown 格式
|
@@ -33,6 +33,9 @@ module OceanPackage
|
|
33
33
|
@company_name = company_name
|
34
34
|
@date_time = Time.new.strftime("%Y-%m-%d_%H-%M-%S")
|
35
35
|
@export_options_plist = export_options_plist
|
36
|
+
|
37
|
+
# 预设置开始时间
|
38
|
+
@start_time = Time.now
|
36
39
|
end
|
37
40
|
|
38
41
|
# workspace 的路径
|
@@ -145,12 +148,19 @@ module OceanPackage
|
|
145
148
|
# 最终的打包路径
|
146
149
|
def final_archive_path
|
147
150
|
path = processed_archive_path
|
148
|
-
|
149
|
-
|
151
|
+
unless "#{@company_name}".empty?
|
152
|
+
path += @company_name + '/'
|
153
|
+
end
|
154
|
+
unless "#{project_name}".empty?
|
155
|
+
path += project_name + '/'
|
156
|
+
end
|
150
157
|
path += @date_time + '/'
|
151
158
|
|
152
159
|
Log.info("final archive path: #{path}")
|
153
160
|
|
161
|
+
# 不存在,需要进行创建,外部传入了 ipa 文件的情况
|
162
|
+
FileUtils.mkdir_p(path)
|
163
|
+
|
154
164
|
path
|
155
165
|
end
|
156
166
|
|