Repository Bootstrap
Repository Bootstrap
Section titled “Repository Bootstrap”The SDK bootstraps repo-level files so external tooling that does not read MSBuild item metadata (for example CSharpier, IDE formatting tools, and SDK resolution) works consistently out of the box.
.editorconfig bootstrapping
Section titled “.editorconfig bootstrapping”The package ships an .editorconfig in Sdk/.editorconfig. It is:
- Registered on
@(EditorConfigFiles)viaEditorConfigFilePathfor build-time code-style enforcement (EnforceCodeStyleInBuild=true,EnableNETAnalyzers=true,AnalysisLevel=latest,AnalysisMode=All). - Copied to the repository root (as a physical file) when a
.editorconfigdoes not already exist there, so tools like CSharpier pick it up.
Control it with:
| Property | Default | Description |
|---|---|---|
BootstrapEditorConfigToRepoRoot |
true |
Copies the SDK .editorconfig to the repository root when missing. |
RepositoryEditorConfigFilePath |
(auto-detected) | Override the destination path for the bootstrapped .editorconfig. |
DisableAutoCopySdkFiles |
false |
Master switch that disables repo-level SDK file bootstrapping. |
global.json bootstrapping
Section titled “global.json bootstrapping”The SDK creates a global.json at the repository root when one is missing, registering
Purview.BuildSdk in msbuild-sdks and setting the Microsoft.Testing.Platform test runner:
{ "test": { "runner": "Microsoft.Testing.Platform" }, "msbuild-sdks": { "Purview.BuildSdk": "<version>" }}Control it with:
| Property | Default | Description |
|---|---|---|
BootstrapGlobalJsonToRepoRoot |
true |
Creates a global.json at the repository root when missing. |
RepositoryGlobalJsonFilePath |
(auto-detected) | Override the destination path for the bootstrapped global.json. |
PurviewBuildSdkVersionForGlobalJson |
(auto-detected or 1.0.0 fallback) |
Version written to the msbuild-sdks.Purview.BuildSdk entry. |
DisableAutoCopySdkFiles |
false |
Master switch that disables repo-level SDK file bootstrapping. |
Repository root discovery
Section titled “Repository root discovery”Both bootstrap targets locate the repository root by:
- Running
git rev-parse --show-toplevelfrom theDirectory.Build.propsdirectory. - Falling back to probing upward for a
.gitmarker. - Finally falling back to the
Directory.Build.propsdirectory itself.
Set the RepositoryEditorConfigFilePath / RepositoryGlobalJsonFilePath properties explicitly to
override discovery.