fastlane-plugin-mango 1.3.25 → 1.3.34

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: e38a84cceed91c04a4ce62698766017ee521d3721d885276087b8b47ec57de73
4
- data.tar.gz: 9e8569619ff82aa951602614b7aae19a1a1247af2ab5b87ba2ba3fb665130132
3
+ metadata.gz: b7858bdb16a89774de4d49284cb900ec6bfd0b226d42765303a60a1daedc425f
4
+ data.tar.gz: 3dbfefd9bbf1edd815a7ad68ac260415d34c07adc2665d7027bb06833b8fb033
5
5
  SHA512:
6
- metadata.gz: e4721cdac4969cdfd8dd7f86143b07edc87ce0853b868ba68d0c3c509f23265300832ff77e6acb3f761c78d8c86c11944768de059c092927cec3f856d95213ae
7
- data.tar.gz: 4a677f075b53365135d3a498e4393cc37cef755e27dd18cba8299fe602d571562b29c7955c6d3e5dce709cbec54e604615d3e8afee4bb747921c6e89ca5524a9
6
+ metadata.gz: b60056f85329209a5cced72bd0181e023f4e12f1e8d1d058a8456deb956d6ee98a02af9d5eda0891c2d8f62c2ae6d0af8183f39b7c96cab20f78d8071a8a4e99
7
+ data.tar.gz: ac31d9b3f06da7fa85c100cd8838cb0925730e1135effc8801722ccfb4e7c98dc2651014fa0e40f7b3d15dec13f25ecb0f4ae91781070f3b10a3f0c64fa0f953
@@ -11,6 +11,7 @@ module Fastlane
11
11
  mango_helper.setup_container
12
12
 
13
13
  docker_commander = Helper::DockerCommander.new(mango_helper.container_name)
14
+ Helper::EmulatorLanguage.set(params[:emulator_language], docker_commander) if params[:emulator_language]
14
15
 
15
16
  failure_buffer_timeout = 5
16
17
  timeout_command = "timeout #{params[:maximal_run_time] - failure_buffer_timeout}m"
@@ -202,6 +203,12 @@ module Fastlane
202
203
  description: 'A bool. True for vnc_enabled False for vnc_disabled',
203
204
  type: Boolean,
204
205
  default_value: true,
206
+ optional: true),
207
+
208
+ FastlaneCore::ConfigItem.new(key: :emulator_language,
209
+ env_name: 'EMULATOR_LANGUAGE',
210
+ description: 'A string that identify a device locale (e.g. de_DE)',
211
+ type: String,
205
212
  optional: true)
206
213
  ]
207
214
  end
@@ -45,7 +45,7 @@ module Fastlane
45
45
  Actions.sh("docker rm -f #{container_name}") if container_name
46
46
  rescue StandardError
47
47
  sleep 5
48
- UI.important("Was not able to delete the container after the first attempt, trying again")
48
+ UI.important('Was not able to delete the container after the first attempt, trying again')
49
49
  retry
50
50
  end
51
51
 
@@ -68,6 +68,10 @@ module Fastlane
68
68
  end
69
69
  end
70
70
 
71
+ def cp(file:)
72
+ Actions.sh("docker cp #{file} #{container_name}:/root/tests/.")
73
+ end
74
+
71
75
  def prune
72
76
  Action.sh('docker system prune -f')
73
77
  end
@@ -0,0 +1,25 @@
1
+ module Fastlane
2
+ module Helper
3
+ module EmulatorLanguage
4
+ def self.set(lang, docker_commander)
5
+ UI.important("Changing device locale to #{lang}")
6
+
7
+ retries ||= 5
8
+ language = lang.split('_')[0]
9
+ country = lang.split('_')[1]
10
+ apk_path = File.join(File.dirname(__FILE__), 'settings.apk')
11
+ docker_commander.cp(file: apk_path)
12
+ docker_commander.exec(command: 'adb install /root/tests/settings.apk')
13
+ docker_commander.exec(command: 'adb shell pm grant io.appium.settings android.permission.CHANGE_CONFIGURATION')
14
+ docker_commander.exec(command: "adb shell am broadcast -a io.appium.settings.locale -n io.appium.settings/.receivers.LocaleSettingReceiver --es lang #{language} --es country #{country}")
15
+ rescue StandardError => e
16
+ raise e if retries.zero?
17
+
18
+ puts "Got an exception: #{e.message}. Will retry in 5 seconds"
19
+ retries -= 1
20
+ sleep 5
21
+ retry
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Mango
3
- VERSION = '1.3.25'.freeze
3
+ VERSION = '1.3.34'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-mango
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.25
4
+ version: 1.3.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serghei Moret, Daniel Hartwich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-29 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -149,7 +149,9 @@ files:
149
149
  - lib/fastlane/plugin/mango/helper/cpu_load_handler.rb
150
150
  - lib/fastlane/plugin/mango/helper/docker_commander.rb
151
151
  - lib/fastlane/plugin/mango/helper/emulator_commander.rb
152
+ - lib/fastlane/plugin/mango/helper/emulator_language.rb
152
153
  - lib/fastlane/plugin/mango/helper/mango_helper.rb
154
+ - lib/fastlane/plugin/mango/helper/settings.apk
153
155
  - lib/fastlane/plugin/mango/version.rb
154
156
  homepage: https://github.com/xing/mango
155
157
  licenses: