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

Commit a4e2fd8

Browse files
committed
Separate VSIX packaging from source files
Separate concerns between VSIX packaging and source code/assemblies. This should allow the GitHub.VisualStudio project compile faster for unit testing.
1 parent 0ba59a3 commit a4e2fd8

File tree

10 files changed

+517
-41
lines changed

10 files changed

+517
-41
lines changed

GitHubVS.sln

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27703.2035
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28603.18
55
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio.Vsix", "src\GitHub.VisualStudio.Vsix\GitHub.VisualStudio.Vsix.csproj", "{D26B4B40-0C94-48AD-8019-0B9BE46E0071}"
7+
EndProject
68
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio", "src\GitHub.VisualStudio\GitHub.VisualStudio.csproj", "{11569514-5AE5-4B5B-92A2-F10B0967DE5F}"
79
ProjectSection(ProjectDependencies) = postProject
810
{7F5ED78B-74A3-4406-A299-70CFB5885B8B} = {7F5ED78B-74A3-4406-A299-70CFB5885B8B}
@@ -141,7 +143,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Octokit.GraphQL.Core", "sub
141143
EndProject
142144
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Octokit.GraphQL", "submodules\octokit.graphql.net\Octokit.GraphQL\Octokit.GraphQL.csproj", "{791B408C-0ABC-465B-9EB1-A2422D67F418}"
143145
EndProject
144-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.StartPage.UnitTests", "test\GitHub.StartPage.UnitTests\GitHub.StartPage.UnitTests.csproj", "{B467682B-9F0E-42D8-8A20-1DE78F798793}"
146+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub.StartPage.UnitTests", "test\GitHub.StartPage.UnitTests\GitHub.StartPage.UnitTests.csproj", "{B467682B-9F0E-42D8-8A20-1DE78F798793}"
145147
EndProject
146148
Global
147149
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -503,6 +505,14 @@ Global
503505
{B467682B-9F0E-42D8-8A20-1DE78F798793}.Release|Any CPU.Build.0 = Release|Any CPU
504506
{B467682B-9F0E-42D8-8A20-1DE78F798793}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
505507
{B467682B-9F0E-42D8-8A20-1DE78F798793}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
508+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
509+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.Debug|Any CPU.Build.0 = Debug|Any CPU
510+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.DebugWithoutVsix|Any CPU.ActiveCfg = DebugWithoutVsix|Any CPU
511+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.DebugWithoutVsix|Any CPU.Build.0 = DebugWithoutVsix|Any CPU
512+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.Release|Any CPU.ActiveCfg = Release|Any CPU
513+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.Release|Any CPU.Build.0 = Release|Any CPU
514+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.ReleaseWithoutVsix|Any CPU.ActiveCfg = ReleaseWithoutVsix|Any CPU
515+
{D26B4B40-0C94-48AD-8019-0B9BE46E0071}.ReleaseWithoutVsix|Any CPU.Build.0 = ReleaseWithoutVsix|Any CPU
506516
EndGlobalSection
507517
GlobalSection(SolutionProperties) = preSolution
508518
HideSolutionNode = FALSE

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

Lines changed: 375 additions & 0 deletions
Large diffs are not rendered by default.

src/GitHub.VisualStudio/GitHub.VisualStudio.imagemanifest renamed to src/GitHub.VisualStudio.Vsix/GitHub.VisualStudio.imagemanifest

File renamed without changes.
File renamed without changes.

src/GitHub.VisualStudio/Resources/preview_200x200.png renamed to src/GitHub.VisualStudio.Vsix/Resources/preview_200x200.png

