Fix update-dependencies.ps1 and build scripts to no longer use restore --infer-runtimes.

Also, update-dependencies.ps1 doesn't use $PSScriptRoot everywhere.  Instead use $RepoRoot.
This commit is contained in:
Eric Erhardt 2016-05-25 22:04:26 -05:00
parent ee7372c2a1
commit a7fccf8508
5 changed files with 26 additions and 20 deletions

View file

@ -15,7 +15,7 @@
"System.Reflection.TypeExtensions": "4.1.0-rc3-24123-01"
},
"frameworks": {
"netstandard1.6": {
"netstandard1.5": {
"imports": "dnxcore50"
}
}

View file

@ -68,7 +68,7 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
# Restore the build scripts
Write-Host "Restoring Build Script projects..."
pushd "$PSScriptRoot\.."
dotnet restore --infer-runtimes
dotnet restore
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
popd

View file

@ -102,7 +102,7 @@ fi
echo "Restoring Build Script projects..."
(
cd "$DIR/.."
dotnet restore --infer-runtimes
dotnet restore
)
# Build the builder

View file

@ -24,5 +24,15 @@
"portable-net45+win"
]
}
},
"runtimes": {
"win7-x64": { },
"win7-x86": { },
"osx.10.10-x64": { },
"osx.10.11-x64": { },
"ubuntu.14.04-x64": { },
"centos.7-x64": { },
"rhel.7.2-x64": { },
"debian.8-x64": { }
}
}

View file

@ -17,41 +17,37 @@ if($Help)
exit 0
}
$RepoRoot = "$PSScriptRoot\..\.."
$AppPath = "$PSScriptRoot"
# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot
if (!$env:DOTNET_INSTALL_DIR)
{
$env:DOTNET_INSTALL_DIR="$PSScriptRoot\..\.dotnet_stage0\Windows\$Architecture"
$env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\Windows\$Architecture"
}
# Install a stage 0
Write-Host "Installing .NET Core CLI Stage 0"
& "$PSScriptRoot\obtain\dotnet-install.ps1" -Architecture x64
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Architecture x64
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
# Put the stage0 on the path
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
$appPath = "$PSScriptRoot\update-dependencies"
# Restore the build_projects
Write-Host "Restoring Microsoft.DotNet.Cli.Build.Framework..."
pushd $PSScriptRoot\..\build_projects\Microsoft.DotNet.Cli.Build.Framework
dotnet restore --infer-runtimes
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
popd
# Restore update-dependencies
pushd $appPath
dotnet restore --infer-runtimes
Write-Host "Restoring Build projects..."
pushd "$RepoRoot\build_projects"
dotnet restore
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
popd
# Publish the app
Write-Host "Compiling App $appPath..."
dotnet publish "$appPath" -o "$appPath\bin" --framework netcoreapp1.0
Write-Host "Compiling App..."
dotnet publish "$AppPath" -o "$AppPath\bin" --framework netcoreapp1.0
if($LASTEXITCODE -ne 0) { throw "Failed to compile build scripts" }
# Run the app
Write-Host "Invoking App $appPath..."
Write-Host "Invoking App $AppPath..."
Write-Host " Configuration: $env:CONFIGURATION"
& "$appPath\bin\update-dependencies.exe" @Targets
& "$AppPath\bin\update-dependencies.exe" @Targets
if($LASTEXITCODE -ne 0) { throw "Build failed" }