fastlane-plugin-stream_actions 0.3.10 → 0.3.12

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: b79f6dff0348e86b6e0c99905b3dbe290315bdd6463b58e7f3d4ae16624e5be0
4
- data.tar.gz: 4d5a2f46f4dab3244265f00225d4e27c11b40e48f40415bc5b65ec65ba3c6954
3
+ metadata.gz: 9c73c04e5045faac03b3b1f26223b28ad5dae5a90df3061877081f37b6fd91bc
4
+ data.tar.gz: df4dd4f8eeff082936d12462d00eebad7448848b6c5a72606eb427a4c5fa2ae4
5
5
  SHA512:
6
- metadata.gz: 102bf95950869523ad1bfd0c1a10d3860845521f2ed6fdbd3461886d695a65149cb6a0078c5715fe860af8e66ff921fe6f31c9bb29e060be9bdf49815aef1d37
7
- data.tar.gz: 5c471b093fb45cf98ad819d4625a9cad46c4152aac9bdfa1912438df822f9130230354f34e91741c01be0a7817a323ba0b2cf44c8acf6d2a46b54d714458ae25
6
+ metadata.gz: ba945e29b576de44ec2d3817adda733455e5644eb2786adbabfa56da40a618be563f1a7586a3bee5b343ef16774ec1708cc5b45b454f09d5ba710c270fdc65ac
7
+ data.tar.gz: 0b9472d3dd485bf1873b210e4f9058f1f1fd293883915e15a54890aa494717b1fa15b28d06a6f1e6fa33fbefa18b87930ff19203ff05efb31dce6332a823e2b0
@@ -87,15 +87,18 @@ module Fastlane
87
87
 
88
88
  app_path = File.directory?(derived_data_app_path) ? derived_data_app_path : products_app_path
89
89
 
90
- if params[:output_directory]
91
- FileUtils.mkdir_p(params[:output_directory])
92
- FileUtils.cp_r(app_path, params[:output_directory])
93
- "#{params[:output_directory]}/#{params[:scheme]}.app"
94
- else
95
- FileUtils.rm_rf("#{params[:scheme]}.app")
96
- FileUtils.cp_r(app_path, './')
97
- "./#{params[:scheme]}.app"
98
- end
90
+ new_path =
91
+ if params[:output_directory]
92
+ FileUtils.mkdir_p(params[:output_directory])
93
+ FileUtils.cp_r(app_path, params[:output_directory])
94
+ "#{params[:output_directory]}/#{params[:scheme]}.app"
95
+ else
96
+ FileUtils.rm_rf("#{params[:scheme]}.app")
97
+ FileUtils.cp_r(app_path, './')
98
+ "./#{params[:scheme]}.app"
99
+ end
100
+
101
+ File.expand_path(new_path)
99
102
  end
100
103
 
101
104
  def self.verify_destination(params)
@@ -158,7 +161,7 @@ module Fastlane
158
161
  ['project', 'Path to the project file'],
159
162
  ['scheme', "The project's scheme. Make sure it's marked as `Shared`"],
160
163
  ['platform', "Use a custom simulator destination for building the app (iOS, tvOS or watchOS)"],
161
- ['configuration', 'The configuration to use when building the app. Defaults to "Release"'],
164
+ ['configuration', 'The configuration to use when building the app. Defaults to "Debug"'],
162
165
  ['derived_data_path', 'The directory where built products and other derived data will go'],
163
166
  ['result_bundle_path', 'Path to the result bundle directory to create'],
164
167
  ['buildlog_path', 'The directory where to store the build log'],
@@ -0,0 +1,57 @@
1
+ module Fastlane
2
+ module Actions
3
+ class WaitAndroidEmuIdle < Action
4
+ def self.run(params)
5
+ start_time = Time.now
6
+ load_threshold = 1.0
7
+ UI.important("Start waiting until device is idle (#{Time.now})")
8
+ adb_command = 'adb shell uptime | cut -d , -f 3 | cut -f 2 -d :'
9
+ load = `#{adb_command}`.strip.to_f
10
+
11
+ end_time = start_time + 1800
12
+ while load > load_threshold && Time.now < end_time
13
+ if load < 4
14
+ `adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" || echo`
15
+ anr_package = `adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" | cut -f 2 -d : | sed -e "s/}//" -e "s/^ *//"`.strip
16
+ unless anr_package.empty?
17
+ UI.important("ANR on screen for: #{anr_package}. Restarting it.")
18
+ begin
19
+ `adb shell su 0 killall #{anr_package}`
20
+ rescue StandardError => e
21
+ UI.error(e)
22
+ # Fallback to click if kill didn't work. This location is for a 1080x1920 screen
23
+ `adb shell input tap 540 935 || echo`
24
+ end
25
+
26
+ if anr_package == 'com.android.systemui'
27
+ `adb shell am start-service -n com.android.systemui/.SystemUIService || echo`
28
+ end
29
+ end
30
+ end
31
+
32
+ sleep(10)
33
+ load = `#{adb_command}`.strip.to_f
34
+ end
35
+
36
+ UI.important('Reached timeout before device is idle 😕') if load > load_threshold
37
+ UI.important("Waited until device is idle for #{(Time.now - start_time).to_i} seconds ⌛️")
38
+ end
39
+
40
+ #####################################################
41
+ # @!group Documentation
42
+ #####################################################
43
+
44
+ def self.description
45
+ 'Adds environment variables to a test plan'
46
+ end
47
+
48
+ def self.available_options
49
+ []
50
+ end
51
+
52
+ def self.supported?(_platform)
53
+ [:android].include?(platform)
54
+ end
55
+ end
56
+ end
57
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.10'
3
+ VERSION = '0.3.12'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-23 00:00:00.000000000 Z
11
+ date: 2023-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xctest_list
@@ -244,6 +244,7 @@ files:
244
244
  - lib/fastlane/plugin/stream_actions/actions/testflight_build.rb
245
245
  - lib/fastlane/plugin/stream_actions/actions/touch_changelog.rb
246
246
  - lib/fastlane/plugin/stream_actions/actions/update_testplan.rb
247
+ - lib/fastlane/plugin/stream_actions/actions/wait_android_emu_idle.rb
247
248
  - lib/fastlane/plugin/stream_actions/version.rb
248
249
  homepage: https://github.com/GetStream/fastlane-plugin-stream_actions
249
250
  licenses: []