Skip to content

Commit

Permalink
Add info about fixed capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes authored Apr 23, 2024
1 parent 2378749 commit 8e063cb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/overview/dynamicCapabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8e063cb

Please sign in to comment.