2015-11-16 19:21:57 +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.
|
|
|
|
#
|
|
|
|
|
2015-11-11 01:30:01 +00:00
|
|
|
param(
|
|
|
|
[string]$Configuration="Debug")
|
|
|
|
|
2015-11-17 08:39:46 +00:00
|
|
|
. "$PSScriptRoot\_common.ps1"
|
|
|
|
|
2015-11-11 01:30:01 +00:00
|
|
|
$ErrorActionPreference="Stop"
|
|
|
|
|
2015-11-16 21:49:29 +00:00
|
|
|
# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot
|
2015-11-17 23:15:28 +00:00
|
|
|
$env:DOTNET_INSTALL_DIR="$(Convert-Path "$PSScriptRoot\..")\.dotnet_stage0\win7-x64"
|
2015-11-16 21:49:29 +00:00
|
|
|
if (!(Test-Path $env:DOTNET_INSTALL_DIR))
|
|
|
|
{
|
|
|
|
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
|
|
|
|
}
|
|
|
|
$env:PATH = "$env:DOTNET_INSTALL_DIR\cli\bin;$env:PATH"
|
|
|
|
|
2015-11-11 01:30:01 +00:00
|
|
|
if (!$env:DOTNET_BUILD_VERSION) {
|
|
|
|
# Get the timestamp of the most recent commit
|
|
|
|
$timestamp = git log -1 --format=%ct
|
2015-11-18 04:25:08 +00:00
|
|
|
$commitTime = [timespan]::FromSeconds($timestamp)
|
2015-11-11 01:30:01 +00:00
|
|
|
|
2015-11-18 04:25:08 +00:00
|
|
|
$majorVersion = 1
|
|
|
|
$minorVersion = 0
|
|
|
|
$buildnumber = $commitTime.Days
|
|
|
|
$revnumber = $commitTime.TotalSeconds
|
2015-11-11 01:30:01 +00:00
|
|
|
|
2015-11-18 04:25:08 +00:00
|
|
|
$env:DOTNET_BUILD_VERSION = "$majorVersion.$minorVersion.$buildnumber.$revnumber"
|
2015-11-11 01:30:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Write-Host -ForegroundColor Green "*** Building dotnet tools version $($env:DOTNET_BUILD_VERSION) - $Configuration ***"
|
|
|
|
& "$PSScriptRoot\compile.ps1" -Configuration:$Configuration
|
2015-11-24 03:43:02 +00:00
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Building dotnet tools finished with errors."
|
|
|
|
Exit 1
|
|
|
|
}
|
2015-11-11 01:30:01 +00:00
|
|
|
|
|
|
|
Write-Host -ForegroundColor Green "*** Packaging dotnet ***"
|
|
|
|
& "$PSScriptRoot\package\package.ps1"
|
2015-11-24 03:43:02 +00:00
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Packaging dotnet finished with errors."
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
|
2015-11-17 08:39:46 +00:00
|
|
|
|
|
|
|
Write-Host -ForegroundColor Green "*** Generating dotnet MSI ***"
|
|
|
|
& "$RepoRoot\packaging\windows\generatemsi.ps1" $Stage2Dir
|
2015-11-24 03:43:02 +00:00
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Generating dotnet MSI finished with errors."
|
|
|
|
Exit 1
|
|
|
|
}
|