fastlane-plugin-android_reporter 0.1.31 → 0.1.32

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: 74e79c1107885281ee4656a121f04c46e954ebf65caab6049ad476a4f6d23c86
4
- data.tar.gz: 33b6a99394e47035bdd2adbce093bd6939deeb9fefd649611ba03f4a125df3dd
3
+ metadata.gz: aa4c112132e19fc087698f039596300a3e7b97685bd21d6e65d40379b3836038
4
+ data.tar.gz: c894f5b0b1a8529f02d6ee72ca8d86924e322cd558b0806e00dca22dde6c79a4
5
5
  SHA512:
6
- metadata.gz: 51dc8e38e708653a4bb79ced794e08884d97ce4153e45da66236764331e5f15abd8c571202323a6b08bbc76a308143a3f03e8decc7a30c89160f3ade083c0c6c
7
- data.tar.gz: 8dc9fa7c0ec77452cc4c62c17d73a88aecb509f2f1069d5215478b4786161e03561b3eda9b59dc8d88df4f5ef929fcd2760df0c132092333785a2c0b9d3c9365
6
+ metadata.gz: 9439f2b5d02ea710ab2b316630b3db64371c243a78ca0ed21e6ed3dd051c571e2bdbf14a3ea5e15ee2d4f285b2a8edc1a6ba9fc9ad760ca8e2da6f19ce0512f9
7
+ data.tar.gz: dcac33262aebd91396cbf7fca6e2c15f61a1bcb89f0bf520d4102a767e20b6edf61fca14b8bb1df15aefb59c63b3cde0fdfb1e13f3995452f5059d66644bd441
@@ -24,8 +24,9 @@ module Fastlane
24
24
  isLogcatFileUploaded = false
25
25
  isGradleDebugFileUploaded = false
26
26
  isGradleErrorFileUploaded = false
27
+ buildName = "Current Build"
27
28
 
28
- # 0. Checkout git to Current Branch to Run Tests on the Current Branch
29
+ # 1. Checkout git to Current Branch to Run Tests on the Current Branch
29
30
  if params[:tests_branch_name].to_s.length > 0
30
31
  begin
31
32
  sh("git fetch")
@@ -35,7 +36,27 @@ module Fastlane
35
36
  end
36
37
  end
37
38
 
38
- # 1. Send Slack Message from Android Reporter Bot That Testing Task Has been Started ....
39
+ # 2. Get Build Version From Gradle.Props File
40
+ if params[:version_name_line_number].to_s.length > 0
41
+ UI.message("Step Read Version Name of the Build")
42
+ line_num = params[:version_name_line_number].to_i
43
+ text=File.open('gradle.properties').read
44
+ text.gsub!(/\r\n?/, "\n")
45
+ text.each_line.with_index do |line, index|
46
+ if (index + 1) == line_num
47
+ buildName = line
48
+ end
49
+ end
50
+ end
51
+
52
+ # 3. Split The String and Get the Value Without Key
53
+ if params[:version_name_line_number].to_s.length > 0
54
+ buildName = buildName.split('=', -1)
55
+ buildName = buildName[1]
56
+ UI.message("Current Build Name : " + buildName)
57
+ end
58
+
59
+ # 4. Send Slack Message from Android Reporter Bot That Testing Task Has been Started ....
39
60
  if is_slack_enabled
40
61
  UI.message("Slack Messages Bot Started .... [Configuration Step]")
41
62
  Slack.configure do |config|
@@ -48,6 +69,7 @@ module Fastlane
48
69
  text: " ================================================================================== \n" +
49
70
  " New UI Testing Task Started For Current Release : " + time + " \n " +
50
71
  " Current Branch Build : " + sh("git rev-parse --abbrev-ref HEAD") +
72
+ " Current Build Version : " + buildName +
51
73
  " ================================================================================== \n",
52
74
  as_user: true
53
75
  )
@@ -59,8 +81,8 @@ module Fastlane
59
81
  end
60
82
  end
61
83
 
62
- # 2. List All Available AVD's in The Device
63
- # 3. Run the Target AVD Name From Params
84
+ # 5. List All Available AVD's in The Device
85
+ # 6. Run the Target AVD Name From Params
64
86
  if params[:avd_name].to_s.length > 0
65
87
  Thread.new do
66
88
  UI.message("Android Reporting Started to Run AVD : (" + avd_name + ")")
