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: 3316b9eeacf70304f2e0f69d783ca9d05d2c2d1796506b3542405ccb52d4ecd5
4
- data.tar.gz: 5cb733e217d21209ab8609c05fbf8f003494b211cf923c5b9acb29a7e7819fae
3
+ metadata.gz: 767f07f7ad832c2f3fbd48a0042b61164401e17cb7036ec5443d3bf661b84398
4
+ data.tar.gz: 8471216a1e08a0d07ce357557b304cdf19cc2e50a19514bdb22bc6dc494102c3
5
5
  SHA512:
6
- metadata.gz: b7df6d358ed9595839f8639a9cc86590310a5fe7f8645e4f8cc6db926c30f60ce74ad27ab1df51ebd45872afc412ab1c579954bc0716b768204d4ee60906e22d
7
- data.tar.gz: 9d493090e285ec55f947dc0bd172883f0414725b562a723283e0e14b5450d75e350c55ab23451e001dfcc4c295004e1bb5e4fd7042adcb7bce9ae6df3c223be7
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
- 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
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('Downloading bundletool')
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
- unless value && !value.empty?
164
- UI.user_error!('You must set aab_path.')
165
- end
166
- end),
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Bundletool
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
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.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-02-28 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry