Skip to content

Commit

Permalink
fix(build): Update build script to treat warnings as error
Browse files Browse the repository at this point in the history
  • Loading branch information
abhipsaMisra committed Feb 4, 2021
1 parent 529c504 commit a46c26f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ Function CheckLocalPackagesAvailableForTesting()
return (-not [string]::IsNullOrWhiteSpace($env:AZURE_IOT_LOCALPACKAGES))
}

Function DidBuildFail($buildOutputFileName)
{
return Select-String -Path $buildOutputFileName -Pattern 'Build FAILED' -Quiet
}

Function BuildProject($path, $message)
{
$label = "BUILD: --- $message $configuration ---"
Expand All @@ -120,9 +125,9 @@ Function BuildProject($path, $message)
}
}

& dotnet build $projectPath --verbosity $verbosity --configuration $configuration
& dotnet build $projectPath --verbosity $verbosity --configuration $configuration -warnAsError | Tee-Object ./buildlog.txt

if ($LASTEXITCODE -ne 0)
if (DidBuildFail "./buildlog.txt" -or $LASTEXITCODE -ne 0)
{
throw "Build failed: $label"
}
Expand Down
2 changes: 1 addition & 1 deletion iothub/device/src/RetryPolicies/NoRetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class NoRetry : IRetryPolicy
public NoRetry()
{
if (Logging.IsEnabled)
Logging.Info(this, $"NOTE: A no-retry retry policy has been enabled," +
Logging.Info(this, $"NOTE: A no-retry policy has been enabled," +
$" the client will not perform any retries on disconnection.", nameof(NoRetry));
}

Expand Down

0 comments on commit a46c26f

Please sign in to comment.