Skip to content

Commit 55b9555

Browse files
committed
A root Directory.Build.props now carries the shared properties every project repeated with IsPackable defaulting false so the one publishing project opts in explicitly, NuGet central package management moves all versions into Directory.Packages.props with Tests.Smo's SqlClient 5.1.6 pin kept as a visible VersionOverride documenting the deliberate per-oracle split from the 7.x wire oracle, csprojs shrink to genuinely per-project content, the analyzer project explicitly disables the newly inherited ImplicitUsings its explicit-using sources would trip IDE0005 on, and Example rises to the same warnings-as-errors style bar as everything else.
1 parent d43c0d0 commit 55b9555

13 files changed

Lines changed: 103 additions & 149 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Auto-loaded orientation. `README.md` is for humans.
88

99
`SqlServerSimulator.EFCore` is a sibling package whose only public method is `UseSqlServerSimulator(DbContextOptionsBuilder, DbConnection)`. EF Core's SqlServer provider keeps emitting SQL-Server-flavored SQL; the adapter registers an `IRelationalTypeMappingSourcePlugin` for the (CLR, store) pairs whose default mappings downcast to `SqlParameter` (the simulator's connection isn't a `SqlConnection`).
1010

11-
**Packaging:** only `SqlServerSimulator` publishes; `SqlServerSimulator.EFCore` and `Example` are `IsPackable=false` the adapter stays in-repo-but-unpublished as a deliberate demand signal, so don't pitch publishing it without a user request.
11+
**Packaging:** only `SqlServerSimulator` publishes — the root `Directory.Build.props` defaults every project to `IsPackable=false` and the package project alone opts back in. The adapter stays in-repo-but-unpublished as a deliberate demand signal, so don't pitch publishing it without a user request.
1212

1313
## Operating goal
1414

