diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 45890dfdf4..dc237459ee 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -99,7 +99,7 @@ jobs: - name: Run manual build steps if: matrix.build-mode == 'manual' shell: bash - run: dotnet build src/Microsoft.Data.SqlClient.slnx + run: dotnet build build.proj -t:BuildAll - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 diff --git a/BUILDGUIDE.md b/BUILDGUIDE.md index 073f6afc68..b4a486acb4 100644 --- a/BUILDGUIDE.md +++ b/BUILDGUIDE.md @@ -72,19 +72,23 @@ it from the `dotnet build` command. The following build targets can be used to build the following projects. All targets will implicitly build any other projects they depend on. -| `` | Description | -|-----------------------------|---------------------------------------------------------------------------------| -| `Build` | Builds all projects for all platforms | -| `BuildAbstractions` | Builds Microsoft.Data.SqlClient.Extensions.Abstractions | -| `BuildAkvProvider` | Builds Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider | -| `BuildAzure` | Builds Microsoft.Data.SqlClient.Extensions.Azure | -| `BuildLogging` | Builds Microsoft.Data.SqlClient.Internal.Logging | -| `BuildSqlClient` | Builds all variants of Microsoft.Data.SqlClient, for all platforms | -| `BuildSqlClientRef` | Builds the reference assemblies for Microsoft.Data.SqlClient | -| `BuildSqlClientUnsupported` | Builds the "unsupported platform" assemblies for Microsoft.Data.SqlClient | -| `BuildSqlClientUnix` | Builds the Unix-specific implementation binaries of Microsoft.Data.SqlClient | -| `BuildSqlClientWindows` | Builds the Windows-specific implementation binaries of Microsoft.Data.SqlClient | -| `BuildSqlServer` | Builds Microsoft.SqlServer.Server | +| `` | Description | +|-------------------------------|---------------------------------------------------------------------------------| +| `Build` | Builds all driver projects for all platforms | +| `BuildAbstractions` | Builds Microsoft.Data.SqlClient.Extensions.Abstractions | +| `BuildAkvProvider` | Builds Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider | +| `BuildAll` | Builds all projects, tests, and samples for all supported OS combinations | +| `BuildAzure` | Builds Microsoft.Data.SqlClient.Extensions.Azure | +| `BuildLogging` | Builds Microsoft.Data.SqlClient.Internal.Logging | +| `BuildSamples` | Builds the sample projects under `doc/samples/` | +| `BuildSqlClient` | Builds all variants of Microsoft.Data.SqlClient, for all platforms | +| `BuildSqlClientNotSupported` | Builds the "unsupported platform" assemblies for Microsoft.Data.SqlClient | +| `BuildSqlClientRef` | Builds the reference assemblies for Microsoft.Data.SqlClient | +| `BuildSqlClientUnix` | Builds the Unix-specific implementation binaries of Microsoft.Data.SqlClient | +| `BuildSqlClientWindows` | Builds the Windows-specific implementation binaries of Microsoft.Data.SqlClient | +| `BuildSqlServer` | Builds Microsoft.SqlServer.Server | +| `BuildTests` | Builds all test projects for all supported OS combinations | +| `Clean` | Removes build and test output directories | A selection of parameters for build targets in `build.proj` can be found below: @@ -139,6 +143,7 @@ dotnet build -t: [optional_parameters] | `` | Description | |----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| | `Test` | Runs all tests in the repository for all platforms supported by the host OS. _This will take a considerable amount of time and is not recommended_. | +| `TestAbstractions` | Runs all tests for Microsoft.Data.SqlClient.Extensions.Abstractions | | `TestAzure` | Runs all tests for Microsoft.Data.SqlClient.Extensions.Azure | | `TestSqlClient` | Runs all tests for Microsoft.Data.SqlClient. | | `TestSqlClientFunctional` | Runs the "functional" test project for Microsoft.Data.SqlClient. These are a mix of unit and integration tests against live servers. | diff --git a/build.proj b/build.proj index 4ff29a08df..8335526024 100644 --- a/build.proj +++ b/build.proj @@ -1,6 +1,5 @@ - - + @@ -246,7 +245,7 @@ + + + @@ -383,16 +385,18 @@ @@ -441,7 +445,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -471,7 +476,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -500,7 +506,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -531,7 +538,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -561,7 +569,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -607,7 +616,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -653,7 +663,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -698,7 +709,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -726,7 +738,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -765,7 +778,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -794,7 +808,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -843,7 +858,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -869,7 +885,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -908,7 +925,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -945,7 +963,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -971,7 +990,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -1013,7 +1033,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -1042,7 +1063,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -1064,7 +1086,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -1104,7 +1127,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -1126,7 +1150,8 @@ $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - + + @@ -1140,4 +1165,304 @@ DestinationFolder="$(PackagesDir)" SkipUnchangedFiles="true" /> + + + + + + $(SqlClientSrcRoot)tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj + $(SqlClientSrcRoot)tests/StressTests/SqlClient.Stress.Runner/SqlClient.Stress.Runner.csproj + $(RepoRoot)doc/samples/Microsoft.Data.SqlClient.Samples.csproj + + + + + + + + + + "$(DotnetPath)dotnet" build "$(AbstractionsTestProjectPath)" + -p:Configuration=$(Configuration) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientUnitTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Unix + + + $(ReferenceTypeArgument) + $(TestSigningKeyPathArgument) + $(PackageVersionSqlClientArgument) + $(PackageVersionSqlServerArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientUnitTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Windows_NT + + + $(ReferenceTypeArgument) + $(TestSigningKeyPathArgument) + $(PackageVersionSqlClientArgument) + $(PackageVersionSqlServerArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientFunctionalTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Unix + + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + $(PackageVersionSqlClientArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientFunctionalTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Windows_NT + + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + $(PackageVersionSqlClientArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientManualTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Unix + + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + $(PackageVersionSqlClientArgument) + $(PackageVersionSqlServerArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientManualTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Windows_NT + + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + $(PackageVersionSqlClientArgument) + $(PackageVersionSqlServerArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientPerformanceTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Unix + + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + $(PackageVersionSqlClientArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientPerformanceTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Windows_NT + + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + $(PackageVersionSqlClientArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientStressTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Unix + + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + $(PackageVersionSqlClientArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SqlClientStressTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Windows_NT + + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + $(PackageVersionSqlClientArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + + + + "$(DotnetPath)dotnet" build "$(AzureTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Unix + + + $(ReferenceTypeArgument) + $(PackageVersionSqlClientArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + "$(DotnetPath)dotnet" build "$(AzureTestProjectPath)" + -p:Configuration=$(Configuration) + -p:TargetOs=Windows_NT + + + $(ReferenceTypeArgument) + $(PackageVersionSqlClientArgument) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + + + + + + + + + "$(DotnetPath)dotnet" build "$(SamplesProjectPath)" + -p:Configuration=$(Configuration) + + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) + + + + + + diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj index 1c020c2ae4..5d6780414b 100644 --- a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj +++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj @@ -12,11 +12,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj b/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj index 67c5250748..de44a0c64b 100644 --- a/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj +++ b/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj @@ -25,11 +25,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj b/src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj index bdbdeafe53..ca037a50bf 100644 --- a/src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj +++ b/src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj @@ -8,11 +8,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj index 13673697db..e1df71835f 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj @@ -10,11 +10,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj index ce159f7821..6a4beed2dc 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj @@ -10,11 +10,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/StressTests/Directory.Build.props b/src/Microsoft.Data.SqlClient/tests/StressTests/Directory.Build.props index 910f8d53a0..93c1f10d93 100644 --- a/src/Microsoft.Data.SqlClient/tests/StressTests/Directory.Build.props +++ b/src/Microsoft.Data.SqlClient/tests/StressTests/Directory.Build.props @@ -13,8 +13,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/TestUdts/Circle/Circle.csproj b/src/Microsoft.Data.SqlClient/tests/TestUdts/Circle/Circle.csproj index db53171c6e..e19c8b40a5 100644 --- a/src/Microsoft.Data.SqlClient/tests/TestUdts/Circle/Circle.csproj +++ b/src/Microsoft.Data.SqlClient/tests/TestUdts/Circle/Circle.csproj @@ -8,11 +8,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/TestUdts/Shapes/Shapes.csproj b/src/Microsoft.Data.SqlClient/tests/TestUdts/Shapes/Shapes.csproj index e115355bfe..d8c2d66253 100644 --- a/src/Microsoft.Data.SqlClient/tests/TestUdts/Shapes/Shapes.csproj +++ b/src/Microsoft.Data.SqlClient/tests/TestUdts/Shapes/Shapes.csproj @@ -8,11 +8,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/TestUdts/Utf8String/Utf8String.csproj b/src/Microsoft.Data.SqlClient/tests/TestUdts/Utf8String/Utf8String.csproj index 02e0193f82..cc41b9fb47 100644 --- a/src/Microsoft.Data.SqlClient/tests/TestUdts/Utf8String/Utf8String.csproj +++ b/src/Microsoft.Data.SqlClient/tests/TestUdts/Utf8String/Utf8String.csproj @@ -8,11 +8,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 diff --git a/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj b/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj index e09e49c967..7356c28f77 100644 --- a/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj @@ -11,11 +11,11 @@ net8.0;net9.0;net10.0 - - $(TargetFrameworks);net462 + + $(OS) + + + $(TargetFrameworks);net462 @@ -61,8 +61,8 @@ as explained above. --> - <_SqlClientRid Condition="'$(OS)' != 'Windows_NT'">unix - <_SqlClientRid Condition="'$(OS)' == 'Windows_NT'">win + <_SqlClientRid Condition="'$(TargetOs)' != 'Windows_NT'">unix + <_SqlClientRid Condition="'$(TargetOs)' == 'Windows_NT'">win <_SqlClientPackageTfm Condition="'$(TargetFramework)' == 'net8.0'">net8.0 <_SqlClientPackageTfm Condition="'$(TargetFramework)' == 'net462'">net462 diff --git a/src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj b/src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj index c9dce97ddb..aaede5846b 100644 --- a/src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj +++ b/src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj @@ -3,6 +3,7 @@ Microsoft.SqlServer.TDS.EndPoint Microsoft.SqlServer.TDS.EndPoint netstandard2.0 + $(OS) @@ -48,13 +49,13 @@ - + - +