fastlane-plugin-bundletool 1.0.5 → 1.0.7

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: 3316b9eeacf70304f2e0f69d783ca9d05d2c2d1796506b3542405ccb52d4ecd5
4
- data.tar.gz: 5cb733e217d21209ab8609c05fbf8f003494b211cf923c5b9acb29a7e7819fae
3
+ metadata.gz: 8a1ce147b19920327f7ca4a32519214316955aa906469ec9eb2edb5f249e9f72
4
+ data.tar.gz: abb7030269fda53b86f532da8a137a5fafc593c69be5fbb164f01157c5b5e36d
5
5
  SHA512:
6
- metadata.gz: b7df6d358ed9595839f8639a9cc86590310a5fe7f8645e4f8cc6db926c30f60ce74ad27ab1df51ebd45872afc412ab1c579954bc0716b768204d4ee60906e22d
7
- data.tar.gz: 9d493090e285ec55f947dc0bd172883f0414725b562a723283e0e14b5450d75e350c55ab23451e001dfcc4c295004e1bb5e4fd7042adcb7bce9ae6df3c223be7
6
+ metadata.gz: 0f6c1a75aa421ef5184da894a6ebdf2a15824698479b90927f86188d8953ddccaa55fcdd62276c18258a4f9beb6d9c4110335e69ecfc9711f693ac851f579d1d
7
+ data.tar.gz: eadcb068dd75527b1eb35ac1683c43e029d824a859202cff77d8a7de901b516b94243722e34f543cb8714822ae0a7ec9af5679efe6156d64be7f4bed759ba2c4
data/README.md CHANGED
@@ -13,7 +13,7 @@ fastlane add_plugin bundletool
13
13
  or in your Pluginfile under fastlane folder write the following line and run `bundle install`.
14
14
 
15
15
  ```
16
- gem 'fastlane-plugin-bundletool', '1.0.4'
16
+ gem 'fastlane-plugin-bundletool', '1.0.6'
17
17
  ```
18
18
 
19
19
  ## About bundletool
@@ -34,7 +34,7 @@ bundletool(
34
34
  ks_password: keystore_password,
35
35
  ks_key_alias: keystore_alias,
36
36
  ks_key_alias_password: keystore_alias_password,
37
- bundletool_version: '0.11.0',
37
+ bundletool_version: '1.10.0', # For searching a specific version of bundletool visit https://github.com/google/bundletool/releases
38
38
  aab_path: aab_path,
39
39
  apk_output_path: apk_output_path,
40
40
  verbose: true
@@ -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
@@ -37,22 +38,27 @@ module Fastlane
37
38
  return false
38
39
  end
39
40
  puts_success('Checking if .aab file exists')
41
+ return true
40
42
  end
41
43
 
42
- def self.download_bundletool(version)
43
- puts_message("Downloading bundletool (#{version}) from https://github.com/google/bundletool/releases/download/#{version}/bundletool-all-#{version}.jar...")
44
- Dir.mkdir "#{@project_root}/bundletool_temp"
45
- URI.open("https://github.com/google/bundletool/releases/download/#{version}/bundletool-all-#{version}.jar") do |bundletool|
46
- File.open("#{@bundletool_temp_path}/bundletool.jar", 'wb') do |file|
47
- file.write(bundletool.read)
48
- end
44
+ def self.download_bundletool(version, download_url)
45
+ Dir.mkdir "#{@project_root}/bundletool_temp"
46
+
47
+ unless download_url.nil?
48
+ puts "Downloading bundletool from #{download_url}"
49
+ puts_message("Downloading bundletool from #{download_url}")
50
+ download_and_write_bundletool(download_url)
51
+ else
52
+ puts_message("Downloading bundletool (#{version}) from https://github.com/google/bundletool/releases/download/#{version}/bundletool-all-#{version}.jar...")
53
+ download_and_write_bundletool("https://github.com/google/bundletool/releases/download/#{version}/bundletool-all-#{version}.jar")
49
54
  end
50
- puts_success('Downloading bundletool')
55
+ puts_success('Downloaded bundletool')
56
+ true
51
57
  rescue OpenURI::HTTPError => e
52
58
  clean_temp!
53
- puts_error!("Something went wrong when downloading bundletool version #{version}. \nError message\n #{e.message}")
59
+ puts_error!("Something went wrong when downloading bundletool version #{version}" + ". \nError message\n #{e.message}")
54
60
  false
55
- end
61
+ end
56
62
 
57
63
  def self.extract_universal_apk_from(aab_path, apk_output_path, keystore_info)
58
64
  aab_absolute_path = Pathname.new(File.expand_path(aab_path)).to_s
@@ -155,15 +161,19 @@ module Fastlane
155
161
  description: 'Version of bundletool to use, by default 0.11.0 will be used',
156
162
  is_string: true,
157
163
  default_value: '0.11.0'),
164
+ FastlaneCore::ConfigItem.new(key: :download_url,
165
+ description: 'Url to download bundletool from, should point to a jar file',
166
+ is_string: true,
167
+ optional: true),
158
168
  FastlaneCore::ConfigItem.new(key: :aab_path,
159
169
  description: 'Path where the aab file is',
160
170
  is_string: true,
161
171
  optional: false,
162
172
  verify_block: proc do |value|
163
- unless value && !value.empty?
164
- UI.user_error!('You must set aab_path.')
165
- end
166
- end),
173
+ unless value && !value.empty?
174
+ UI.user_error!('You must set aab_path.')
175
+ end
176
+ end),
167
177
  FastlaneCore::ConfigItem.new(key: :apk_output_path,
168
178
  description: 'Path where the apk file is going to be placed',
169
179
  is_string: true,
@@ -201,6 +211,16 @@ module Fastlane
201
211
  def self.is_supported?(platform)
202
212
  [:android].include?(platform)
203
213
  end
214
+
215
+ private
216
+
217
+ def self.download_and_write_bundletool(download_url)
218
+ URI.open(download_url) do |bundletool|
219
+ File.open("#{@bundletool_temp_path}/bundletool.jar", 'wb') do |file|
220
+ file.write(bundletool.read)
221
+ end
222
+ end
223
+ end
204
224
  end
205
225
  end
206
226
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Bundletool
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.7"
4
4
  end
5
5
  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.5
4
+ version: 1.0.7
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-02-28 00:00:00.000000000 Z
11
+ date: 2023-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.0.3.1
171
+ rubygems_version: 3.1.6
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Extracts a universal apk from an .aab file