Skip to content
Permalink
Browse files

Version appxmanifests

  • Loading branch information...
onovotny committed Jun 5, 2019
1 parent a9c4ba9 commit 77ccbd07cbfdebc494d4ae635e75ea3dbdb9b032
@@ -73,6 +73,12 @@ $templateFiles = (
@{Input="ILSpy/Properties/app.config.template"; Output = "ILSpy/app.config"},
@{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"}
);

$appxmanifestFiles = (
@{Input="ILSpy.Package/Package.appxmanifest"; Output="ILSpy.Package/Package.appxmanifest"},
@{Input="ILSpy.Package/Package-CI.appxmanifest"; Output="ILSpy.Package/Package-CI.appxmanifest"}
);

[string]$mutexId = "ILSpyUpdateAssemblyInfo" + (Get-Location).ToString().GetHashCode();
Write-Host $mutexId;
[bool]$createdNew = $false;
@@ -144,6 +150,32 @@ try {
$out | Out-File -Encoding utf8 $file.Output;
}
}

# Only update these on the Build Agent when ReleaseChannel is set
if($Env:ReleaseChannel -ne '' -and $Env:ReleaseChannel -ne $null) {
foreach ($file in $appxmanifestFiles) {
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;

$out = $in.Replace('$INSERTVERSION$', $fullVersionNumber);
$out = $out.Replace('$INSERTMAJORVERSION$', $major);
$out = $out.Replace('$INSERTMINORVERSION$', $minor);
$out = $out.Replace('$INSERTREVISION$', $revision);
$out = $out.Replace('$INSERTCOMMITHASH$', $gitCommitHash);
$out = $out.Replace('$INSERTSHORTCOMMITHASH$', $gitCommitHash.Substring(0, 8));
$out = $out.Replace('$INSERTDATE$', [System.DateTime]::Now.ToString("MM/dd/yyyy"));
$out = $out.Replace('$INSERTYEAR$', [System.DateTime]::Now.Year.ToString());
$out = $out.Replace('$INSERTBRANCHNAME$', $branchName);
$out = $out.Replace('$INSERTBRANCHPOSTFIX$', $postfixBranchName);
$out = $out.Replace('$INSERTVERSIONNAME$', $versionName);
$out = $out.Replace('$INSERTVERSIONNAMEPOSTFIX$', $postfixVersionName);
$out = $out.Replace('$INSERTBUILDCONFIG$', $buildConfig);

if (((Get-Content $file.Input) -Join [System.Environment]::NewLine) -ne $out) {
$out | Out-File -Encoding utf8 $file.Output;
}
}
}

} finally {
$mutex.ReleaseMutex();
$mutex.Close();
@@ -11,7 +11,7 @@
<Identity
Name="ICSharpCode.ILSpy.CI"
Publisher="CN=ICSharpCode"
Version="1.0.0.0" />
Version="$INSERTMAJORVERSION$.$INSERTMINORVERSION$.$INSERTREVISION$.0" />

<Properties>
<DisplayName>ILSpy (CI)</DisplayName>
@@ -11,7 +11,7 @@
<Identity
Name="ICSharpCode.ILSpy"
Publisher="CN=ICSharpCode"
Version="1.0.0.0" />
Version="$INSERTMAJORVERSION$.$INSERTMINORVERSION$.$INSERTREVISION$.0" />

<Properties>
<DisplayName>ILSpy</DisplayName>
@@ -38,6 +38,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{58AA7BDB-174C-4566-BD8A-EC461F1D6848}"
ProjectSection(SolutionItems) = preProject
azure-pipelines.yml = azure-pipelines.yml
BuildTools\update-assemblyinfo.ps1 = BuildTools\update-assemblyinfo.ps1
EndProjectSection
EndProject
Global

0 comments on commit 77ccbd0

Please sign in to comment.
You can’t perform that action at this time.