Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit c603aa9

Browse files
authored
Merge pull request #484 from github/fixes/Nerdbank.GitVersioning
Handle versioning using Nerdbank.GitVersioning
2 parents 78e35d1 + ad80455 commit c603aa9

File tree

17 files changed

+43
-155
lines changed

17 files changed

+43
-155
lines changed

Directory.Build.Props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
<Copyright>Copyright © GitHub, Inc. 2014-2018</Copyright>
66
<LangVersion>7.3</LangVersion>
77
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Nerdbank.GitVersioning">
10+
<Version>3.0.26</Version>
11+
<PrivateAssets>all</PrivateAssets>
12+
</PackageReference>
13+
</ItemGroup>
814
</Project>

GitHubVS.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Meta", "Meta", "{72036B62-2
1414
ProjectSection(SolutionItems) = preProject
1515
.editorconfig = .editorconfig
1616
README.md = README.md
17+
version.json = version.json
1718
EndProjectSection
1819
EndProject
1920
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub.UI", "src\GitHub.UI\GitHub.UI.csproj", "{346384DD-2445-4A28-AF22-B45F3957BD89}"

azure-pipelines.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,22 @@ jobs:
4040

4141
# Instead run nuget manually.
4242

43+
- task: DotNetCoreCLI@2
44+
inputs:
45+
command: custom
46+
custom: tool
47+
arguments: install --tool-path . nbgv
48+
displayName: Install NBGV tool
49+
50+
- script: nbgv cloud
51+
displayName: Set the cloud build number
52+
4353
- script: tools\nuget\nuget.exe restore $(githubvsSolution)
4454
displayName: NuGet restore $(githubvsSolution)
4555

4656
- script: tools\nuget\nuget.exe restore $(essentialsSolution)
4757
displayName: NuGet restore $(essentialsSolution)
4858

49-
# Ideally we'd run NerdBank.GitVersioning but that will come later. For now bump the
50-
# version with the azure BuildId
51-
- task: PowerShell@2
52-
displayName: Bump version
53-
inputs:
54-
targetType: filePath
55-
filePath: '$(Build.SourcesDirectory)\scripts\Bump-Version.ps1'
56-
arguments: -BumpBuild -BuildNumber:$(Build.BuildId)
57-
5859
- pwsh: mkdir $(ArtifactDirectory) -Force
5960
displayName: Create VSIX staging directory
6061

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace GitHub
2+
{
3+
public static class ExtensionInformation
4+
{
5+
// HACK: For some reason ThisAssembly.AssemblyFileVersion can't be referenced
6+
// directly from inside GitHub.VisualStudio.
7+
public const string Version = ThisAssembly.AssemblyFileVersion;
8+
}
9+
}

src/GitHub.VisualStudio.16/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="f4fbb70d-dee2-4dee-b322-bd74e3010e8f" Version="2.10.8.0" Language="en-US" Publisher="GitHub, Inc" />
4+
<Identity Id="f4fbb70d-dee2-4dee-b322-bd74e3010e8f" Version="|%CurrentProject%;GetBuildVersion|" Language="en-US" Publisher="GitHub, Inc" />
55
<DisplayName>GitHub Essentials</DisplayName>
66
<Description>Clone or checkout code from GitHub</Description>
77
<PackageId>GitHub.VisualStudio.16</PackageId>

src/GitHub.VisualStudio.Vsix/GitHub.VisualStudio.Vsix.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@
357357
<Import Project="packaging.targets" />
358358
<!-- For regenerating templates on build -->
359359
<Import Project="..\common\t4.targets" />
360-
<Import Project="versioning.targets" />
361360
<!--
362361
This is a workaround for allowing neutral CTO resource produced from *.vsct to go in the main assembly.
363362
We move the neutral *.cto file to be categorized as WithCulture=true,Culture=en to prevent the tools from falsely reporting:

src/GitHub.VisualStudio.Vsix/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="c3d3dc68-c977-411f-b3e8-03b0dccf7dfc" Version="2.10.8.0" Language="en-US" Publisher="GitHub, Inc" />
4+
<Identity Id="c3d3dc68-c977-411f-b3e8-03b0dccf7dfc" Version="|%CurrentProject%;GetBuildVersion|" Language="en-US" Publisher="GitHub, Inc" />
55
<DisplayName>GitHub Extension for Visual Studio</DisplayName>
66
<Description xml:space="preserve">A Visual Studio Extension that brings the GitHub Flow into Visual Studio.</Description>
77
<PackageId>GitHub.VisualStudio</PackageId>

src/GitHub.VisualStudio.Vsix/versioning.targets

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@
170170
<None Include="..\common\settings.json">
171171
<Link>Properties\settings.json</Link>
172172
</None>
173-
<None Include="..\..\build\version" />
174173
</ItemGroup>
175174
<ItemGroup>
176175
<VSCTCompile Include="GitHub.VisualStudio.vsct">
@@ -318,7 +317,6 @@
318317
<Import Project="packaging.targets" />
319318
<!-- For regenerating templates on build -->
320319
<Import Project="..\common\t4.targets" />
321-
<Import Project="versioning.targets" />
322320
<!--
323321
This is a workaround for allowing neutral CTO resource produced from *.vsct to go in the main assembly.
324322
We move the neutral *.cto file to be categorized as WithCulture=true,Culture=en to prevent the tools from falsely reporting:

src/GitHub.VisualStudio/GitHubPackage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
namespace GitHub.VisualStudio
3636
{
3737
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
38-
[InstalledProductRegistration("#110", "#112", AssemblyVersionInformation.Version)]
38+
[InstalledProductRegistration("#110", "#112", ExtensionInformation.Version)]
3939
[Guid(Guids.guidGitHubPkgString)]
4040
[ProvideMenuResource("Menus.ctmenu", 1)]
4141
[ProvideAutoLoad(Guids.GitContextPkgString, PackageAutoLoadFlags.BackgroundLoad)]

0 commit comments

Comments
 (0)