File renamed without changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Target Name="RemoveVSSDKAssemblies"
4+
AfterTargets="GetVsixSourceItems">
5+
<ItemGroup>
6+
<SuppressPackaging Include="@(VSIXSourceItem)"
7+
Condition="
8+
$([System.String]::Copy('%(Filename)').Contains('Microsoft.')) or
9+
$([System.String]::Copy('%(Extension)').Contains('.dylib')) or
10+
$([System.String]::Copy('%(Extension)').Contains('.so')) or
11+
$([System.Text.RegularExpressions.Regex]::IsMatch('%(FullPath)', '.*\\LibGit2Sharp.NativeBinaries.*\\.*\.pdb'))
12+
"/>
13+
<VSIXSourceItem Remove="@(SuppressPackaging)" />
14+
</ItemGroup>
15+
<Message Importance="High" Text='Suppressed "@(SuppressPackaging)" from being included in VSIX.' />
16+
</Target>
17+
18+
<Target Name="UpdateManifestVersion"
19+
AfterTargets="DetokenizeVsixManifestFile"
20+
DependsOnTargets="GetBuildVersion"
21+
Outputs="$(IntermediateVsixManifest)">
22+
<Message Text="Stamping package with version '$(BuildVersion)'" />
23+
<XmlPoke XmlInputPath="$(IntermediateVsixManifest)" Query="/x:PackageManifest/x:Metadata/x:Identity/@Version" Value="$(BuildVersion)" Namespaces="&lt;Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' /&gt;" />
24+
</Target>
25+
26+
<!-- set AllUsers="false" and Experimental="true" when $(IsExperimental)' == 'true' -->
27+
<Target Name="ExperimentalManifest" AfterTargets="DetokenizeVsixManifestFile" Condition=" '$(IsExperimental)' == 'true' ">
28+
<Warning Text="NOTE: Tweaking '$(IntermediateVsixManifest)' to have AllUsers='false' and Experimental='true'" />
29+
<XmlPoke XmlInputPath="$(IntermediateVsixManifest)" Query="/x:PackageManifest/x:Installation/@AllUsers" Value="false" Namespaces="&lt;Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' /&gt;" />
30+
<XmlPoke XmlInputPath="$(IntermediateVsixManifest)" Query="/x:PackageManifest/x:Installation/@Experimental" Value="true" Namespaces="&lt;Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' /&gt;" />
31+
</Target>
32+
</Project>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<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">
3+
<Metadata>
4+
<Identity Id="c3d3dc68-c977-411f-b3e8-03b0dccf7dfc" Version="2.8.0.0" Language="en-US" Publisher="GitHub, Inc" />
5+
<DisplayName>GitHub Extension for Visual Studio</DisplayName>
6+
<Description xml:space="preserve">A Visual Studio Extension that brings the GitHub Flow into Visual Studio.</Description>
7+
<PackageId>GitHub.VisualStudio</PackageId>
8+
<MoreInfo>https://visualstudio.github.com</MoreInfo>
9+
<License>LICENSE.txt</License>
10+
<ReleaseNotes>https://visualstudio.github.com/release-notes.html</ReleaseNotes>
11+
<Icon>Resources\logo_128x128.png</Icon>
12+
<PreviewImage>Resources\preview_200x200.png</PreviewImage>
13+
<Tags>GitHub;git;open source;source control;branch;pull request;team explorer;commit;publish</Tags>
14+
</Metadata>
15+
<Installation AllUsers="true" Experimental="false">
16+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0,17.0)" />
17+
<InstallationTarget Id="Microsoft.VisualStudio.IntegratedShell" Version="[15.0,17.0)" />
18+
</Installation>
19+
<Dependencies>
20+
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
21+
<Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0,)" />
22+
<Dependency Id="Microsoft.VisualStudio.TeamFoundation.TeamExplorer.Extensions" DisplayName="Team Explorer" d:Source="Installed" Version="[14.0,)" />
23+
</Dependencies>
24+
<Assets>
25+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.Exports" Path="|GitHub.Exports|" />
26+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.Api" Path="|GitHub.Api|" />
27+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.Exports.Reactive" Path="|GitHub.Exports.Reactive|" />
28+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.App" Path="|GitHub.App|" />
29+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.Services.Vssdk" Path="|GitHub.Services.Vssdk|" />
30+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.TeamFoundation.14" TargetVersion="[14.0,15.0)" Path="|GitHub.TeamFoundation.14|" />
31+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.TeamFoundation.15" TargetVersion="[15.0,16.0)" Path="|GitHub.TeamFoundation.15|" />
32+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.TeamFoundation.16" TargetVersion="[16.0,17.0)" Path="|GitHub.TeamFoundation.16|" />
33+
<!-- Sometimes the version of `ServiceHub.VSDetouredHost.exe` is used when installing for Visual Studio 2017, see https://github.com/github/VisualStudio/pull/1875 -->
34+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.TeamFoundation.15" TargetVersion="[1.0,2.0)" Path="|GitHub.TeamFoundation.15|" />
35+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="GitHub.InlineReviewsPackage" Path="|GitHub.InlineReviews;PkgdefProjectOutputGroup|" />
36+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="GitHub.StartPage" Path="|GitHub.StartPage;PkgdefProjectOutputGroup|" />
37+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.InlineReviews" Path="|GitHub.InlineReviews|" />
38+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.VisualStudio.UI" Path="|GitHub.VisualStudio.UI|" />
39+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="File" Path="Rothko.dll" />
40+
<Asset Type="Microsoft.VisualStudio.Assembly" d:Source="File" Path="Newtonsoft.Json.dll" AssemblyName="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" />
41+
<Asset Type="Microsoft.VisualStudio.Assembly" d:Source="File" Path="System.ValueTuple.dll" AssemblyName="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
42+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.VisualStudio" Path="|GitHub.VisualStudio|" />
43+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="GitHub.VisualStudio" Path="|GitHub.VisualStudio;PkgdefProjectOutputGroup|" />
44+
</Assets>
45+
<Prerequisites>
46+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.25824.0,)" DisplayName="Visual Studio core editor" />
47+
</Prerequisites>
48+
</PackageManifest>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<UsingTask
5+
TaskName="GenerateVersion"
6+
TaskFactory="CodeTaskFactory"
7+
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
8+
9+
<ParameterGroup>
10+
<SolutionInfoFile ParameterType="System.String" Required="true" />
11+
<GeneratedVersion ParameterType="System.String" Output="true" />
12+
</ParameterGroup>
13+
<Task>
14+
<Using Namespace="System" />
15+
<Using Namespace="System.IO" />
16+
<Using Namespace="System.Text.RegularExpressions" />
17+
<Code Type="Fragment" Language="cs">
18+
<![CDATA[
19+
var str = File.ReadAllText(this.SolutionInfoFile);
20+
var regex = new Regex(@"Version = ""([\d]+\.[\d]+\.[\d]+.[\d]+)""");
21+
var v = Version.Parse(regex.Match(str).Groups[1].Value);
22+
this.GeneratedVersion = String.Format("{0}.{1}.{2}.{3}", v.Major, v.Minor, v.Build, DateTimeOffset.UtcNow.ToUnixTimeSeconds());
23+
]]>
24+
</Code>
25+
</Task>
26+
</UsingTask>
27+
28+
<Target Name="GenerateVersionFile"
29+
Condition="$(SkipPackage) != 'Skip'"
30+
AfterTargets="CoreCompile"
31+
Inputs="$(SolutionDir)\src\common\SolutionInfo.cs"
32+
Outputs="$(SolutionDir)\build\version">
33+
<GenerateVersion SolutionInfoFile="$(SolutionDir)\src\common\SolutionInfo.cs">
34+
<Output TaskParameter="GeneratedVersion" PropertyName="GeneratedVersion" />
35+
</GenerateVersion>
36+
37+
<Message Text="Generating file '$(SolutionDir)\build\version' with version '$(GeneratedVersion)'" />
38+
39+
<WriteLinesToFile File="$(SolutionDir)\build\version" Lines="$(GeneratedVersion)" Overwrite="True" />
40+
</Target>
41+
42+
<Target Name="GetBuildVersion" Returns="$(BuildVersion)" DependsOnTargets="GenerateVersionFile">
43+
<ReadLinesFromFile File="$(SolutionDir)\build\version">
44+
<Output TaskParameter="Lines" PropertyName="BuildVersion" />
45+
</ReadLinesFromFile>
46+
</Target>
47+
</Project>

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<ErrorReport>prompt</ErrorReport>
4242
<WarningLevel>4</WarningLevel>
4343
<RunCodeAnalysis>false</RunCodeAnalysis>
44-
<CreateVsixContainer>True</CreateVsixContainer>
45-
<DeployExtension>True</DeployExtension>
44+
<CreateVsixContainer>False</CreateVsixContainer>
45+
<DeployExtension>False</DeployExtension>
4646
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
4747
<OutputPath>..\..\build\Debug\</OutputPath>
4848
<DebugSymbols>true</DebugSymbols>
@@ -166,18 +166,6 @@
166166
</EmbeddedResource>
167167
</ItemGroup>
168168
<ItemGroup>
169-
<Content Include="Resources\logo_128x128.png">
170-
<IncludeInVSIX>true</IncludeInVSIX>
171-
</Content>
172-
<Content Include="Resources\preview_200x200.png">
173-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
174-
<IncludeInVSIX>true</IncludeInVSIX>
175-
</Content>
176-
<Content Include="GitHub.VisualStudio.imagemanifest">
177-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
178-
<IncludeInVSIX>true</IncludeInVSIX>
179-
<SubType>Designer</SubType>
180-
</Content>
181169
<Content Include="Settings\generated\PackageSettingsGen.tt">
182170
<Generator>TextTemplatingFileGenerator</Generator>
183171
<CustomToolNamespace>GitHub.VisualStudio.Settings</CustomToolNamespace>
@@ -201,10 +189,6 @@
201189
<CodeAnalysisDictionary Include="..\common\CodeAnalysisDictionary.xml">
202190
<Link>Properties\CodeAnalysisDictionary.xml</Link>
203191
</CodeAnalysisDictionary>
204-
<Content Include="LICENSE.txt">
205-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
206-
<IncludeInVSIX>true</IncludeInVSIX>
207-
</Content>
208192
<Resource Include="Resources\default_org_avatar.png" />
209193
<Resource Include="Resources\default_user_avatar.png" />
210194
</ItemGroup>
@@ -378,26 +362,6 @@
378362
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;PkgdefProjectOutputGroup</IncludeOutputGroupsInVSIX>
379363
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;PkgdefProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
380364
</ProjectReference>
381-
<ProjectReference Include="..\GitHub.TeamFoundation.14\GitHub.TeamFoundation.14.csproj" ReferenceOutputAssembly="false">
382-
<Project>{161dbf01-1dbf-4b00-8551-c5c00f26720d}</Project>
383-
<Name>GitHub.TeamFoundation.14</Name>
384-
<Private>True</Private>
385-
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIX>
386-
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIXLocalOnly>
387-
</ProjectReference>
388-
<ProjectReference Include="..\GitHub.TeamFoundation.15\GitHub.TeamFoundation.15.csproj" ReferenceOutputAssembly="false">
389-
<Project>{161dbf01-1dbf-4b00-8551-c5c00f26720e}</Project>
390-
<Name>GitHub.TeamFoundation.15</Name>
391-
<Private>True</Private>
392-
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIX>
393-
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIXLocalOnly>
394-
</ProjectReference>
395-
<ProjectReference Include="..\GitHub.TeamFoundation.16\GitHub.TeamFoundation.16.csproj" ReferenceOutputAssembly="false">
396-
<Project>{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}</Project>
397-
<Name>GitHub.TeamFoundation.16</Name>
398-
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIX>
399-
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIXLocalOnly>
400-
</ProjectReference>
401365
<ProjectReference Include="..\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj">
402366
<Project>{158b05e8-fdbc-4d71-b871-c96e28d5adf5}</Project>
403367
<Name>GitHub.UI.Reactive</Name>

0 commit comments

Comments
 (0)