Skip to content

Commit a11877b

Browse files
committed
[ci] Don't emit warnings for normal CheckAdbTarget operations.
1 parent 37792c4 commit a11877b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/Adb.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ protected class CommandInfo
2121
public Func<string> ArgumentsGenerator { get; set; }
2222
public bool MergeStdoutAndStderr { get; set; } = true;
2323
public bool IgnoreExitCode { get; set; }
24+
public bool LogIgnoredExitCodeAsWarning { get; set; } = true;
2425
public string StdoutFilePath { get; set; }
2526
public bool StdoutAppend { get; set; }
2627
public string StderrFilePath { get; set; }
@@ -88,7 +89,11 @@ public override bool Execute ()
8889
Log.LogError (message);
8990
break;
9091
}
91-
Log.LogWarning (message);
92+
93+
if (info.LogIgnoredExitCodeAsWarning)
94+
Log.LogWarning (message);
95+
else
96+
Log.LogMessage (MessageImportance.Normal, message);
9297
} catch {
9398
throw;
9499
} finally {

build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckAdbTarget.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public class CheckAdbTarget : Adb
3131

3232
public override bool Execute ()
3333
{
34+
// Log messages as output rather than warnings
35+
WriteOutputAsMessage = true;
36+
3437
base.Execute ();
3538

3639
// We always succeed
@@ -43,12 +46,14 @@ public override bool Execute ()
4346
new CommandInfo {
4447
ArgumentsString = $"{AdbTarget} shell getprop ro.build.version.sdk",
4548
IgnoreExitCode = true,
49+
LogIgnoredExitCodeAsWarning = false,
4650
MergeStdoutAndStderr = false,
4751
},
4852

4953
new CommandInfo {
5054
ArgumentsString = $"{AdbTarget} shell pm path com.android.shell",
5155
IgnoreExitCode = true,
56+
LogIgnoredExitCodeAsWarning = false,
5257
MergeStdoutAndStderr = false,
5358
ShouldRun = () => IsValidTarget
5459
},

0 commit comments

Comments
 (0)