From 3ac9217759db6fcf3503541a6d86ec72ca2bf64b Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Mon, 30 Apr 2018 16:23:08 +0200 Subject: [PATCH 1/2] Remove not longer needed code from the post build scripts --- .build/linuxPostBuildEvent.sh | 3 +-- .build/winPostBuild.ps1 | 13 ------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.build/linuxPostBuildEvent.sh b/.build/linuxPostBuildEvent.sh index fe52ac53..2fef7c1b 100644 --- a/.build/linuxPostBuildEvent.sh +++ b/.build/linuxPostBuildEvent.sh @@ -4,5 +4,4 @@ cd $PROJECT sed -i -r -e 's/AssemblyInformationalVersion\(".*?"\)/AssemblyInformationalVersion("GITVERSION")/' $PROJECT/Properties/AssemblyInfo.cs sed -i -r -e 's/AssemblyVersion\(".*?"\)/AssemblyVersion("SHORTVERSION")/' $PROJECT/Properties/AssemblyInfo.cs sed -i -r -e 's/AssemblyFileVersion\(".*?"\)/AssemblyFileVersion("SHORTVERSION")/' $PROJECT/Properties/AssemblyInfo.cs -sed -i -r -e 's/AssemblyTitle\(".*?"\)/AssemblyTitle("FULLVERSION")/' $PROJECT/Properties/AssemblyInfo.cs -sed -i -e 's/var matchingServerVersion = "";/var matchingServerVersion = "'$(git describe --long)'";/' $PROJECT/../Output/Website/js/main.js +sed -i -r -e 's/AssemblyTitle\(".*?"\)/AssemblyTitle("FULLVERSION")/' $PROJECT/Properties/AssemblyInfo.cs \ No newline at end of file diff --git a/.build/winPostBuild.ps1 b/.build/winPostBuild.ps1 index 416353fc..6b5150b3 100644 --- a/.build/winPostBuild.ps1 +++ b/.build/winPostBuild.ps1 @@ -3,19 +3,6 @@ param( [String]$ProjectDir ) -if($Env:GIT_VERSION_TAG) -{ - $version = $Env:GIT_VERSION_TAG; -} -else -{ - $version = git describe --long; -} - -(Get-Content -Encoding UTF8 "$($ProjectDir)..\Output\Website\js\main.js") ` - | Foreach-Object {$_ -replace '(?<=var *matchingServerVersion * = *\")\w*(?=\" *;)', "$version"} ` - | Set-Content -Encoding UTF8 "$($ProjectDir)..\Output\Website\js\main.js" - (Get-Content -Encoding UTF8 "$($ProjectDir)Properties\AssemblyInfo.cs") ` | Foreach-Object {$_ -replace '(?<=AssemblyInformationalVersion\(\").*(?=\")', 'GITVERSION'} ` | Foreach-Object {$_ -replace '(?<=(AssemblyVersion|AssemblyFileVersion)\(\").*(?=\")', 'SHORTVERSION'} ` From 77fa981751ad1b502f58a7a221ce99a7cea37107 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Mon, 30 Apr 2018 16:30:41 +0200 Subject: [PATCH 2/2] Allow to skip the post build script --- .build/winPostBuild.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.build/winPostBuild.ps1 b/.build/winPostBuild.ps1 index 6b5150b3..e016ce0c 100644 --- a/.build/winPostBuild.ps1 +++ b/.build/winPostBuild.ps1 @@ -3,6 +3,12 @@ param( [String]$ProjectDir ) +if($Env:VOCALUXE_SKIP_POSTBUILD) +{ + Write-Host "Skipping post build script (as requested)" + exit +} + (Get-Content -Encoding UTF8 "$($ProjectDir)Properties\AssemblyInfo.cs") ` | Foreach-Object {$_ -replace '(?<=AssemblyInformationalVersion\(\").*(?=\")', 'GITVERSION'} ` | Foreach-Object {$_ -replace '(?<=(AssemblyVersion|AssemblyFileVersion)\(\").*(?=\")', 'SHORTVERSION'} `