Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/breezy-suits-teach.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/busy-apes-type.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/config.json

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/dry-crabs-join.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eager-doodles-strive.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/eleven-pandas-agree.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/four-cycles-doubt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fruity-stars-check.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/funky-rats-hug.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/gentle-tires-attend.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/large-buses-poke.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lucky-glasses-battle.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/olive-poets-live.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/petite-rabbits-hide.md

This file was deleted.

27 changes: 0 additions & 27 deletions .changeset/pre.json

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rich-candles-relax.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/strict-schools-chew.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/thick-snails-bathe.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tiny-pears-burn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/warm-phones-repair.md

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Version detection logging is disabled by default. Set `VersionDetectionLogEnable
| `NamespacePrefix` | *(required)* | Root namespace prefix, e.g. `Acme`. Results in `Acme.MyProject`. |
| `DisableNamespacePrefixCheck` | `false` | Set to `true` to suppress the build error for missing `NamespacePrefix`. |
| `TargetFramework` | `net10.0` | Override the default TFM per-project or globally. Defaults to `netstandard2.0` for projects declaring `IsRoslynComponent=true`. |
| `IsRoslynComponent` | `false` | When explicitly `true`, applies source-generator defaults for a single `netstandard2.0` target, analyzer rules, SourceLink, generated-file output, dependency output, symbol packaging, telemetry exclusion, and package build output. |
| `IsRoslynComponent` | `false` | When explicitly `true`, applies source-generator defaults: a single `netstandard2.0` target, `LangVersion=latest`, `Nullable=enable`, `TreatWarningsAsErrors=true`, extended analyzer rules, SourceLink, generated-file output, dependency output, symbol packaging (`IncludeSymbols=false` by default), telemetry exclusion, and package build output. Packable Roslyn components automatically pack the built analyzer assembly (and its PDB) into `analyzers/dotnet/cs/`. Roslyn development dependencies (`Microsoft.CodeAnalysis.*`, `Microsoft.CodeAnalysis.Analyzers`) default to `PrivateAssets="all"`. |
| `PackProjectReferencedSourceGenerators` | `true` | Automatically packs analyzer `ProjectReference` outputs and their runtime dependencies under `analyzers/dotnet/cs/`. Set to `false` to opt out; set `Pack="false"` on an individual reference to exclude only that generator. |
| `SourceLinkPackageName` | `Microsoft.SourceLink.GitHub` | SourceLink provider. Set to `Microsoft.SourceLink.AzureDevOps.Git` for ADO repos. |
| `DisableSourceLink` | `false` | Set to `true` to stop the SDK from adding the configured SourceLink package automatically. |
Expand All @@ -243,8 +243,8 @@ For projects where `IsPackable=true`, the SDK provides these defaults **only whe
| Property | Default | Description |
| -- | -- | -- |
| `GenerateDocumentationFile` | `true` | Emits XML documentation. |
| `IncludeSymbols` | `true` | Produces a symbol package. |
| `SymbolPackageFormat` | `snupkg` | Symbol package format (`symbols.nupkg` for Roslyn components). |
| `IncludeSymbols` | `true` | Produces a symbol package (`false` for Roslyn components — their PDB ships in `analyzers/dotnet/cs/` instead). |
| `SymbolPackageFormat` | `snupkg` | Symbol package format. Always the modern `.snupkg`; the legacy `.symbols.nupkg` is never produced by default. |
| `PublishRepositoryUrl` | `true` | Publishes the repository URL. |
| `EmbedUntrackedSources` | `true` | Embeds untracked sources for SourceLink. |
| `DebugType` | `portable` | Ensures portable PDBs for symbol-package delivery. |
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"name": "changeops",
"version": "1.0.0-prerelease.44",
"devDependencies": {
"@changesets/cli": "^2.31.0"
}
"version": "1.0.0-prerelease.45"
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ These are the most important configurable properties exposed by the SDK:
- `NamespacePrefix` — required unless `DisableNamespacePrefixCheck=true`
- `DisableNamespacePrefixCheck` — default `false`
- `TargetFramework` — defaults to `net10.0` when neither `TargetFramework` nor `TargetFrameworks` is set; projects explicitly declaring `IsRoslynComponent=true` default to `netstandard2.0`
- `IsRoslynComponent` — when explicitly `true`, applies source-generator defaults: a single `netstandard2.0` target, extended analyzer rules, disabled SourceLink and untracked-source embedding, no dependency file, compiler-generated output under the framework-specific intermediate directory, `symbols.nupkg`, `PackSourceGeneratorSymbols`, telemetry exclusion, and excluded normal build output
- `IsRoslynComponent` — when explicitly `true`, applies source-generator defaults: a single `netstandard2.0` target, `LangVersion=latest`, `Nullable=enable`, `TreatWarningsAsErrors=true`, extended analyzer rules, disabled SourceLink and untracked-source embedding, no dependency file, compiler-generated output under the framework-specific intermediate directory, telemetry exclusion, excluded normal build output, `IncludeSymbols=false` (no `.symbols.nupkg`/`.snupkg` by default — the PDB ships in `analyzers/dotnet/cs/`), and `PrivateAssets=all` applied to `Microsoft.CodeAnalysis.*` / `Microsoft.CodeAnalysis.Analyzers` references. Packable Roslyn components automatically pack the built analyzer assembly and PDB into `analyzers/dotnet/cs/`
- `PackProjectReferencedSourceGenerators` — default `true`; packable projects automatically include analyzer `ProjectReference` outputs and runtime dependencies under `analyzers/dotnet/cs/`. Set it to `false` globally or use `Pack="false"` on one analyzer reference to opt out.
- `EnableAssemblyNameGeneration` — default `true`; when `true`, `AssemblyName` and default `PackageId` follow the fully evaluated `RootNamespace`. Set `false` before the SDK import to use the standard project-name behaviour
- `DisableProjectFileNamingConventionCheck` — default `false`; disables the directory-name/file-name match validation
Expand All @@ -60,7 +60,7 @@ These are the most important configurable properties exposed by the SDK:
- `ExcludeMSTelemetryExtension` — default `false`; removes `Microsoft.Extensions.Telemetry.Abstractions`, only relevant if `ExcludePurviewTelemetry` is also `true`
- `IsPackable` — defaults to `false` if not set elsewhere
- `PackageTags`, `IncludeSource`, `IncludeSymbols`, `PublishRepositoryUrl`, `SymbolPackageFormat` — standard pack-related settings the SDK participates in for packable projects
- Packable-project defaults (only applied when the consuming project has not supplied a value): `GenerateDocumentationFile=true`, `IncludeSymbols=true`, `SymbolPackageFormat=snupkg`, `PublishRepositoryUrl=true`, `EmbedUntrackedSources=true`, `DebugType=portable`. Portable PDBs are delivered through the `.snupkg`; the normal `.nupkg` does not receive PDB files unless the project opts in explicitly
- Packable-project defaults (only applied when the consuming project has not supplied a value): `GenerateDocumentationFile=true`, `IncludeSymbols=true`, `SymbolPackageFormat=snupkg`, `PublishRepositoryUrl=true`, `EmbedUntrackedSources=true`, `DebugType=portable`. Portable PDBs are delivered through the `.snupkg`; the normal `.nupkg` does not receive PDB files unless the project opts in explicitly. Roslyn components default `IncludeSymbols=false` and ship their PDB inside `analyzers/dotnet/cs/` instead
- If the repo root is discoverable, the repository-root `README.md` is packed automatically (and registered via `PackageReadmeFile`) when the file exists and `PackageReadmeFile` was not configured explicitly

## Test framework settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ This is why consistent naming and placement matter so much in repos that use the
- Packs the repository-root `README.md` (registered via `PackageReadmeFile`) when the file exists and `PackageReadmeFile` is unset; skips when a README is already being packed
- Non-packable projects (including web apps) default `WarnOnPackingNonPackableProject=false` so solution-wide pack operations skip them silently

### For Roslyn component (analyzer/source-generator) projects

- Defaults a single `netstandard2.0` target, `LangVersion=latest`, `Nullable=enable`, `TreatWarningsAsErrors=true`, extended analyzer rules, disabled SourceLink, and excluded normal build output (`IncludeBuildOutput=false`)
- Defaults `IncludeSymbols=false` — no `.symbols.nupkg` or `.snupkg` is produced by default; the analyzer PDB ships inside the main `.nupkg` under `analyzers/dotnet/cs/` beside the analyzer assembly
- Packable Roslyn components automatically pack the built analyzer assembly (and PDB) into `analyzers/dotnet/cs/`; `SymbolPackageFormat` defaults to the modern `snupkg` if symbols are explicitly opted into
- `Microsoft.CodeAnalysis.*` and `Microsoft.CodeAnalysis.Analyzers` references are defaulted to `PrivateAssets=all` (development-only dependencies) so they never leak into the packed nuspec

### For test and shared-testing projects

- Applies test-friendly `NoWarn` defaults
Expand Down
17 changes: 11 additions & 6 deletions src/src/DotNetProjectSdk/Sdk/Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,19 @@
<TargetFramework Condition="'$(_PurviewProjectDeclaresTargetFramework)' != 'true'"
>netstandard2.0</TargetFramework>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<!-- Roslyn best-practice compiler defaults. Project body values are evaluated later and win. -->
<LangVersion Condition="'$(LangVersion)' == '' OR '$(LangVersion)' == 'preview'">latest</LangVersion>
<Nullable Condition="'$(Nullable)' == ''">enable</Nullable>
<TreatWarningsAsErrors Condition="'$(TreatWarningsAsErrors)' == ''">true</TreatWarningsAsErrors>
<!-- Analyzer-only packages have no lib/ folder; suppress NU5128 so TreatWarningsAsErrors
does not fail the pack. No symbol package is produced by default (the PDB ships in
analyzers/dotnet/cs beside the analyzer assembly), and any explicit opt-in uses the
modern snupkg format rather than the legacy symbols.nupkg. -->
<IncludeSymbols Condition="'$(IncludeSymbols)' == '' OR '$(IncludeSymbols)' == 'true'">false</IncludeSymbols>
<NoWarn>$(NoWarn);NU5128;</NoWarn>
<DisableSourceLink>true</DisableSourceLink>
<EmbedUntrackedSources>false</EmbedUntrackedSources>
<GenerateDependencyFile>false</GenerateDependencyFile>
<SymbolPackageFormat>symbols.nupkg</SymbolPackageFormat>
<TargetsForTfmSpecificDebugSymbolsInPackage
Condition="!$([System.String]::Copy(';$(TargetsForTfmSpecificDebugSymbolsInPackage);').Contains(';PackSourceGeneratorSymbols;'))"
>$(TargetsForTfmSpecificDebugSymbolsInPackage);PackSourceGeneratorSymbols</TargetsForTfmSpecificDebugSymbolsInPackage>
<ExcludePurviewTelemetry>true</ExcludePurviewTelemetry>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>
Expand Down Expand Up @@ -615,8 +621,7 @@
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>
<PublishRepositoryUrl Condition="'$(PublishRepositoryUrl)' == ''">true</PublishRepositoryUrl>
<EmbedUntrackedSources Condition="'$(EmbedUntrackedSources)' == ''">true</EmbedUntrackedSources>
<SymbolPackageFormat Condition="'$(IsRoslynComponent)' != 'true' AND '$(SymbolPackageFormat)' == ''"
>snupkg</SymbolPackageFormat>
<SymbolPackageFormat Condition="'$(SymbolPackageFormat)' == ''">snupkg</SymbolPackageFormat>
<DebugType Condition="'$(DebugType)' == ''">portable</DebugType>
</PropertyGroup>

Expand Down
49 changes: 49 additions & 0 deletions src/src/DotNetProjectSdk/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,55 @@
>$(IntermediateOutputPath)generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

<!-- =====================================================================
PACKABLE ROSLYN COMPONENT ANALYZER ASSET
Packs the built analyzer/generator assembly (and its PDB) into
analyzers/dotnet/cs so consumers receive it as a Roslyn analyzer rather
than a lib/ asset. IncludeBuildOutput=false keeps lib/ empty. Gated on
single-targeting because TargetPath is a single-TFM path; the SDK clears
TargetFrameworks for Roslyn components by default, and a project that
explicitly multi-targets opts out of this convenience.
===================================================================== -->
<ItemGroup
Label="Packable Roslyn Component Analyzer Asset"
Condition="'$(IsCSharpProject)' == 'true' AND '$(IsRoslynComponent)' == 'true' AND '$(IsPackable)' == 'true' AND '$(TargetFrameworks)' == ''"
>
<None Include="$(TargetPath)" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None
Include="$(TargetDir)$(TargetName).pdb"
Pack="true"
PackagePath="analyzers/dotnet/cs"
Visible="false"
Condition="'$(DebugType)' != 'embedded' AND '$(DebugType)' != 'none'"
/>
</ItemGroup>

<!-- =====================================================================
ROSLYN DEV DEPENDENCY DEFAULTS
Roslyn packages (Microsoft.CodeAnalysis.*, Microsoft.CodeAnalysis.Analyzers)
are development-only dependencies of analyzer/generator projects. When a
Roslyn component references them, default PrivateAssets=all (and the
analyzer IncludeAssets for Microsoft.CodeAnalysis.Analyzers) so they never
leak into the packed nuspec as package dependencies. Update-only: existing
references are amended; nothing is added, and explicit metadata is preserved.
===================================================================== -->
<ItemGroup
Label="Roslyn Dev Dependency Defaults"
Condition="'$(IsCSharpProject)' == 'true' AND '$(IsRoslynComponent)' == 'true'"
>
<PackageReference Update="Microsoft.CodeAnalysis.CSharp">
<PrivateAssets Condition="'%(PackageReference.PrivateAssets)' == ''">all</PrivateAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces">
<PrivateAssets Condition="'%(PackageReference.PrivateAssets)' == ''">all</PrivateAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers">
<PrivateAssets Condition="'%(PackageReference.PrivateAssets)' == ''">all</PrivateAssets>
<IncludeAssets Condition="'%(PackageReference.IncludeAssets)' == ''"
>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target
Name="CreateRoslynComponentGeneratedFilesDirectory"
BeforeTargets="CoreCompile"
Expand Down
Loading
Loading