-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for different build flavors using IsExperimental
and IsProductComponent
properties
#884
Conversation
14a9a53
to
4390c12
Compare
@tannergooding, I was wondering how the Roslyn team handles using slightly different The least-worst solution I've come up with so far is as follows. Unfortunately it involves duplicating the <None Condition="'$(Configuration)' == 'Debug'"
Include="Configuration\Debug\source.extension.vsixmanifest" />
<None Condition="'$(Configuration)' == 'Release'"
Include="Configuration\Release\source.extension.vsixmanifest" />
<None Condition="'$(Configuration)' == 'Publish'"
Include="Configuration\Publish\source.extension.vsixmanifest" /> Thanks! |
4390c12
to
e1d1dfa
Compare
My second attempt uses the following: <!--
Update 'Debug' and 'Release' configurations to have AllUsers="false" and Experimental="true"
The Publish configuration will keep AllUsers="true" and Experimental="false".
-->
<Target Name="MakeVsixManifestExperimental" AfterTargets="DetokenizeVsixManifestFile"
Condition=" '$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release' ">
<Warning Text="NOTE: Tweaking '$(IntermediateVsixManifest)' to be 'Experimental'" />
<XmlPoke XmlInputPath="$(IntermediateVsixManifest)" Query="/x:PackageManifest/x:Installation/@AllUsers" Value="false"
Namespaces="<Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' />" />
<XmlPoke XmlInputPath="$(IntermediateVsixManifest)" Query="/x:PackageManifest/x:Installation/@Experimental" Value="true"
Namespaces="<Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' />" />
</Target> I think this is more maintainable because there's only a single |
Experimental
VSIX builds that can replace release versionsExperimental
VSIX builds that can replace release versions
Once this PR goes though, you should be able to install the locally built VSIX over the top of the deployed version. The deployed version will use the Also, you can associate VSIX files with the EXE found here: I'm adding a bunch of reviewers, so you all know this is possible. 😄 |
@jcansdale, the tool source is here: https://github.com/dotnet/roslyn-tools/tree/master/src/ModifyVsixManifest/ModifyVsixManifest. Basically our default VSIX manifest has Experimental=true and does not specify AllUsers or InstalledByMSI. We then (post build, but pre-signing) copy the VSIX to a separate location and run the below command. The original output retains the Experimental flag and the copied output will lose the Experimental flag and gain the AllUsers and InstalledByMSI flags. We then use the copied output as the VSIX we insert into VS and you should be able to give the original to people who need to dogfood the latest bits. & $modifyVsixManifestTool --vsix=$insertionVsix --remove=//x:PackageManifest/x:Installation/@Experimental --add-attribute=//x:PackageManifest/x:Installation`;AllUsers`;true --add-attribute=//x:PackageManifest/x:Installation`;InstalledByMSI`;true |
cb8ad1b
to
5732aad
Compare
@tannergooding Thanks for the link! You have a bunch if interesting tools in there. 😄 I can see how it makes sense to tweak this pre-signing. Since we have a separate configuration for |
Oh, it seems we don't actually use the I've changed it so that it defaults to |
Updated script uses `vsixutil.exe` which is like a scriptable version of `vsixinstaller.exe`. Extension will be installed for all versions of Visual Studio. It will only be installed for one VS 2017 SKU (prioritizing Enterprise, Professional then Community).
Add an MSBuild Target that will update `extension.vsixmanifest` to have AllUsers="false" and Experimental="true" on 'Debug' and 'Release' configurations. The 'Publish' configuration will keep AllUsers="true" and Experimental="false".
Build was failing when CreateVsixContainer was False.
By default the VSIX will be created with `AllUsers=false` and `Experimental=true`. It will be tweaked to have `AllUsers=true` and `Experimental=false` for the `Release` configuration.
The `Debug` configuration will be build with AllUsers=false and Experimental=true. This configuration can be installed without needing to uninstall the `AllUsers` version. Changed .cmd so that it works without the private `script` repo.
Running tests in `Debug` configuration doesn't currently work.
a01d902
to
4732caf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, works great! Not sure if there's been a discussion about this already, but should we have a name other than "Experimental" for a local install? I could see confusion about what experimental actually means to someone building locally. It's just two definitions now, but a VS experimental instance is also local.
Also, what happens if I keep automatic updates checked and an update happens? Does it overwrite my experimental install? |
Good question! At the moment when you build a If you build a
Good point about the potential for confusion with the "Experimental" instance of Visual Studio! Let me know if you can think of a way to clarify the wording. |
It looks like experimental installs are sticky and don't automatically update. I did some experiments with a feed containing experimental installs and it looks like you have to explicitly trigger the update. |
This can being the build time from 19s to 13s (on my laptop).
Bump to VisualStudio.Sdk.BuildTasks 14.0.14.0.23-pre. Default to `IsProductComponent=false`.
Decouple IsExperimental from Debug/Release configurations. Update README.md with description of build flavors.
Experimental
VSIX builds that can replace release versionsIsExperimental
and IsProductComponent
properties
From Build FlavorsBy default, building will create a VSIX with To build and install a build.cmd
install.cmd To build and install a set Configuration=Release
build.cmd
install.cmd To build a VSIX that could be deployed via the gallery / Extensions and Updates: set Configuration=Release
set IsExperimental=false
build.cmd
install.cmd To build a VSIX that could be deployed via Visual Studio setup: set Configuration=Release
set IsExperimental=false
set IsProductComponent=false
build.cmd
install.cmd |
README.md
Outdated
```txt | ||
set Configuration=Release | ||
set IsExperimental=false | ||
set IsProductComponent=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be IsProductComponent=true
however I'm not sure we should even put this section in the publicly readable readme as it's for internal use only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to keep everything together as much as possible. The Roslyn build uses similar stuff, so it isn't secret knowledge or anything. Since the .csproj files are public, I thought this documentation for them should be as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opps. Good catch on IsProductComponent=true
. Updated.
README.md
Outdated
|
||
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. | ||
|
||
To build and install a `Debug` configuration VSIX: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth making clear these instructions are for cmd.exe
- when running them in powershell the set
commands have no effect.
Should have been `IsProductComponent=true`! Specify using `cmd.exe`.
No need to mention `IsProductComponent=true` flavor. Tweaked gallery feed wording.
@tannergooding do you know if Experimental has broken in recent version of the tooling? We're suddenly getting our Experimental version loaded at the same time as the AllUsers version. Very frustrating! 😭 |
I'm not aware of anything that changed here. |
I've worked out what the problem is. I assumed the The issue we were seeing was triggered when one of our package GUIDs did change. This caused both versions of our extension to load and all kinds of problems! This is definitely something to watch out for if you ever remove a package! I struggle to believe this is how it's supposed to work. Maybe @tinaschrepfer could confirm? |
Fixes #883
This PR makes it easy to install developer VSIX builds over the top of the release version (installed for all users).
The
Publish
configurationextension.vsixmanifest
will include:I wonder if we also should be using
InstalledByMSI
(see jaredpar/VsixUtil#1 (comment))?The
Debug
andRelease
configurations will include: