Skip to content

Package repository style config files in SDK artifacts - #22

Open
matt-edmondson with Copilot wants to merge 4 commits into
mainfrom
copilot/investigate-distributing-style-config-files
Open

Package repository style config files in SDK artifacts#22
matt-edmondson with Copilot wants to merge 4 commits into
mainfrom
copilot/investigate-distributing-style-config-files

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown

This change investigates and implements distribution of repository style/config files from the MSBuild SDK package. The core SDK package now carries .editorconfig, .gitattributes, and .gitignore as package data assets.

  • What changed (SDK packaging)

    • Added a pack-time staging target in Sdk.Common.PackageContent.targets to copy dotfiles from $(SolutionDir) into intermediate output.
    • Included staged files in the nupkg under _PackageData/ as:
      • _PackageData/editorconfig
      • _PackageData/gitattributes
      • _PackageData/gitignore
  • What changed (regression coverage)

    • Added SdkPackageContentTests to assert the packed ktsu.Sdk nupkg:
      • contains all three style/config assets
      • preserves exact file contents from repository root
  • Implementation snippet

    <Target Name="_KtsuStageStyleConfigPackageFiles" BeforeTargets="_GetPackageFiles">
      <Copy SourceFiles="$(SolutionDir)\.editorconfig" DestinationFiles="$(IntermediateOutputPath)ktsu.package-data\editorconfig" Condition="Exists('$(SolutionDir)\.editorconfig')" />
      <ItemGroup>
        <None Include="$(IntermediateOutputPath)ktsu.package-data\editorconfig"
              Pack="true"
              PackagePath="_PackageData/"
              Link=".editorconfig"
              Visible="false" />
      </ItemGroup>
    </Target>

Co-authored-by: matt-edmondson <19528727+matt-edmondson@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate distributing style config files Package repository style config files in SDK artifacts Aug 6, 2026
Copilot AI requested a review from matt-edmondson August 6, 2026 02:36
@matt-edmondson

Copy link
Copy Markdown
Contributor

@copilot how do these files get applied to sdk consumers?

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown
Author

@copilot how do these files get applied to sdk consumers?

They aren’t auto-applied by the current change. Right now the SDK package just carries them as data assets under _PackageData/ (editorconfig, gitattributes, gitignore). MSBuild doesn’t automatically copy or merge those into a consumer repo; a separate target/tooling step would be needed if we want automatic application to consumer projects.

@matt-edmondson

matt-edmondson commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Can I have a way to auto update the consumer versions of those files with a way to opt-out? @copilot

@matt-edmondson

Copy link
Copy Markdown
Contributor

@copilot Can I have a way to auto update the consumer versions of those files with a way to opt-out?

Copilot AI and others added 2 commits August 6, 2026 03:11
Co-authored-by: matt-edmondson <19528727+matt-edmondson@users.noreply.github.com>
Co-authored-by: matt-edmondson <19528727+matt-edmondson@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown
Author

Can I have a way to auto update the consumer versions of those files with a way to opt-out? @copilot

Implemented in a5512d0. The SDK now auto-syncs existing solution-root .editorconfig, .gitattributes, and .gitignore from packaged _PackageData during build. You can opt out with <KtsuSyncStyleConfigFiles>false</KtsuSyncStyleConfigFiles>.

@copilot Can I have a way to auto update the consumer versions of those files with a way to opt-out?

Implemented in a5512d0. Auto-sync is now built in, and opt-out is supported via <KtsuSyncStyleConfigFiles>false</KtsuSyncStyleConfigFiles>.

@matt-edmondson
matt-edmondson marked this pull request as ready for review August 6, 2026 03:40
@matt-edmondson

Copy link
Copy Markdown
Contributor

@copilot the file header template in the editorconfig needs to use the copyright info of the consumer, rather than stomping it with ktsu.dev

@matt-edmondson

Copy link
Copy Markdown
Contributor

@copilot add .runsettings

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.

Investigate distributing style config files

2 participants