fastlane-plugin-automated_test_emulator_run_next 1.0.2 → 1.0.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: 15f9b6cb75b17dee48b9ea8d6c914e011969fe82f0f9925f9d8e819ef13091ed
4
- data.tar.gz: 3e287cbe9636344669abf1d01e13e002d26265683299cc6a4f0663748ccf1ff0
3
+ metadata.gz: b3515edbd07b82c8d888a7d8f510101723e79932f291abde4d29caeae9ca7347
4
+ data.tar.gz: c0aa43738a751377f7c9b48599ec1af2fd613445a1d29494b94bd91e40f14313
5
5
  SHA512:
6
- metadata.gz: 39fdf0572412c212b5cb747116cef5741cf8f3a0e0522f1b5aba343dfffa07c81482edf1ddee3dc284ad98d0d0f3f1cba4f52d6a378ddae122cac24b85da2b7f
7
- data.tar.gz: 7bcf269703f7ed395bd331c3b5ef2bfcad8bfba70d39eab9d1fde7302516bde93448fdcde44113dabcfdb4d7a8f18b1dab7abd0b1c67d585139fe67beb46ca56
6
+ metadata.gz: 110f5a70c09b980a4a1acdd87e056697ab81becdb02d57c2592ad875d5adf68b59b01f13bd231942a61fa592bab42a1c77f1f6ebfecb4407dde3b3f9cabe8c6e
7
+ data.tar.gz: c73e587fc798d49462129af309c4a614047f7bbc255bb9394200c94be484332772a6875809ed6e1efe2cb1581e51f517cafc460cd3071ddf4bea786d83d82352
@@ -67,7 +67,16 @@ module Fastlane
67
67
  else
68
68
  # Create AVD
69
69
  UI.message(["AVD with name '", avd_schemes[i].avd_name, "' does not exist. Creating new AVD."].join("").yellow)
70
- Action.sh(avd_controllers[i].command_create_avd)
70
+ Action.sh(avd_controllers[i].command_create_avd, error_callback: lambda { |result|
71
+ if params[:install_missing_image] && result.include?("Error: Package path is not valid.")
72
+ UI.message("System image not found: attempting to install #{avd_schemes[i].create_avd_package}".yellow)
73
+ Action.sh(avd_controllers[i].command_install_image)
74
+ UI.success("System image successfully installed! creating new AVD #{avd_schemes[i].avd_name}")
75
+ Action.sh(avd_controllers[i].command_create_avd)
76
+ else
77
+ UI.user_error!(result)
78
+ end
79
+ })
71
80
  end
72
81
  end
73
82
 
@@ -396,6 +405,12 @@ module Fastlane
396
405
  default_value: ENV['ANDROID_SDK_HOME'] || ENV['ANDROID_HOME'],
397
406
  is_string: true,
398
407
  optional: true),
408
+ FastlaneCore::ConfigItem.new(key: :install_missing_image,
409
+ env_name: "AVD_INSTALL_MISSING_IMAGE",
410
+ description: "Enable to allow plugin to attempt to install any missing system images configured in the json setup",
411
+ default_value: false,
412
+ is_string: false,
413
+ optional: true),
399
414
 
400
415
 
401
416
  #launch config params
@@ -59,4 +59,4 @@ module Fastlane
59
59
  end
60
60
  end
61
61
  end
62
- end
62
+ end
@@ -5,7 +5,7 @@ module Fastlane
5
5
 
6
6
  class AVD_Controller
7
7
  attr_accessor :command_create_avd, :command_start_avd, :command_delete_avd, :command_apply_config_avd, :command_get_property, :command_kill_device,
8
- :output_file
8
+ :command_install_image, :output_file
9
9
 
10
10
  def self.create_output_file(params)
11
11
  output_file = Tempfile.new('emulator_output', '#{params[:AVD_path]}')
@@ -122,8 +122,14 @@ module Fastlane
122
122
  sh_kill_device,
123
123
  "&>/dev/null"].join(" ")
124
124
 
125
+ avd_controller.command_install_image = [
126
+ 'yes |', # accept any license prompts
127
+ sdk_helper.sdk_manager,
128
+ "'#{avd_scheme.create_avd_package}'"
129
+ ].join(" ")
130
+
125
131
  return avd_controller
126
132
  end
127
133
  end
128
134
  end
129
- end
135
+ end
@@ -30,6 +30,10 @@ module Fastlane
30
30
  def avd_manager
31
31
  return "#{command_line_tools_dir}/avdmanager"
32
32
  end
33
+
34
+ def sdk_manager
35
+ return "#{command_line_tools_dir}/sdkmanager"
36
+ end
33
37
  end
34
38
  end
35
- end
39
+ end
@@ -169,4 +169,4 @@ module Fastlane
169
169
  end
170
170
  end
171
171
  end
172
- end
172
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AutomatedTestEmulatorRunNext
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-automated_test_emulator_run_next
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroto Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-02 00:00:00.000000000 Z
11
+ date: 2022-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry