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

Commit 2d00299

Browse files
committed
Add IsProductComponent/IsExperimental properties
Decouple IsExperimental from Debug/Release configurations. Update README.md with description of build flavors.
1 parent 6ecb30d commit 2d00299

File tree

4 files changed

+49
-10
lines changed

4 files changed

+49
-10
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,42 @@ install.cmd
5454

5555
Note, the script will only install in one instance of Visual Studio 2017 (Enterprise, Professional or Community).
5656

57+
## Build Flavors
58+
59+
By default, building will create a VSIX with `Experimental="true"` and `AllUsers="false"` in its `extension.vsixmanifest`. These settings are necessary in order to easily install a standalone VSIX file. There is no need to uninstall the version previously installed via Visual Studio setup / Extensions and Updates.
60+
61+
To build and install a `Debug` configuration VSIX:
62+
```txt
63+
build.cmd
64+
install.cmd
65+
```
66+
67+
To build and install a `Release` configuration VSIX:
68+
```txt
69+
set Configuration=Release
70+
build.cmd
71+
install.cmd
72+
```
73+
74+
To build a VSIX that could be deployed via the gallery / Extensions and Updates:
75+
```txt
76+
set Configuration=Release
77+
set IsExperimental=false
78+
build.cmd
79+
install.cmd
80+
```
81+
82+
To build a VSIX that could be deployed via Visual Studio setup:
83+
```txt
84+
set Configuration=Release
85+
set IsExperimental=false
86+
set IsProductComponent=false
87+
build.cmd
88+
install.cmd
89+
```
90+
91+
Note, attempting to install `IsExperimental=false` builds of the VSIX is not recommended.
92+
5793
## More information
5894

5995
- Andreia Gaita's [presentation](https://www.youtube.com/watch?v=hz2hCO8e_8w) at Codemania 2016 about this extension.

build.cmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
@if "%config%" == "" set config=Debug
1+
@if "%Configuration%" == "" set Configuration=Debug
2+
@if "%IsExperimental%" == "" set IsExperimental=true
3+
@if "%IsProductComponent%" == "" set IsProductComponent=false
24

35
call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
46

5-
@rem Build the GitHub.VisualStudio project / VSIX file
6-
msbuild GitHubVS.sln /p:Configuration=%Config% /t:GitHub_VisualStudio /p:IsProductComponent=false
7+
msbuild GitHubVS.sln /t:GitHub_VisualStudio /p:Configuration=%Configuration% /p:IsExperimental=%IsExperimental% /p:IsProductComponent=%IsProductComponent%
8+
@echo Built GitHub.VisualStudio with Configuration=%Configuration% IsExperimental=%IsExperimental% IsProductComponent=%IsProductComponent%

install.cmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@if "%config%" == "" set config=Debug
1+
@if "%Configuration%" == "" set Configuration=Debug
22

33
@set path=%cd%\tools\VsixUtil;%path%
44

5-
@echo Installing `%config%` build of GitHub for Visual Studio
6-
vsixutil /install "%cd%\build\%config%\GitHub.VisualStudio.vsix" /s Enterprise;Professional;Community
5+
vsixutil /install "%cd%\build\%Configuration%\GitHub.VisualStudio.vsix" /s Enterprise;Professional;Community
6+
@echo Installed %Configuration% build of GitHub for Visual Studio

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
<Import Project="..\..\packages\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.14.0.23-pre\build\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.props" Condition="Exists('..\..\packages\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.14.0.23-pre\build\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.props')" />
44
<Import Project="..\..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props')" />
55
<!--
6-
Update 'Release' configurations to have AllUsers="true" and Experimental="false"
7-
The 'Debug' configuration will keep AllUsers="false" and Experimental="true".
6+
Update to have AllUsers="true" and Experimental="false" when $(IsExperimental)' == 'false'
87
-->
9-
<Target Name="MakeVsixManifestAllUsers" AfterTargets="DetokenizeVsixManifestFile" Condition=" '$(Configuration)' == 'Release' ">
8+
<Target Name="MakeVsixManifestAllUsers" AfterTargets="DetokenizeVsixManifestFile" Condition=" '$(IsExperimental)' == 'false' ">
109
<Warning Text="NOTE: Tweaking '$(IntermediateVsixManifest)' to have AllUsers='true' and Experimental='false'" />
1110
<XmlPoke XmlInputPath="$(IntermediateVsixManifest)" Query="/x:PackageManifest/x:Installation/@AllUsers" Value="true" Namespaces="&lt;Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' /&gt;" />
1211
<XmlPoke XmlInputPath="$(IntermediateVsixManifest)" Query="/x:PackageManifest/x:Installation/@Experimental" Value="false" Namespaces="&lt;Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' /&gt;" />
@@ -444,7 +443,9 @@
444443
</VSCTCompile>
445444
</ItemGroup>
446445
<ItemGroup>
447-
<Resource Include="FodyWeavers.xml" />
446+
<Resource Include="FodyWeavers.xml">
447+
<SubType>Designer</SubType>
448+
</Resource>
448449
<CodeAnalysisDictionary Include="..\common\CodeAnalysisDictionary.xml">
449450
<Link>Properties\CodeAnalysisDictionary.xml</Link>
450451
</CodeAnalysisDictionary>

0 commit comments

Comments
 (0)