From 2378749b5f9bd8bd906a3bc9972ac9d7d14bb4c9 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Tue, 23 Apr 2024 14:58:53 +1000 Subject: [PATCH 1/3] Add more docs around capability providers and diagnostics --- doc/Images/diagnose-capabilities-tree.png | Bin 0 -> 25707 bytes doc/overview/about_project_capabilities.md | 16 ++++++++++- doc/overview/dynamicCapabilities.md | 30 ++++++++++++++++++++- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 doc/Images/diagnose-capabilities-tree.png diff --git a/doc/Images/diagnose-capabilities-tree.png b/doc/Images/diagnose-capabilities-tree.png new file mode 100644 index 0000000000000000000000000000000000000000..6298cac0675b5fc02640d76cd264e0e680d1683f GIT binary patch literal 25707 zcmbT8Wmr`G+V%mF?hX;8k)ah3>BgZ28IW-3R#Hkrx_bbTl+K}~L5F4t=@g{9rR!bX z_kNDO_r3S??0vi+_yY4^YgV4u@4U{7P<2%Wd>k4a6ciMEB}G|H6ckh#@bd`^1NaR{ z#B2uzg#krLR!Ykab*I@TT)*oRx7&?UQBgwNa9jg-B}-Bjve7HY(dz94cVe`S9!eeg>0wCJ|5I#G{IM7u4q~ zbaN2mip8(?DV$EFC0^ppoH`|SO$VK%gQQ7)QbG(H!}^ENmeJWmRwT$&kYjy9`2Mxf-e!OglyP5 z;cjhhy^;t-_F+=%mDw@^f#$e@1pm&sX}y)*6Zc5EIln!(IJiC+7{uj+YAjfQm{(8z z0$2ju<3erS@F#rod3#*o)L`YNDdwN8%^c#+0bHK~<-WQh;zqrd5XK$BaJ<}W$+ItX zA(21kKj4OwBt8yUS+tITeS(U* zk;y5&!%bEYArBhgK$1|*un`wVC;QgGO|f&Vib>zwaS5AL$T_ti7je02%03j_dmYQ( z$wMrEK|=9TOP&iP%IUs$;Q3qV)}(qg*Zk3D@8SXB?WF`3)S>l=gu09KF^ILNE_*n7 zq*&!;6uce$(X+aWlqWQDSYkRTM>m-HIbC_uONQz

vG466x;FvD?7F4)R0|T;yJ@ zH;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_QwwT)T2HaN!AypIU`nYA5$Yp^`0P9bPvzS#jX3gIR#kjg0^yrZhz#9 z?>$Z^ioZ~iU3oPW(8;91^*fGdpRc{{Z7aTx>whk4ybV5X+r>kmg4xYu0cCD!ASgAX zhK+k?JN8LP_vdHv%bTCxB3Edhu&{J-rl6Etb~jCGW?8%MHW%0vNRLbnv-gGEVmysX z2&K}1H)}Uz#)1HMG&?EbS9=*l^iwfPc=SE`iZ%t{h(->8`lh*yM58dqjDW139y~+hC!5tW_8za7*5l7CB3TX zk#s;2ub0RJ+zuqTj5`kIzcW>!ZY0ME(cVu6i{*HQvu(5sWtTh&O_e3GT+_DG24dKW6B zT81Xzik91{rbX5%ncmmMgr1d2Z@oxAHBwT>$>2+I r$-=!hotHkby}k8rJ7Vp{0b@H< + + + ``` +## Viewing a project's capabilities + +To see the capabilities a CPS project defines, add the `DiagnoseCapabilities` project capability to turn on a tree in the VS Solution Explorer that lists all capabilities of the project: + +```xml + + + +``` + +![alt text](../Images/diagnose-capabilities-tree.png) + ## Common project capabilities and where they are defined ### Existing project capabilities diff --git a/doc/overview/dynamicCapabilities.md b/doc/overview/dynamicCapabilities.md index 4272eec..df4e948 100644 --- a/doc/overview/dynamicCapabilities.md +++ b/doc/overview/dynamicCapabilities.md @@ -10,7 +10,6 @@ a project to be adjusted dynamically based on features/NuGet packages being used For example, WPF features can be turned on, only because the project references WPF related packages, instead of depending on which template was used when the project was created. - ## Capabilities are now coming from dataflows In both unconfigured project and configured project scopes, capabilities are no longer a fixed set of strings. @@ -54,6 +53,35 @@ public MyComponent(ConfiguredProject configuredProject) The `DeployProviders` collection will contain a set of `IDeployProvider` filtered by the current capabilities of the configuredProject. The content of the collection can change over the time. +## Dynamically producing project capabilities + +Capabilities can be added to a project at run-time via code. To do so, export an instance of +`IProjectCapabilitiesProvider`. The easiest way to do this is to subclass `ProjectCapabilitiesProviderBase` +and override the `GetCapabilitiesAsync` method. + +For example, if your project should only have a certain capability on Tuesday, you could use: + +```c# +[Export(ExportContractNames.Scopes.UnconfiguredProject, typeof(IProjectCapabilitiesProvider))] +[AppliesTo("MyProjectCapability")] // Replace with capabilities that define when your provider should be active +internal class TuesdayProjectCapabilityProvider : ProjectCapabilitiesProviderBase +{ + [ImportingConstructor] + public TuesdayProjectCapabilityProvider(UnconfiguredProject project) + : base(nameof(TuesdayProjectCapabilityProvider), project.Services.ThreadingPolicy.JoinableTaskContext, project.Services.DataSourceRegistry, configuredProjectLevel: false) + { + } + + protected override Task> GetCapabilitiesAsync(CancellationToken cancellationToken) + { + // Replace this with whatever logic you require. + return DateTime.Now.DayOfWeek == DayOfWeek.Tuesday + ? Task.FromResult(Empty.CapabilitiesSet.Add("Tuesday")) + : Task.FromResult(Empty.CapabilitiesSet); + } +} +``` + ## How to prevent seeing capability changes in the middle of an execution When changes are made to the project, just like other dataflows inside CPS, capabilites are being recalculated From 8e063cb9409cf5ccd474a2c506df673691dbe9f2 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Wed, 24 Apr 2024 09:41:12 +1000 Subject: [PATCH 2/3] Add info about fixed capabilities --- doc/overview/dynamicCapabilities.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/overview/dynamicCapabilities.md b/doc/overview/dynamicCapabilities.md index df4e948..a9e7f7f 100644 --- a/doc/overview/dynamicCapabilities.md +++ b/doc/overview/dynamicCapabilities.md @@ -53,6 +53,26 @@ public MyComponent(ConfiguredProject configuredProject) The `DeployProviders` collection will contain a set of `IDeployProvider` filtered by the current capabilities of the configuredProject. The content of the collection can change over the time. +## Defining fixed capabilities for a project type + +Some capabilities are static/fixed for a given project type. These capabilities should be defined directly on the +project type registration. + +For example: + +```c# +[assembly: ProjectTypeRegistration( + projectTypeGuid: MyProjectType.Guid, + displayName: "#1", + displayProjectFileExtensions: "#2", + defaultProjectExtension: "myproj", + language: "MyLang", + resourcePackageGuid: MyPackage.PackageGuid, + Capabilities = "MyProject")] +``` + +Capabilities defined via the `ProjectTypeRegistrationAttribute.Capabilities` property are available on all projects loaded for that project type. + ## Dynamically producing project capabilities Capabilities can be added to a project at run-time via code. To do so, export an instance of @@ -82,6 +102,8 @@ internal class TuesdayProjectCapabilityProvider : ProjectCapabilitiesProviderBas } ``` +Note there can be a chicken/egg problem here, where one capability enables a provider (via `AppliesTo`) that then adds another capability, and so on. + ## How to prevent seeing capability changes in the middle of an execution When changes are made to the project, just like other dataflows inside CPS, capabilites are being recalculated From 237897d7ca871dbd71c5ea3ad4a95f79bf86cebe Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Wed, 24 Apr 2024 11:36:56 +1000 Subject: [PATCH 3/3] Remove custom IProjectCapabilitiesProvider docs It's too hard to do this correctly, and generally other approaches are better. --- doc/overview/about_project_capabilities.md | 35 +++++++++++++-- doc/overview/dynamicCapabilities.md | 51 ---------------------- 2 files changed, 31 insertions(+), 55 deletions(-) diff --git a/doc/overview/about_project_capabilities.md b/doc/overview/about_project_capabilities.md index 8680000..8dd8655 100644 --- a/doc/overview/about_project_capabilities.md +++ b/doc/overview/about_project_capabilities.md @@ -6,9 +6,11 @@ file extension does not help if you want to check for WPF vs. WinForms vs. Windows 8 XAML, for example. There are a great many different aspects to a project that may be present regardless of language. Do you want code that runs against any Windows 8 targeting project regardless of language? -Do you want to target just Javascript Win8 projects but not LightSwitch +Do you want to target just JavaScript Win8 projects but not LightSwitch JS projects? Project capability checks are the answer. +## Checking capabilities + The presence of some capability can be detected on a given project with code such as: @@ -26,10 +28,14 @@ method in order to test for combinations of capabilities (including AND, OR, NOT logic). Read more about [the supported syntax and operators](https://msdn.microsoft.com/library/microsoft.visualstudio.shell.interop.ivsbooleansymbolexpressionevaluator.evaluateexpression.aspx). -## How to declare project capabilities in your project +## Filtering MEF parts via capabilities + +Classes exported via MEF can declare the project capabilities under which they apply. See [MEF](mef.md) for more information. + +## Defining capabilities via MSBuild Project capabilities can be declared in several ways, the easiest of which -being to add this MSBuild item to your .targets file: +being to add this MSBuild item to your `.targets` file: ```xml @@ -37,6 +43,27 @@ being to add this MSBuild item to your .targets file: ``` +## Defining fixed capabilities for a project type + +Some capabilities are static/fixed for a given project type. These capabilities should be defined directly on the project type registration. + +For example: + +```csharp +[assembly: ProjectTypeRegistration( + projectTypeGuid: MyProjectType.Guid, + displayName: "#1", + displayProjectFileExtensions: "#2", + defaultProjectExtension: "myproj", + language: "MyLang", + resourcePackageGuid: MyPackage.PackageGuid, + Capabilities = "MyProject; AnotherCapability")] // Define capabilities here +``` + +Capabilities defined via the `ProjectTypeRegistrationAttribute.Capabilities` property are available on all projects loaded for that project type. Multiple values are separated by semicolon (`;`). + +Sometimes you'll need capabilities to be defined very early in a project's lifecycle. These fixed capabilities are available from + ## Viewing a project's capabilities To see the capabilities a CPS project defines, add the `DiagnoseCapabilities` project capability to turn on a tree in the VS Solution Explorer that lists all capabilities of the project: @@ -96,7 +123,7 @@ It's very important that project capabilities you define fit this criteria: - Bad: `CS` - May include a version number, when necessary, but is usually discouraged. -### Dynamic project capabilities +## Dynamic project capabilities Capablities of a project can be changed without reloading the project. Read more about [dynamic project capabilities](dynamicCapabilities.md). diff --git a/doc/overview/dynamicCapabilities.md b/doc/overview/dynamicCapabilities.md index a9e7f7f..33f3dec 100644 --- a/doc/overview/dynamicCapabilities.md +++ b/doc/overview/dynamicCapabilities.md @@ -53,57 +53,6 @@ public MyComponent(ConfiguredProject configuredProject) The `DeployProviders` collection will contain a set of `IDeployProvider` filtered by the current capabilities of the configuredProject. The content of the collection can change over the time. -## Defining fixed capabilities for a project type - -Some capabilities are static/fixed for a given project type. These capabilities should be defined directly on the -project type registration. - -For example: - -```c# -[assembly: ProjectTypeRegistration( - projectTypeGuid: MyProjectType.Guid, - displayName: "#1", - displayProjectFileExtensions: "#2", - defaultProjectExtension: "myproj", - language: "MyLang", - resourcePackageGuid: MyPackage.PackageGuid, - Capabilities = "MyProject")] -``` - -Capabilities defined via the `ProjectTypeRegistrationAttribute.Capabilities` property are available on all projects loaded for that project type. - -## Dynamically producing project capabilities - -Capabilities can be added to a project at run-time via code. To do so, export an instance of -`IProjectCapabilitiesProvider`. The easiest way to do this is to subclass `ProjectCapabilitiesProviderBase` -and override the `GetCapabilitiesAsync` method. - -For example, if your project should only have a certain capability on Tuesday, you could use: - -```c# -[Export(ExportContractNames.Scopes.UnconfiguredProject, typeof(IProjectCapabilitiesProvider))] -[AppliesTo("MyProjectCapability")] // Replace with capabilities that define when your provider should be active -internal class TuesdayProjectCapabilityProvider : ProjectCapabilitiesProviderBase -{ - [ImportingConstructor] - public TuesdayProjectCapabilityProvider(UnconfiguredProject project) - : base(nameof(TuesdayProjectCapabilityProvider), project.Services.ThreadingPolicy.JoinableTaskContext, project.Services.DataSourceRegistry, configuredProjectLevel: false) - { - } - - protected override Task> GetCapabilitiesAsync(CancellationToken cancellationToken) - { - // Replace this with whatever logic you require. - return DateTime.Now.DayOfWeek == DayOfWeek.Tuesday - ? Task.FromResult(Empty.CapabilitiesSet.Add("Tuesday")) - : Task.FromResult(Empty.CapabilitiesSet); - } -} -``` - -Note there can be a chicken/egg problem here, where one capability enables a provider (via `AppliesTo`) that then adds another capability, and so on. - ## How to prevent seeing capability changes in the middle of an execution When changes are made to the project, just like other dataflows inside CPS, capabilites are being recalculated