Browse Source

Version appxmanifests

pull/1522/head
Oren Novotny 6 years ago
parent
commit
77ccbd07cb
Failed to extract signature
  1. 32
      BuildTools/update-assemblyinfo.ps1
  2. 2
      ILSpy.Package/Package-CI.appxmanifest
  3. 2
      ILSpy.Package/Package.appxmanifest
  4. 1
      ILSpy.WithPackage.sln

32
BuildTools/update-assemblyinfo.ps1

@ -73,6 +73,12 @@ $templateFiles = ( @@ -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 { @@ -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();

2
ILSpy.Package/Package-CI.appxmanifest

@ -11,7 +11,7 @@ @@ -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>

2
ILSpy.Package/Package.appxmanifest

@ -11,7 +11,7 @@ @@ -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>

1
ILSpy.WithPackage.sln

@ -38,6 +38,7 @@ EndProject @@ -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

Loading…
Cancel
Save