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

Commit 9ec0cc3

Browse files
committed
Use alias classes instead of alias references
Conditionally define VSGitExt14, VSGitExt15 and VSGitExt16 to avoid having to use reference aliases.
1 parent 30fd494 commit 9ec0cc3

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

src/GitHub.TeamFoundation.14/Services/VSGitExt.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@
1515

1616
namespace GitHub.VisualStudio.Base
1717
{
18+
// This is a workaround to avoid using reference aliases, which don't currently work with <PackageReference>.
19+
#if TEAMEXPLORER14
20+
public class VSGitExt14 : VSGitExt
21+
{
22+
public VSGitExt14(IServiceProvider serviceProvider, IGitService gitService) : base(serviceProvider, gitService) { }
23+
}
24+
#elif TEAMEXPLORER15
25+
public class VSGitExt15 : VSGitExt
26+
{
27+
public VSGitExt15(IServiceProvider serviceProvider, IGitService gitService) : base(serviceProvider, gitService) { }
28+
}
29+
#elif TEAMEXPLORER16
30+
public class VSGitExt16 : VSGitExt
31+
{
32+
public VSGitExt16(IServiceProvider serviceProvider, IGitService gitService) : base(serviceProvider, gitService) { }
33+
}
34+
#endif
35+
1836
/// <summary>
1937
/// This service acts as an always available version of <see cref="IGitExt"/>.
2038
/// </summary>

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,22 +605,22 @@
605605
<Private>True</Private>
606606
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIX>
607607
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIXLocalOnly>
608-
<Aliases>TF14</Aliases>
608+
<Aliases>global</Aliases>
609609
</ProjectReference>
610610
<ProjectReference Include="..\GitHub.TeamFoundation.15\GitHub.TeamFoundation.15.csproj">
611611
<Project>{161dbf01-1dbf-4b00-8551-c5c00f26720e}</Project>
612612
<Name>GitHub.TeamFoundation.15</Name>
613613
<Private>True</Private>
614614
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIX>
615615
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIXLocalOnly>
616-
<Aliases>TF15</Aliases>
616+
<Aliases>global</Aliases>
617617
</ProjectReference>
618618
<ProjectReference Include="..\GitHub.TeamFoundation.16\GitHub.TeamFoundation.16.csproj">
619619
<Project>{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}</Project>
620620
<Name>GitHub.TeamFoundation.16</Name>
621621
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIX>
622622
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIXLocalOnly>
623-
<Aliases>TF16</Aliases>
623+
<Aliases>global</Aliases>
624624
</ProjectReference>
625625
<ProjectReference Include="..\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj">
626626
<Project>{158b05e8-fdbc-4d71-b871-c96e28d5adf5}</Project>

src/GitHub.VisualStudio/Services/VSGitExtFactory.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
extern alias TF14;
2-
extern alias TF15;
3-
extern alias TF16;
4-
5-
using System;
1+
using System;
62
using GitHub.Logging;
3+
using GitHub.VisualStudio.Base;
74
using Serilog;
8-
using VSGitExt14 = TF14.GitHub.VisualStudio.Base.VSGitExt;
9-
using VSGitExt15 = TF15.GitHub.VisualStudio.Base.VSGitExt;
10-
using VSGitExt16 = TF16.GitHub.VisualStudio.Base.VSGitExt;
115

126
namespace GitHub.Services
137
{

0 commit comments

Comments
 (0)