build\build.ps1: Added property for buildCounter to be passed into the script from TeamCity explicitly
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/5be649a2 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/5be649a2 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/5be649a2 Branch: refs/heads/api-work Commit: 5be649a2d45c05725291f82bb94ae0a1c83b8c47 Parents: 6cd681d Author: Shad Storhaug <[email protected]> Authored: Thu Apr 20 02:11:52 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Thu Apr 20 02:17:38 2017 +0700 ---------------------------------------------------------------------- build/build.ps1 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5be649a2/build/build.ps1 ---------------------------------------------------------------------- diff --git a/build/build.ps1 b/build/build.ps1 index 70e09c0..71ea307 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -6,6 +6,7 @@ [string]$nuget_package_directory = "$release_directory\NuGetPackages" [string]$test_results_directory = "$release_directory\TestResults" + [string]$buildCounter = "" [string]$packageVersion = "0.0.0" [string]$version = "0.0.0" [string]$configuration = "Release" @@ -38,7 +39,7 @@ task Init -description "This task makes sure the build environment is correctly } #If $packageVersion is not passed in, get it from Version.proj - if ([string]::IsNullOrEmpty($packageVersion) -or $packageVersion -eq "0.0.0") { + if ([string]::IsNullOrEmpty($packageVersion) -or $packageVersion -eq "0.0.0" -or ![string]::IsNullOrWhiteSpace($env:BuildCounter)) { #Get the version info $versionFile = "$base_directory\Version.proj" $xml = [xml](Get-Content $versionFile) @@ -47,14 +48,12 @@ task Init -description "This task makes sure the build environment is correctly $versionSuffix = $xml.Project.PropertyGroup.VersionSuffix Write-Host "VersionPrefix: $versionPrefix" -ForegroundColor Yellow Write-Host "VersionSuffix: $versionSuffix" -ForegroundColor Yellow - - #build counter from TeamCity - $buildCounter = "$env:build_counter" - Write-Host "TeamCity buildCounter : $buildCounter" + if ([string]::IsNullOrEmpty($buildCounter)) { - #attempt to get MyGet build counter + #attempt to get MyGet (or TeamCity) build counter environment variable $buildCounter = "$env:BuildCounter" } + Write-Host "buildCounter: $buildCounter" if ([string]::IsNullOrWhiteSpace($versionSuffix)) {