@@ -31,7 +31,7 @@ dotnet build
3131
dotnet test
3232
```
3333

34-
Every `.csproj` sets `EnforceCodeStyleInBuild=true`, so `dotnet build` runs the IDE / SSS / MSTEST analyzers and fails on violations. No separate `dotnet format` pass — it catches nothing build doesn't. CI matrix: Debug + Release. `obj/` permission errors mean building outside the dev container; `rm -rf obj/ bin/` clears them.
34+
Shared build settings live in the root `Directory.Build.props` (TargetFramework, nullable, warnings-as-errors, `EnforceCodeStyleInBuild=true`so `dotnet build` runs the IDE / SSS / MSTEST analyzers and fails on violations); package versions are centralized in `Directory.Packages.props` (NuGet CPM), with deliberate per-project divergences as visible `VersionOverride`s (Tests.Smo pins SqlClient 5.1.x, SMO's supported line, while Tests.SqlClient tests the current 7.x — the reason those two projects stay separate). Csprojs carry only per-project content. No separate `dotnet format` pass — it catches nothing build doesn't. CI matrix: Debug + Release. `obj/` permission errors mean building outside the dev container; `rm -rf obj/ bin/` clears them.
3535

3636
A full build + test cycle runs 20–30s; single-test filter (`--filter "FullyQualifiedName~Foo"`) stays fast. Still cheap enough to treat `dotnet test` as a verifier between micro-edits, not a checkpoint.
3737

Directory.Build.props

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project>
2+
3+
<!-- Shared defaults for every project in the repo. A project overrides by
4+
setting the property in its own csproj (imported after this file) —
5+
e.g. the analyzer targets netstandard2.0 and the main package opts back
6+
into IsPackable. Package versions are centralized separately in
7+
Directory.Packages.props. -->
8+
<PropertyGroup>
9+
<TargetFramework>net10.0</TargetFramework>
10+
<Nullable>enable</Nullable>
11+
<ImplicitUsings>enable</ImplicitUsings>
12+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
13+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
14+
<DebugType>embedded</DebugType>
15+
<DebugSymbols>true</DebugSymbols>
16+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
17+
<!-- Only SqlServerSimulator publishes; everything else opts out here and
18+
the package project sets true. -->
19+
<IsPackable>false</IsPackable>
20+
</PropertyGroup>
21+
22+
<ItemGroup>
23+
<None Include="$(MSBuildThisFileDirectory).editorconfig" Link=".editorconfig" />
24+
</ItemGroup>
25+
26+
</Project>

Directory.Packages.props

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
9+
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
10+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
11+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.MSTest" Version="1.1.2" />
12+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0" />
13+
<!-- The SqlClient-under-test version for the wire oracle. Tests.Smo
14+
overrides to SMO's supported range via VersionOverride — a deliberate
15+
per-oracle divergence, not drift. -->
16+
<PackageVersion Include="Microsoft.Data.SqlClient" Version="7.0.2" />
17+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="10.0.2" />
18+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.2" />
19+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
20+
<PackageVersion Include="Microsoft.SqlServer.SqlManagementObjects" Version="172.76.0" />
21+
<PackageVersion Include="Microsoft.SqlServer.Types" Version="160.1000.6" />
22+
<PackageVersion Include="MSTest.TestAdapter" Version="4.1.0" />
23+
<PackageVersion Include="MSTest.TestFramework" Version="4.1.0" />
24+
</ItemGroup>
25+
26+
</Project>

Example/Example.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net10.0</TargetFramework>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
<DebugType>embedded</DebugType>
9-
<!-- Demonstration project; not a shippable package. -->
10-
<IsPackable>false</IsPackable>
115
</PropertyGroup>
126

137
<ItemGroup>
14-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.2" />
8+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
159
</ItemGroup>
1610

1711
<ItemGroup>
Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8-
<IsPackable>false</IsPackable>
9-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
104
<NoWarn>1591;NU1701</NoWarn>
115
<RootNamespace>SqlServerSimulator.Analyzers</RootNamespace>
12-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
136
</PropertyGroup>
147

158
<ItemGroup>
16-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
17-
<PackageReference Include="MSTest.TestAdapter" Version="4.1.0" />
18-
<PackageReference Include="MSTest.TestFramework" Version="4.1.0" />
19-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
20-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0" />
21-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.MSTest" Version="1.1.2" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
10+
<PackageReference Include="MSTest.TestAdapter" />
11+
<PackageReference Include="MSTest.TestFramework" />
12+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
13+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
14+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.MSTest" />
2215
</ItemGroup>
2316

2417
<ItemGroup>
2518
<ProjectReference Include="..\SqlServerSimulator.Analyzers\SqlServerSimulator.Analyzers.csproj" />
2619
</ItemGroup>
2720

28-
<ItemGroup>
29-
<None Include="..\.editorconfig" Link=".editorconfig" />
30-
</ItemGroup>
31-
3221
</Project>
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<!-- Roslyn analyzers must target netstandard2.0; LangVersion lifts the
5+
default C# 7.3 that comes with it. ImplicitUsings stays off — the
6+
sources carry explicit usings, and the SDK's implicit set would turn
7+
them into IDE0005 build errors. -->
48
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Nullable>enable</Nullable>
69
<LangVersion>latest</LangVersion>
7-
<IsPackable>false</IsPackable>
10+
<ImplicitUsings>disable</ImplicitUsings>
811
<IsRoslynComponent>true</IsRoslynComponent>
912
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
10-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
11-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1213
<!-- RS2008 demands AnalyzerReleases.{Shipped,Unshipped}.md files for analyzer NuGet packages. We're an in-repo analyzer, never published; release tracking would be ceremony for nobody. -->
1314
<NoWarn>RS2008</NoWarn>
14-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1515
<AnalysisMode>All</AnalysisMode>
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
20-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
21-
</ItemGroup>
22-
23-
<ItemGroup>
24-
<None Include="..\.editorconfig" Link=".editorconfig" />
19+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
20+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
2521
</ItemGroup>
2622

2723
</Project>

SqlServerSimulator.EFCore/SqlServerSimulator.EFCore.csproj

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,21 @@
1414
<RepositoryType>git</RepositoryType>
1515
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1616
<EmbedUntrackedSources>true</EmbedUntrackedSources>
17-
<TargetFramework>net10.0</TargetFramework>
18-
<Nullable>enable</Nullable>
19-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
20-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
21-
<DebugType>embedded</DebugType>
22-
<DebugSymbols>true</DebugSymbols>
23-
<ImplicitUsings>enable</ImplicitUsings>
2417
<IsTrimmable>true</IsTrimmable>
2518
<AnalysisMode>All</AnalysisMode>
26-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
2719
<RootNamespace>SqlServerSimulator.EFCore</RootNamespace>
2820
<PackageReadmeFile>README.md</PackageReadmeFile>
2921
<!-- The simulator package ships on its own; the EF Core adapter is not
30-
published separately. Excluded from `dotnet pack` output. -->
31-
<IsPackable>false</IsPackable>
22+
published separately (IsPackable false via Directory.Build.props). -->
3223
</PropertyGroup>
3324

3425
<ItemGroup>
35-
<None Include="../.editorconfig" Link=".editorconfig" />
3626
<None Include="../LICENSE.txt" Pack="true" PackagePath="/" />
3727
<None Include="README.md" Pack="true" PackagePath="/" />
3828
</ItemGroup>
3929

4030
<ItemGroup>
41-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.2" />
31+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
4232
</ItemGroup>
4333

4434
<ItemGroup>
Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
7-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8-
<DebugType>embedded</DebugType>
9-
<DebugSymbols>true</DebugSymbols>
104
<NoWarn>1591;NU1901;NU1902;NU1903</NoWarn>
11-
<IsPackable>false</IsPackable>
125
<RootNamespace>SqlServerSimulator</RootNamespace>
13-
<ImplicitUsings>enable</ImplicitUsings>
14-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
156
</PropertyGroup>
167

178
<ItemGroup>
189
<Compile Include="..\SqlServerSimulator.Tests\Extensions.cs" Link="Extensions.cs" />
1910
</ItemGroup>
2011

2112
<ItemGroup>
22-
<PackageReference Include="coverlet.collector" Version="10.0.1">
13+
<PackageReference Include="coverlet.collector">
2314
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2415
<PrivateAssets>all</PrivateAssets>
2516
</PackageReference>
26-
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="10.0.2" />
27-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.2" />
28-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
29-
<PackageReference Include="MSTest.TestAdapter" Version="4.1.0" />
30-
<PackageReference Include="MSTest.TestFramework" Version="4.1.0" />
17+
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" />
18+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
20+
<PackageReference Include="MSTest.TestAdapter" />
21+
<PackageReference Include="MSTest.TestFramework" />
3122
</ItemGroup>
3223

3324
<ItemGroup>
3425
<ProjectReference Include="..\SqlServerSimulator\SqlServerSimulator.csproj" />
3526
<ProjectReference Include="..\SqlServerSimulator.EFCore\SqlServerSimulator.EFCore.csproj" />
3627
</ItemGroup>
37-
38-
<ItemGroup>
39-
<None Include="..\.editorconfig" Link=".editorconfig" />
40-
</ItemGroup>
4128

4229
</Project>
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
7-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8-
<DebugType>embedded</DebugType>
9-
<DebugSymbols>true</DebugSymbols>
104
<NoWarn>1591</NoWarn>
11-
<IsPackable>false</IsPackable>
125
<RootNamespace>SqlServerSimulator</RootNamespace>
13-
<ImplicitUsings>enable</ImplicitUsings>
14-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
156
</PropertyGroup>
167

178
<ItemGroup>
18-
<PackageReference Include="coverlet.collector" Version="10.0.1">
9+
<PackageReference Include="coverlet.collector">
1910
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2011
<PrivateAssets>all</PrivateAssets>
2112
</PackageReference>
22-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
23-
<PackageReference Include="MSTest.TestAdapter" Version="4.1.0" />
24-
<PackageReference Include="MSTest.TestFramework" Version="4.1.0" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
14+
<PackageReference Include="MSTest.TestAdapter" />
15+
<PackageReference Include="MSTest.TestFramework" />
2516
</ItemGroup>
2617

2718
<ItemGroup>
2819
<ProjectReference Include="..\SqlServerSimulator\SqlServerSimulator.csproj" />
2920
</ItemGroup>
3021

31-
<ItemGroup>
32-
<None Include="..\.editorconfig" Link=".editorconfig" />
33-
</ItemGroup>
34-
3522
</Project>
Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,28 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
7-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8-
<DebugType>embedded</DebugType>
9-
<DebugSymbols>true</DebugSymbols>
104
<NoWarn>1591</NoWarn>
11-
<IsPackable>false</IsPackable>
125
<RootNamespace>SqlServerSimulator</RootNamespace>
13-
<ImplicitUsings>enable</ImplicitUsings>
14-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
156
</PropertyGroup>
167

178
<ItemGroup>
18-
<PackageReference Include="coverlet.collector" Version="10.0.1">
9+
<PackageReference Include="coverlet.collector">
1910
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2011
<PrivateAssets>all</PrivateAssets>
2112
</PackageReference>
22-
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.6" />
23-
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="172.76.0" />
24-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
25-
<PackageReference Include="MSTest.TestAdapter" Version="4.1.0" />
26-
<PackageReference Include="MSTest.TestFramework" Version="4.1.0" />
13+
<!-- SMO 172.x supports the SqlClient 5.1.x line, not the 7.x the wire
14+
oracle (Tests.SqlClient) uses from Directory.Packages.props. The
15+
split is deliberate per-oracle pinning, and the reason this project
16+
stays separate from Tests.SqlClient. -->
17+
<PackageReference Include="Microsoft.Data.SqlClient" VersionOverride="5.1.6" />
18+
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
20+
<PackageReference Include="MSTest.TestAdapter" />
21+
<PackageReference Include="MSTest.TestFramework" />
2722
</ItemGroup>
2823

2924
<ItemGroup>
3025
<ProjectReference Include="..\SqlServerSimulator\SqlServerSimulator.csproj" />
3126
</ItemGroup>
3227

33-
<ItemGroup>
34-
<None Include="..\.editorconfig" Link=".editorconfig" />
35-
</ItemGroup>
36-
3728
</Project>

0 commit comments

Comments
 (0)