Skip to content

IgnoresAccessChecksToOmitAttributeDefinition & other fixes - #29

Merged
aelij merged 7 commits into
mainfrom
copilot/add-msbuild-property-ignoresaccesscheckstoomitattr
Jul 5, 2026
Merged

aelij merged 7 commits into
mainfrom
copilot/add-msbuild-property-ignoresaccesscheckstoomitattr

Conversation

Copilot AI commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds a new MSBuild property to suppress emission of the IgnoresAccessChecksToAttribute class definition — useful when the attribute is already declared elsewhere (e.g. by another package) and you'd otherwise get a duplicate type error.

Usage

<PropertyGroup>
  <IgnoresAccessChecksToOmitAttributeDefinition>true</IgnoresAccessChecksToOmitAttributeDefinition>
</PropertyGroup>

When set, the generated file still contains the [assembly: ...] attribute usages but omits the class definition.

Changes

  • PublicizeInternals.cs — adds OmitAttributeDefinition bool task property; extracts content generation into internal static BuildAttributeFileContent() which conditionally omits the class definition
  • IgnoresAccessChecksToGenerator.targets — wires $(IgnoresAccessChecksToOmitAttributeDefinition) → OmitAttributeDefinition on the task invocation
  • test/IgnoresAccessChecksToGenerator.Tasks.Test/ — new xUnit project with 4 tests covering default and omit behaviors for single and multiple assembly names
  • README.md — documents the new property with an example

Copilot AI changed the title [WIP] Add support for MSBuild property IgnoresAccessChecksToOmitAttributeDefinition Add IgnoresAccessChecksToOmitAttributeDefinition MSBuild property Jul 5, 2026
Copilot finished work on behalf of aelij July 5, 2026 18:35
Copilot AI requested a review from aelij July 5, 2026 18:35
Copilot finished work on behalf of aelij July 5, 2026 18:47
@aelij
aelij marked this pull request as ready for review July 5, 2026 20:18
@aelij aelij changed the title Add IgnoresAccessChecksToOmitAttributeDefinition MSBuild property IgnoresAccessChecksToOmitAttributeDefinition & other fixes Jul 5, 2026
@aelij
aelij merged commit 8ea9283 into main Jul 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants