From 701e46ce8394bf90e232cdd56c325c45372e2f56 Mon Sep 17 00:00:00 2001 From: Otto Gebb Date: Wed, 26 Sep 2018 22:13:39 +0200 Subject: [PATCH] Make `traceImportant` produce a warning in TeamCity. Fixes #2108 --- src/app/Fake.BuildServer.TeamCity/TeamCity.fs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/Fake.BuildServer.TeamCity/TeamCity.fs b/src/app/Fake.BuildServer.TeamCity/TeamCity.fs index 6f3dcd0b219..48b806821fe 100644 --- a/src/app/Fake.BuildServer.TeamCity/TeamCity.fs +++ b/src/app/Fake.BuildServer.TeamCity/TeamCity.fs @@ -218,6 +218,10 @@ module TeamCity = (TeamCityWriter.encapsulateSpecialChars name) (TeamCityWriter.encapsulateSpecialChars message) (TeamCityWriter.encapsulateSpecialChars details) (TeamCityWriter.encapsulateSpecialChars expected) (TeamCityWriter.encapsulateSpecialChars actual) |> TeamCityWriter.sendStrToTeamCity + /// Sends a warning message. + let internal warning message = + TeamCityWriter.sendToTeamCity "##teamcity[message text='%s' status='WARNING']" message + /// TeamCity build parameters /// /// See [Predefined Build Parameters documentation](https://confluence.jetbrains.com/display/TCD18/Predefined+Build+Parameters) for more information @@ -396,7 +400,9 @@ module TeamCity = | _ -> TeamCityWriter.sendOpenBlock tag.Name tag.Type | TraceData.CloseTag (tag, _, _) -> TeamCityWriter.sendCloseBlock tag.Name - | TraceData.ImportantMessage text | TraceData.ErrorMessage text -> + | TraceData.ImportantMessage text -> + warning text + | TraceData.ErrorMessage text -> ConsoleWriter.write false color true text | TraceData.LogMessage(text, newLine) | TraceData.TraceMessage(text, newLine) -> ConsoleWriter.write false color newLine text