runbuild.ps1: Added function to update Constants.cs file with the same version that is used as AssemblyInformationalVersion so it doesn't need to be read at runtime.
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/bb1720c1 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/bb1720c1 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/bb1720c1 Branch: refs/heads/api-work Commit: bb1720c16f7e335a7cdb21bf73c689d7bd13beea Parents: 2dd2fa4 Author: Shad Storhaug <[email protected]> Authored: Wed Apr 12 00:19:39 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Wed Apr 12 00:44:16 2017 +0700 ---------------------------------------------------------------------- runbuild.ps1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/bb1720c1/runbuild.ps1 ---------------------------------------------------------------------- diff --git a/runbuild.ps1 b/runbuild.ps1 index bb8a5e3..7e556c0 100644 --- a/runbuild.ps1 +++ b/runbuild.ps1 @@ -187,6 +187,13 @@ function Restore-Assembly-Info() { } } +function Update-Constants-Version([string]$version) { + $constantsFile = "$root\src\Lucene.Net\Util\Constants.cs" + (Get-Content $constantsFile) | % { + $_-replace "(?<=LUCENE_VERSION\s*?=\s*?"")([^""]*)", $version + } | Set-Content $constantsFile -Force +} + if (Test-Path $ReleaseDirectory) { Write-Host "Removing old build assets..." @@ -206,7 +213,9 @@ function Compile-Projects($projects) { -version $Version ` -packageVersion $PackageVersion ` -file $AssemblyInfoFile - + + Update-Constants-Version $PackageVersion + foreach ($project in $projects) { pushd $project.DirectoryName
