From 6eb29362f16a4d457507067828bba06b0c7c2956 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 2 May 2017 16:52:07 -0700 Subject: [PATCH] Restore color output on CI --- build/KoreBuild.ps1 | 16 ++++------------ build/KoreBuild.sh | 33 +++------------------------------ 2 files changed, 7 insertions(+), 42 deletions(-) diff --git a/build/KoreBuild.ps1 b/build/KoreBuild.ps1 index f4aa1c2..cf17fec 100644 --- a/build/KoreBuild.ps1 +++ b/build/KoreBuild.ps1 @@ -2,7 +2,7 @@ param([parameter(ValueFromRemainingArguments=$true)][string[]] $allparams) -function exec($cmd) { +function __exec($cmd) { $cmdName = [IO.Path]::GetFileName($cmd) Write-Host -ForegroundColor Cyan "> $cmdName $args" & $cmd @args @@ -103,14 +103,6 @@ $msbuildArtifactsDir = "$repoFolder/artifacts/msbuild" $msbuildLogFilePath = "$msbuildArtifactsDir/msbuild.log" $msBuildResponseFile = "$msbuildArtifactsDir/msbuild.rsp" -$preflightClpOption='/clp:DisableConsoleColor' -$msbuildClpOption='/clp:DisableConsoleColor;Summary' -if ("${env:CI}${env:APPVEYOR}${env:TEAMCITY_VERSION}${env:TRAVIS}" -eq "") -{ - # Not on any of the CI machines. Fine to use colors. - $preflightClpOption='' - $msbuildClpOption='/clp:Summary' -} $msBuildArguments = @" /nologo @@ -118,7 +110,7 @@ $msBuildArguments = @" /p:RepositoryRoot="$repoFolder/" /fl /flp:LogFile="$msbuildLogFilePath";Verbosity=detailed;Encoding=UTF-8 -$msbuildClpOption +/clp:Summary "$makeFileProj" "@ @@ -131,5 +123,5 @@ if (!(Test-Path $msbuildArtifactsDir)) $msBuildArguments | Out-File -Encoding ASCII -FilePath $msBuildResponseFile -exec dotnet msbuild /nologo $preflightClpOption /t:Restore /p:PreflightRestore=true "$makeFileProj" -exec dotnet msbuild `@"$msBuildResponseFile" +__exec dotnet restore /p:PreflightRestore=true "$makeFileProj" +__exec dotnet msbuild `@"$msBuildResponseFile" diff --git a/build/KoreBuild.sh b/build/KoreBuild.sh index f651ba1..ed25c89 100755 --- a/build/KoreBuild.sh +++ b/build/KoreBuild.sh @@ -16,14 +16,7 @@ __exec() { local cmdname=$(basename $cmd) echo -e "${CYAN}> $cmdname $@${RESET}" - - if [ -z "${TRAVIS}" ]; then - $cmd "$@" - else - # Work around https://github.com/Microsoft/msbuild/issues/1792 - $cmd "$@" | tee /dev/null - fi - + $cmd "$@" local exitCode=$? if [ $exitCode -ne 0 ]; then echo -e "${RED}'$cmdname $@' failed with exit code $exitCode${RESET}" 1>&2 @@ -141,7 +134,6 @@ export ReferenceAssemblyRoot=$NUGET_PACKAGES/netframeworkreferenceassemblies/$ne makeFileProj="$scriptRoot/KoreBuild.proj" msbuildArtifactsDir="$repoFolder/artifacts/msbuild" -msbuildPreflightResponseFile="$msbuildArtifactsDir/msbuild.preflight.rsp" msbuildResponseFile="$msbuildArtifactsDir/msbuild.rsp" msbuildLogFile="$msbuildArtifactsDir/msbuild.log" @@ -149,35 +141,16 @@ if [ ! -f $msbuildArtifactsDir ]; then mkdir -p $msbuildArtifactsDir fi -preflightClpOption='/clp:DisableConsoleColor' -msbuildClpOption='/clp:DisableConsoleColor;Summary' -if [ -z "${CI}${APPVEYOR}${TEAMCITY_VERSION}${TRAVIS}" ]; then - # Not on any of the CI machines. Fine to use colors. - preflightClpOption='' - msbuildClpOption='/clp:Summary' -fi - -cat > $msbuildPreflightResponseFile < $msbuildResponseFile <> $msbuildResponseFile +__exec dotnet restore /p:PreflightRestore=true /p:NetFxVersion=$netfxversion "$makeFileProj" __exec dotnet msbuild @"$msbuildResponseFile"