Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Sep 30, 2024

Since now most specific packages just extend and project @(Constant) items, they effectively are all "constants", and the comment on the root class used to be "Provides access project-defined constants.". This no longer is the case for the following:

  • Metadata: exposes project-defined AssemblyMetadata, not "constants"
  • AssemblyInfo: exposes [Assembly*] attributes
  • Git: build-time source repo information, not even project constants
  • Vsix: manifest values, again, not even project values.

We should therefore allow a new metadata beside the Root attribute we added to allow custom roots: RootComment. Since each constant is emitted as a standalone file, we would have duplication, but we want to keep this approach for performance reasons.

We default to the old comment if none is specified. Example of a custom constant with a custom root and its comment:

<Constant Include="Foo.Bar" Value="Baz" Comment="A Bar value" Root="." RootComment="All the foos!" />

Since now most specific packages just extend and project @(Constant) items, they effectively are all "constants", and the comment on the root class used to be "Provides access project-defined constants.". This no longer is the case for the following:

- Metadata: exposes project-defined AssemblyMetadata, not "constants"
- AssemblyInfo: exposes [Assembly*] attributes
- Git: build-time source repo information, not even project constants
- Vsix: manifest values, again, not even project values.

We should therefore allow a new metadata beside the `Root` attribute we added to allow custom roots: `RootComment`. Since each constant is emitted as a standalone file, we would have duplication, but we want to keep this approach for performance reasons.

We default to the old comment if none is specified.
Example of a custom constant with a custom root and its comment:

```xml
<Constant Include="Foo.Bar" Value="Baz" Comment="A Bar value" Root="." RootComment="All the foos!" />
```
@kzu kzu added the enhancement New feature or request label Sep 30, 2024
@kzu kzu merged commit 9558384 into main Sep 30, 2024
@kzu kzu deleted the dev/summary branch September 30, 2024 21:03
@devlooped devlooped locked and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants