dotnet-installer/scripts/build.ps1
Sridhar Periyasamy 6a0a982f2f Change the build number to 'major.minor.build.revision'.
This is required for the Windows MSI ProductVersion to support major/minor
upgrades.

https://msdn.microsoft.com/en-us/library/aa370859(v=vs.85).aspx
2015-11-17 20:25:08 -08:00

41 lines
1.4 KiB
PowerShell

#
# 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")
. "$PSScriptRoot\_common.ps1"
$ErrorActionPreference="Stop"
# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot
$env:DOTNET_INSTALL_DIR="$PSScriptRoot\.dotnet_stage0\win7-x64"
if (!(Test-Path $env:DOTNET_INSTALL_DIR))
{
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
}
$env:PATH = "$env:DOTNET_INSTALL_DIR\cli\bin;$env:PATH"
if (!$env:DOTNET_BUILD_VERSION) {
# Get the timestamp of the most recent commit
$timestamp = git log -1 --format=%ct
$commitTime = [timespan]::FromSeconds($timestamp)
$majorVersion = 1
$minorVersion = 0
$buildnumber = $commitTime.Days
$revnumber = $commitTime.TotalSeconds
$env:DOTNET_BUILD_VERSION = "$majorVersion.$minorVersion.$buildnumber.$revnumber"
}
Write-Host -ForegroundColor Green "*** Building dotnet tools version $($env:DOTNET_BUILD_VERSION) - $Configuration ***"
& "$PSScriptRoot\compile.ps1" -Configuration:$Configuration
Write-Host -ForegroundColor Green "*** Packaging dotnet ***"
& "$PSScriptRoot\package\package.ps1"
Write-Host -ForegroundColor Green "*** Generating dotnet MSI ***"
& "$RepoRoot\packaging\windows\generatemsi.ps1" $Stage2Dir