fastlane-plugin-bundletool 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 767f07f7ad832c2f3fbd48a0042b61164401e17cb7036ec5443d3bf661b84398
|
4
|
+
data.tar.gz: 8471216a1e08a0d07ce357557b304cdf19cc2e50a19514bdb22bc6dc494102c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 409b0158b1983b047670cc77ab5da427536d15ccc3073148a685f72b25ec19685913acc1a0aeef7c7caaba0878827e3c6e981e4a145140a6d884c1cd0aa653b3
|
7
|
+
data.tar.gz: 0d8e1689a07e0369579619d65b0ddaf11f20aa2121bef104990aa2fc4053fea9582eabd396d6131ce6380dfd0300305cf62fd2a9ea4437ae8d39aea9cbfea571
|
@@ -20,12 +20,13 @@ module Fastlane
|
|
20
20
|
end
|
21
21
|
|
22
22
|
bundletool_version = params[:bundletool_version]
|
23
|
+
download_url = params[:download_url]
|
23
24
|
aab_path = params[:aab_path]
|
24
25
|
output_path = params[:apk_output_path] || '.'
|
25
26
|
|
26
27
|
return unless validate_aab!(aab_path)
|
27
28
|
|
28
|
-
return unless download_bundletool(bundletool_version)
|
29
|
+
return unless download_bundletool(bundletool_version, download_url)
|
29
30
|
|
30
31
|
extract_universal_apk_from(aab_path, output_path, keystore_info)
|
31
32
|
end
|
@@ -39,20 +40,22 @@ module Fastlane
|
|
39
40
|
puts_success('Checking if .aab file exists')
|
40
41
|
end
|
41
42
|
|
42
|
-
def self.download_bundletool(version)
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
def self.download_bundletool(version, download_url)
|
44
|
+
Dir.mkdir "#{@project_root}/bundletool_temp"
|
45
|
+
|
46
|
+
unless download_url.nil?
|
47
|
+
puts_message("Downloading bundletool from #{download_url}")
|
48
|
+
download_and_write_bundletool(download_url)
|
49
|
+
else
|
50
|
+
puts_message("Downloading bundletool (#{version}) from https://github.com/google/bundletool/releases/download/#{version}/bundletool-all-#{version}.jar...")
|
51
|
+
download_and_write_bundletool("https://github.com/google/bundletool/releases/download/#{version}/bundletool-all-#{version}.jar")
|
49
52
|
end
|
50
|
-
puts_success('
|
53
|
+
puts_success('Downloaded bundletool')
|
51
54
|
rescue OpenURI::HTTPError => e
|
52
55
|
clean_temp!
|
53
|
-
puts_error!("Something went wrong when downloading bundletool version #{version}. \nError message\n #{e.message}")
|
54
|
-
false
|
55
|
-
end
|
56
|
+
puts_error!("Something went wrong when downloading bundletool version #{version}" + ". \nError message\n #{e.message}")
|
57
|
+
false
|
58
|
+
end
|
56
59
|
|
57
60
|
def self.extract_universal_apk_from(aab_path, apk_output_path, keystore_info)
|
58
61
|
aab_absolute_path = Pathname.new(File.expand_path(aab_path)).to_s
|
@@ -155,15 +158,19 @@ module Fastlane
|
|
155
158
|
description: 'Version of bundletool to use, by default 0.11.0 will be used',
|
156
159
|
is_string: true,
|
157
160
|
default_value: '0.11.0'),
|
161
|
+
FastlaneCore::ConfigItem.new(key: :download_url,
|
162
|
+
description: 'Url to download bundletool from, should point to a jar file',
|
163
|
+
is_string: true,
|
164
|
+
optional: true),
|
158
165
|
FastlaneCore::ConfigItem.new(key: :aab_path,
|
159
166
|
description: 'Path where the aab file is',
|
160
167
|
is_string: true,
|
161
168
|
optional: false,
|
162
169
|
verify_block: proc do |value|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
170
|
+
unless value && !value.empty?
|
171
|
+
UI.user_error!('You must set aab_path.')
|
172
|
+
end
|
173
|
+
end),
|
167
174
|
FastlaneCore::ConfigItem.new(key: :apk_output_path,
|
168
175
|
description: 'Path where the apk file is going to be placed',
|
169
176
|
is_string: true,
|
@@ -201,6 +208,16 @@ module Fastlane
|
|
201
208
|
def self.is_supported?(platform)
|
202
209
|
[:android].include?(platform)
|
203
210
|
end
|
211
|
+
|
212
|
+
private
|
213
|
+
|
214
|
+
def self.download_and_write_bundletool(download_url)
|
215
|
+
URI.open(download_url) do |bundletool|
|
216
|
+
File.open("#{@bundletool_temp_path}/bundletool.jar", 'wb') do |file|
|
217
|
+
file.write(bundletool.read)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
204
221
|
end
|
205
222
|
end
|
206
223
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-bundletool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Gonzalez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|