Merge pull request #389 from lukeIam/versionInjection

Changed version injection
This commit is contained in:
Florian Küpper authored and GitHub committed 2018-05-05 12:24:28 +02:00
commit 5e134049f7
4 files changed
+19 -35

No files matched your search

+4 -5
View File
@@ -1,8 +1,7 @@
#!/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 -e 's/var matchingServerVersion = "";/var matchingServerVersion = "'$(git describe --long)'";/' $PROJECT/../Output/Website/js/main.js
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
+4 -3
View File
@@ -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
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
+6 -13
View File
@@ -3,21 +3,14 @@ param(
[String]$ProjectDir
)
if($Env:GIT_VERSION_TAG)
if($Env:VOCALUXE_SKIP_POSTBUILD)
{
$version = $Env:GIT_VERSION_TAG;
Write-Host "Skipping post build script (as requested)"
exit
}
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'} `
| 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"
+5 -14
View File
@@ -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")]