Skip to content

Commit

Permalink
Fixing build script (#1409) (#1414)
Browse files Browse the repository at this point in the history
* Build scripts to depend on the targets file for version.
  • Loading branch information
singhsarab authored and smadala committed Feb 5, 2018
1 parent db84dc2 commit 2aea5af
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ $env:TP_OUT_DIR = Join-Path $env:TP_ROOT_DIR "artifacts"
$env:TP_PACKAGE_PROJ_DIR = Join-Path $env:TP_ROOT_DIR "src\package"

# Set Version from scripts/build/TestPlatform.Settings.targets
if([string]::IsNullOrWhiteSpace($Version))
{
$Version = ([xml](Get-Content $env:TP_ROOT_DIR\scripts\build\TestPlatform.Settings.targets)).Project.PropertyGroup.TPVersionPrefix
$Version = ($Version).Trim()
}

#
# Dotnet configuration
Expand Down
19 changes: 14 additions & 5 deletions scripts/vsts-prebuild.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Sets variables which are used across the build tasks.

$buildPrefix = $args[0]
if ($args[2].ToLower() -eq "false") {
$buildSuffix = $args[1]
$buildSuffix = $args[0]
$IsRtmBuild = $args[1]

$TP_ROOT_DIR = (Get-Item (Split-Path $MyInvocation.MyCommand.Path)).Parent.FullName

# Set Version from scripts/build/TestPlatform.Settings.targets
$TpVersion = [string](([xml](Get-Content $TP_ROOT_DIR\scripts\build\TestPlatform.Settings.targets)).Project.PropertyGroup.TPVersionPrefix)
$buildPrefix = $TpVersion.Trim()

if ($IsRtmBuild.ToLower() -eq "false")
{
$packageVersion = $buildPrefix+"-"+$buildSuffix
} else {
}
else
{
$packageVersion = $buildPrefix
$buildSuffix = [string]::Empty
}
Expand All @@ -16,6 +26,5 @@ Write-Host "##vso[task.setvariable variable=PackageVersion;]$packageVersion"
# Set Newtonsoft.Json version to consume in CI build "Package: TestPlatform SDK" task.
# "Nuget.exe pack" required JsonNetVersion property for creating nuget package.

$TP_ROOT_DIR = (Get-Item (Split-Path $MyInvocation.MyCommand.Path)).Parent.FullName
$JsonNetVersion = ([xml](Get-Content $TP_ROOT_DIR\scripts\build\TestPlatform.Dependencies.props)).Project.PropertyGroup.JsonNetVersion
Write-Host "##vso[task.setvariable variable=JsonNetVersion;]$JsonNetVersion"

0 comments on commit 2aea5af

Please sign in to comment.