This commit is contained in:
Nate McMaster 2017-05-02 16:52:07 -07:00
Родитель 94d1e39c2b
Коммит 6eb29362f1
2 изменённых файлов: 7 добавлений и 42 удалений

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

@ -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"

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

@ -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 <<ENDMSBUILDPREFLIGHT
/nologo
/p:NetFxVersion=$netfxversion
/p:PreflightRestore=true
/p:RepositoryRoot="$repoFolder/"
/t:Restore
$preflightClpOption
"$makeFileProj"
ENDMSBUILDPREFLIGHT
__exec dotnet msbuild @"$msbuildPreflightResponseFile"
cat > $msbuildResponseFile <<ENDMSBUILDARGS
/nologo
/m
/p:RepositoryRoot="$repoFolder/"
/fl
/flp:LogFile="$msbuildLogFile";Verbosity=detailed;Encoding=UTF-8
$msbuildClpOption
/clp:Summary
"$makeFileProj"
ENDMSBUILDARGS
echo -e "$msbuild_args" >> $msbuildResponseFile
__exec dotnet restore /p:PreflightRestore=true /p:NetFxVersion=$netfxversion "$makeFileProj"
__exec dotnet msbuild @"$msbuildResponseFile"