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/4] 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/4] 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'} ` From 1a1d1fd6edd98cf0afc3a0cafab946bb4d343b2c Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 4 May 2018 14:22:54 +0200 Subject: [PATCH 3/4] Replace old version dummy entries with such that fulfill the constraints (they will still be overwritten in the pre-build event) + change the build scripts not not longer depend on the dummy strings --- .build/linuxPostBuildEvent.sh | 8 ++++---- .build/linuxPreBuildEvent.sh | 7 ++++--- .build/winPostBuild.ps1 | 6 +++--- Vocaluxe/Properties/AssemblyInfo.cs | 19 +++++-------------- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/.build/linuxPostBuildEvent.sh b/.build/linuxPostBuildEvent.sh index fe52ac53..d32d60a1 100644 --- a/.build/linuxPostBuildEvent.sh +++ b/.build/linuxPostBuildEvent.sh @@ -1,8 +1,8 @@ #!/bin/sh PROJECT=$1 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 -r -e 's/AssemblyInformationalVersion\(".*?"\)/AssemblyInformationalVersion("0.0.0-na-notversioned")/' $PROJECT/Properties/AssemblyInfo.cs +sed -i -r -e 's/AssemblyVersion\(".*?"\)/AssemblyVersion("0.0.0")/' $PROJECT/Properties/AssemblyInfo.cs +sed -i -r -e 's/AssemblyFileVersion\(".*?"\)/AssemblyFileVersion("0.0.0")/' $PROJECT/Properties/AssemblyInfo.cs +sed -i -r -e 's/AssemblyTitle\(".*?"\)/AssemblyTitle("Vocaluxe '"'"'Not Versioned'"'"' 0.0.0 (NA) (0.0.0-na-notversioned)")/' $PROJECT/Properties/AssemblyInfo.cs sed -i -e 's/var matchingServerVersion = "";/var matchingServerVersion = "'$(git describe --long)'";/' $PROJECT/../Output/Website/js/main.js diff --git a/.build/linuxPreBuildEvent.sh b/.build/linuxPreBuildEvent.sh index 329c0678..c62c148a 100644 --- a/.build/linuxPreBuildEvent.sh +++ b/.build/linuxPreBuildEvent.sh @@ -24,6 +24,7 @@ esac versionName=$(grep -oP "\"${shortVersionClean%.*}.\" *: *\"\K([^\"]+)(?=\")" ../.build/versionNames.json) fullVersionName="Vocaluxe $([ "$versionName" == "" ] && echo "" || echo "'$versionName' ")$shortVersion ($arch) $([ "$releaseType" == "Release" ] && echo "" || echo "$releaseType ")($version)" -sed -i -e s/GITVERSION/$(git describe --long)/ $PROJECT/Properties/AssemblyInfo.cs -sed -i -e s/SHORTVERSION/"$shortVersionClean"/ $PROJECT/Properties/AssemblyInfo.cs -sed -i -e s/FULLVERSION/"$fullVersionName"/ $PROJECT/Properties/AssemblyInfo.cs \ No newline at end of file +sed -i -r -e "s/AssemblyInformationalVersion\(\".*?\"\)/AssemblyInformationalVersion(\"$(git describe --long)\")/" $PROJECT/Properties/AssemblyInfo.cs +sed -i -r -e "s/AssemblyVersion\(\".*?\"\)/AssemblyVersion(\"$shortVersionClean\")/" $PROJECT/Properties/AssemblyInfo.cs +sed -i -r -e "s/AssemblyFileVersion\(\".*?\"\)/AssemblyFileVersion(\"$shortVersionClean\")/" $PROJECT/Properties/AssemblyInfo.cs +sed -i -r -e "s/AssemblyTitle\(\".*?\"\)/AssemblyTitle(\"$fullVersionName\")/" $PROJECT/Properties/AssemblyInfo.cs \ No newline at end of file diff --git a/.build/winPostBuild.ps1 b/.build/winPostBuild.ps1 index 416353fc..301be8aa 100644 --- a/.build/winPostBuild.ps1 +++ b/.build/winPostBuild.ps1 @@ -17,7 +17,7 @@ else | 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'} ` - | Foreach-Object {$_ -replace '(?<=AssemblyTitle\(\").*(?=\")', 'FULLVERSION'} ` + | Foreach-Object {$_ -replace '(?<=AssemblyInformationalVersion\(\").*(?=\")', '0.0.0-na-notversioned'} ` + | Foreach-Object {$_ -replace '(?<=(AssemblyVersion|AssemblyFileVersion)\(\").*(?=\")', '0.0.0'} ` + | Foreach-Object {$_ -replace '(?<=AssemblyTitle\(\").*(?=\")', 'Vocaluxe `'Not Versioned`' 0.0.0 (NA) (0.0.0-na-notversioned)'} ` | Set-Content -Encoding UTF8 "$($ProjectDir)Properties\AssemblyInfo.cs" \ No newline at end of file diff --git a/Vocaluxe/Properties/AssemblyInfo.cs b/Vocaluxe/Properties/AssemblyInfo.cs index cc74c35a..d8747960 100644 --- a/Vocaluxe/Properties/AssemblyInfo.cs +++ b/Vocaluxe/Properties/AssemblyInfo.cs @@ -23,7 +23,7 @@ using System.Runtime.InteropServices; // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("FULLVERSION")] +[assembly: AssemblyTitle("Vocaluxe 'Not Versioned' 0.0.0 (NA) (0.0.0-na-notversioned)")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] @@ -32,6 +32,10 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] +[assembly: AssemblyVersion("0.0.0")] +[assembly: AssemblyFileVersion("0.0.0")] +[assembly: AssemblyInformationalVersion("0.0.0-na-notversioned")] + // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. @@ -42,18 +46,5 @@ using System.Runtime.InteropServices; [assembly: Guid("da631594-f891-4994-9869-c37e626e44f9")] -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// - -[assembly: AssemblyVersion("SHORTVERSION")] -[assembly: AssemblyFileVersion("SHORTVERSION")] -[assembly: AssemblyInformationalVersion("GITVERSION")] - - // Allow internal access from the Tests project [assembly:InternalsVisibleTo("Tests")] From 8e3b68b2b71e3f91ba1166f7314b0a75066c8650 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 4 May 2018 14:29:16 +0200 Subject: [PATCH 4/4] Fix wrong single quote escaping in winPostBuild.ps1 --- .build/winPostBuild.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/winPostBuild.ps1 b/.build/winPostBuild.ps1 index 2619b535..44f47c56 100644 --- a/.build/winPostBuild.ps1 +++ b/.build/winPostBuild.ps1 @@ -12,5 +12,5 @@ if($Env:VOCALUXE_SKIP_POSTBUILD) (Get-Content -Encoding UTF8 "$($ProjectDir)Properties\AssemblyInfo.cs") ` | Foreach-Object {$_ -replace '(?<=AssemblyInformationalVersion\(\").*(?=\")', '0.0.0-na-notversioned'} ` | Foreach-Object {$_ -replace '(?<=(AssemblyVersion|AssemblyFileVersion)\(\").*(?=\")', '0.0.0'} ` - | Foreach-Object {$_ -replace '(?<=AssemblyTitle\(\").*(?=\")', 'Vocaluxe `'Not Versioned`' 0.0.0 (NA) (0.0.0-na-notversioned)'} ` + | Foreach-Object {$_ -replace '(?<=AssemblyTitle\(\").*(?=\")', "Vocaluxe 'Not Versioned' 0.0.0 (NA) (0.0.0-na-notversioned)"} ` | Set-Content -Encoding UTF8 "$($ProjectDir)Properties\AssemblyInfo.cs" \ No newline at end of file