Make binary logging conditional

Set $env:KOREBUILD_ENABLE_BINARY_LOG=1 to enable logging
This commit is contained in:
Smit Patel 2017-06-07 16:05:25 -07:00
Родитель e838bdae3f
Коммит 44eeecae85
2 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -119,15 +119,22 @@ if (!($env:Path.Split(';') -icontains $dotnetLocalInstallFolder))
$makeFileProj = "$PSScriptRoot/KoreBuild.proj"
$msbuildArtifactsDir = "$repoFolder/artifacts/msbuild"
$msbuildLogFilePath = "$msbuildArtifactsDir/msbuild.binlog"
$msBuildResponseFile = "$msbuildArtifactsDir/msbuild.rsp"
$msBuildLogArgument = ""
if ($env:KOREBUILD_ENABLE_BINARY_LOG -eq "1")
{
Write-Host "Enabling binary logging because KOREBUILD_ENABLE_BINARY_LOG = 1"
$msbuildLogFilePath = "$msbuildArtifactsDir/msbuild.binlog"
$msBuildLogArgument = "/bl:$msbuildLogFilePath"
}
$msBuildArguments = @"
/nologo
/m
/p:RepositoryRoot="$repoFolder/"
/bl:"$msbuildLogFilePath"
"$msBuildLogArgument"
/clp:Summary
"$makeFileProj"
"@

Просмотреть файл

@ -152,7 +152,13 @@ export ReferenceAssemblyRoot=$NUGET_PACKAGES/netframeworkreferenceassemblies/$ne
makeFileProj="$scriptRoot/KoreBuild.proj"
msbuildArtifactsDir="$repoFolder/artifacts/msbuild"
msbuildResponseFile="$msbuildArtifactsDir/msbuild.rsp"
msbuildLogFile="$msbuildArtifactsDir/msbuild.binlog"
msBuildLogArgument=""
if [ ! -z "$KOREBUILD_ENABLE_BINARY_LOG" ]; then
echo "Enabling binary logging because KOREBUILD_ENABLE_BINARY_LOG is set"
msBuildLogFile="$msbuildArtifactsDir/msbuild.binlog"
msBuildLogArgument="/bl:$msBuildLogFile"
fi
if [ ! -f $msbuildArtifactsDir ]; then
mkdir -p $msbuildArtifactsDir
@ -162,7 +168,7 @@ cat > $msbuildResponseFile <<ENDMSBUILDARGS
/nologo
/m
/p:RepositoryRoot="$repoFolder/"
/bl:"$msbuildLogFile"
"$msBuildLogArgument"
/clp:Summary
"$makeFileProj"
ENDMSBUILDARGS