2015-12-28 19:47:21 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
#
|
|
|
|
|
|
|
|
param(
|
|
|
|
[string]$Configuration="Debug",
|
2016-01-05 07:50:28 +00:00
|
|
|
[switch]$Offline,
|
2016-01-08 18:45:20 +00:00
|
|
|
[switch]$NoPackage)
|
2015-12-28 19:47:21 +00:00
|
|
|
|
|
|
|
$ErrorActionPreference="Stop"
|
|
|
|
|
|
|
|
. "$PSScriptRoot\..\common\_common.ps1"
|
|
|
|
|
2016-01-07 01:27:44 +00:00
|
|
|
. "$RepoRoot\scripts\build\generate-version.ps1"
|
2015-12-28 19:47:21 +00:00
|
|
|
|
2016-01-13 00:36:31 +00:00
|
|
|
if ($env:CI_BUILD -eq "1") {
|
|
|
|
$env:NUGET_PACKAGES = (Join-Path $RepoRoot "artifacts\home\.nuget\packages")
|
|
|
|
} else {
|
|
|
|
$env:NUGET_PACKAGES = (Join-Path $env:USERPROFILE ".nuget\packages")
|
|
|
|
}
|
|
|
|
|
|
|
|
$env:DOTNET_PACKAGES = $env:NUGET_PACKAGES
|
|
|
|
$env:DNX_PACKAGES = $env:NUGET_PACKAGES
|
|
|
|
if(!(Test-Path $env:NUGET_PACKAGES)) {
|
|
|
|
mkdir $env:NUGET_PACKAGES | Out-Null
|
|
|
|
}
|
|
|
|
|
2016-01-12 23:27:02 +00:00
|
|
|
header "Building dotnet tools version $($env:DOTNET_CLI_VERSION) - $Configuration"
|
2015-12-28 19:47:21 +00:00
|
|
|
header "Checking Pre-Reqs"
|
|
|
|
|
|
|
|
_ "$RepoRoot\scripts\test\check-prereqs.ps1"
|
|
|
|
|
|
|
|
header "Restoring Tools and Packages"
|
|
|
|
|
|
|
|
if ($Offline){
|
|
|
|
info "Skipping Tools and Packages dowlnoad: Offline build"
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
_ "$RepoRoot\scripts\obtain\install-tools.ps1"
|
2016-01-05 07:50:28 +00:00
|
|
|
|
2016-01-23 17:53:51 +00:00
|
|
|
_ "$RepoRoot\scripts\build\restore-packages.ps1"
|
2015-12-28 19:47:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
header "Compiling"
|
|
|
|
_ "$RepoRoot\scripts\compile\compile.ps1" @("$Configuration")
|
|
|
|
|
2016-01-06 10:27:16 +00:00
|
|
|
header "Setting Stage2 as PATH and DOTNET_TOOLS"
|
|
|
|
setPathAndHome "$Stage2Dir"
|
2015-12-19 00:39:43 +00:00
|
|
|
|
2015-12-28 19:47:21 +00:00
|
|
|
header "Running Tests"
|
|
|
|
_ "$RepoRoot\scripts\test\runtests.ps1"
|
|
|
|
|
|
|
|
header "Validating Dependencies"
|
|
|
|
_ "$RepoRoot\scripts\test\validate-dependencies.ps1"
|
|
|
|
|
2016-01-08 18:45:20 +00:00
|
|
|
if ($NoPackage){
|
|
|
|
info "Skipping Packaging"
|
2016-01-12 18:37:12 +00:00
|
|
|
exit 0
|
2016-01-08 18:45:20 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
_ "$RepoRoot\scripts\package\package.ps1"
|
|
|
|
}
|