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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa4c112132e19fc087698f039596300a3e7b97685bd21d6e65d40379b3836038
|
4
|
+
data.tar.gz: c894f5b0b1a8529f02d6ee72ca8d86924e322cd558b0806e00dca22dde6c79a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
63
|
-
#
|
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
|
-
#
|
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
|
-
#
|
81
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
|
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
|