- calculate full version tag in build script and set AssemblyTitle
- display AssemblyTitle in Vocaluxe gui - code names are stored in .build/versionNames.json - pre and post build scripts for windows (one place for all commands) - adjusted and moved the linux build scripts
This commit is contained in:
1 parent
0eb28b1bc9
commit
152be5d8ad
9 files changed
+112
-64
No files matched your search
@@ -0,0 +1,40 @@
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String]$ProjectDir,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String]$Arch
|
||||
)
|
||||
|
||||
if($Env:GIT_VERSION_TAG)
|
||||
{
|
||||
$version = $Env:GIT_VERSION_TAG;
|
||||
}
|
||||
else
|
||||
{
|
||||
$version = git describe --long;
|
||||
}
|
||||
|
||||
$shortVersion = $version.Split('-')[0];
|
||||
|
||||
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
|
||||
$versionName = (New-Object System.Web.Script.Serialization.JavaScriptSerializer).Deserialize((Get-Content "$($ProjectDir)..\.build\versionNames.json"), `
|
||||
[System.Collections.Hashtable])[([regex]"[0-9]+\.[0-9]+\.").Match($shortVersion).Value]
|
||||
|
||||
$releaseType = switch -wildcard ($shortVersion.Split('.')[2])
|
||||
{
|
||||
"alpha*" {"Alpha"}
|
||||
"beta*" {"Beta"}
|
||||
"rc*" {"RC"}
|
||||
default {"Release"}
|
||||
};
|
||||
|
||||
$fullVersionName = "Vocaluxe $(if($versionName) {"'"+$versionName+"' "} else {''})$shortVersion ($Arch) $(if($releaseType -ne "Release") {'$releaseType '} else {''})($version)"
|
||||
|
||||
(Get-Content -Encoding UTF8 "$($ProjectDir)Properties\AssemblyInfo.cs") `
|
||||
| Foreach-Object {$_ `
|
||||
-replace '(?<=AssemblyInformationalVersion\(").*(?=")', $version `
|
||||
-replace '(?<=(AssemblyVersion|AssemblyFileVersion)\(").*(?=")', `
|
||||
($version.Split('-')[0].replace('alpha','0').replace('beta','1').replace('rc','2') -replace "[a-zA-Z]+","")`
|
||||
-replace '(?<=AssemblyTitle\(").*(?=")', $fullVersionName `
|
||||
-replace '(?<=AssemblyCopyright\(".*)[0-9]+(?=")', (Get-Date).Year} `
|
||||
| Set-Content -Encoding UTF8 "$($ProjectDir)Properties\AssemblyInfo.cs"
|
||||
Reference in new issue
Block a user