@@ -70,15 +92,15 @@ module Fastlane
70
92
  end
71
93
  end
72
94
 
73
- # 4. Clear the Logcat Server Before Start
95
+ # 7. Clear the Logcat Server Before Start
74
96
  if params[:generate_adb_file]
75
97
  Process.fork do
76
98
  sh("adb logcat -c")
77
99
  end
78
100
  end
79
101
 
80
- # 5. Start Clean Task with Target UI Task
81
- # 6. If Gradle Task Success then Will Generate ADB Log File then Kill Server Connection inside ADB
102
+ # 8. Start Clean Task with Target UI Task
103
+ # 9. If Gradle Task Success then Will Generate ADB Log File then Kill Server Connection inside ADB
82
104
  begin
83
105
  UI.message([
84
106
  "Android Reporting Started to Run Gradle Testing Task ...",
@@ -109,7 +131,7 @@ module Fastlane
109
131
  end
110
132
  end
111
133
 
112
- # 7. Generate Gradle Tasks (Failed and Success Files)
134
+ # 10. Generate Gradle Tasks (Failed and Success Files)
113
135
  if params[:generate_gradle_files]
114
136
  Process.fork do
115
137
  sh("./gradlew build > android-logs.txt 2> android-error-logs.txt")
@@ -121,14 +143,14 @@ module Fastlane
121
143
  end
122
144
  end
123
145
 
124
- # 8. Check Slack Option if Enabled or Not To Print The Message
146
+ # 11. Check Slack Option if Enabled or Not To Print The Message
125
147
  if is_slack_enabled
126
148
  UI.message("Slack Configuration Status : Started ...")
127
149
  else
128
150
  UI.message("Slack Configuration Status : Disabled ...")
129
151
  end
130
152
 
131
- # 9. Upload Files to Slack
153
+ # 12. Upload Files to Slack
132
154
  if is_slack_enabled
133
155
  begin
134
156
  UI.message("Slack Messages Bot Upload Files Tasks Started ....")
@@ -210,7 +232,8 @@ module Fastlane
210
232
  puts error.backtrace
211
233
  end
212
234
 
213
- slackFinalMessageContent = "Files Status : With Time : " + time + " : Info = \n"
235
+ # 13. Send Message With Files Summery
236
+ slackFinalMessageContent = "Files Status : With Time : " + time + " : \n"
214
237
  if isGradleDebugFileUploaded
215
238
  slackFinalMessageContent += "Gradle Debug File Uploaded \n"
216
239
  end
@@ -224,6 +247,16 @@ module Fastlane
224
247
  end
225
248
 
226
249
  client.chat_postMessage(channel: "#" + params[:slack_channel_name], text: slackFinalMessageContent, as_user: true)
250
+
251
+ # 14. If the Gradle Task Success Then Run Specific Lane Else Send Slack Message The Build Failed
252
+ if gradle_task_result
253
+ if params[:target_lane_name].to_s.length > 0
254
+ sh("fastlane", params[:target_lane_name])
255
+ end
256
+ else
257
+ UI.message("Gradle Task Result Failed ...")
258
+ client.chat_postMessage(channel: "#" + params[:slack_channel_name], text: "Gradle Testing Task Failed Logs File Should be Uploaded", as_user: true)
259
+ end
227
260
  end
228
261
 
229
262
  end
@@ -315,6 +348,22 @@ module Fastlane
315
348
  optional: true,
316
349
  type: String,
317
350
  sensitive: true
351
+ ),
352
+ FastlaneCore::ConfigItem.new(
353
+ key: :target_lane_name,
354
+ env_name: "TARGET_LANE_NAME",
355
+ description: "Target Lane Name To Execute Once Tests Task Successfully Built",
356
+ optional: true,
357
+ type: String,
358
+ sensitive: true
359
+ ),
360
+ FastlaneCore::ConfigItem.new(
361
+ key: :version_name_line_number,
362
+ env_name: "VERSION_NAME_LINE_NUMBER",
363
+ description: "Target Lane Name To Execute Once Tests Task Successfully Built",
364
+ optional: true,
365
+ type: String,
366
+ sensitive: true
318
367
  )
319
368
  ]
320
369
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AndroidReporter
3
- VERSION = "0.1.31"
3
+ VERSION = "0.1.32"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-android_reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.31
4
+ version: 0.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yazan Tarifi