diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 0c78f461cb..51ce83bb10 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -150,6 +150,14 @@ When a new issue is created, follow these steps: - Do not modify `CHANGELOG.md` unless executing a release workflow (see `release-notes` prompt). - Do not close issues without a fix or without providing a clear reason. +## Terminal Execution Safety +- Treat any non-zero shell exit code as a failed step that requires correction before proceeding. +- If a bash process exits, do not wait for more output from that process; rerun the command in a fresh terminal session. +- Validate that expected command output was produced before using it as evidence for conclusions. +- When terminal execution fails, surface the failure immediately and retry with a corrected command. +- Avoid `set -e` in this automation workflow; use focused commands and verify each result explicitly so shell exits are observable and attributable. +- Prefer short, single-purpose terminal commands over long chained scripts when debugging or gathering state. + ## 📝 Notes - Update policies and guidelines in the `policy/` directory as needed based on trending practices and team feedback. - Regularly review and update the `doc/` directory to ensure it reflects the current state of the project. diff --git a/AGENTS.md b/AGENTS.md index 690e9c9c8d..42f3a39399 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -54,6 +54,17 @@ This repository provides reusable prompts in `.github/prompts/` for common maint 6. **Performance Optimization**: Use pooling, async, efficient allocations 7. **Observability**: EventSource tracing, meaningful errors +## Terminal Reliability Rules + +When using shell/terminal tools, follow these rules strictly: + +1. Treat non-zero terminal exit codes as immediate failures to investigate; do not continue as if the command succeeded. +2. If a bash session exits, assume it is dead and start a new command/session; do not wait for additional output from that session. +3. After any command expected to gather data, verify output was actually returned before proceeding. +4. If command execution failed, report the failure clearly and retry with a corrected command instead of waiting. +5. Avoid `set -e` in this automation context; prefer single-purpose commands with explicit follow-up checks so failures are visible without killing the shell unexpectedly. +6. Prefer shorter command batches over long chained scripts when collecting evidence; this makes bash exits easier to detect and recover from. + ## Branch Naming All branches created by AI agents **must** live under the `dev/automation/` prefix. Use a descriptive suffix, for example: diff --git a/BUILDGUIDE.md b/BUILDGUIDE.md index 715923d1b3..16aa709fe5 100644 --- a/BUILDGUIDE.md +++ b/BUILDGUIDE.md @@ -20,9 +20,8 @@ on operating systems that do not support .NET Framework. As such, it is not nece no action is required. On Linux and macOS systems, the `pwsh` command is required to be in the `$PATH` environment variable. For specific instructions see: [Install PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell) -The **NuGet** binary is required to package the Microsoft.Data.SqlClient project. For convenience, this can be done -via the PowerShell script [tools/scripts/downloadLatestNuget.ps1](tools/scripts/downloadLatestNuget.ps1), however, any -`nuget.exe` binary can be used. +The **NuGet** binary is optional for inspection and feed-management workflows, but build and packaging flows in this +repository are run through `dotnet build` against `build.proj`. ## Developer Workflow @@ -34,21 +33,16 @@ package the project. The `build.proj` file provides convenient targets to accomp > may be noticed, possibly severe. All official build and test infrastructure uses the `build.proj` entrypoint, and it > is recommended that `build.proj` is used for local development, as well. -> [!TIP] -> `build.proj` was written with the intention of being called from `msbuild`. As such, the examples below -> use `msbuild`. On systems where `msbuild` is not available, simply replace `msbuild` with `dotnet msbuild` to get the -> same behavior. - > [!TIP] > This section is not exhaustive of all targets or parameters to `build.proj`. Complete documentation is available in > [`build.proj`](build.proj). ### Building Projects -From the root of your repository, run `msbuild` against `build.proj` with a build target, following this pattern: +From the root of your repository, run `dotnet build` against `build.proj` with a build target, following this pattern: ```bash -msbuild build.proj -t: [optional_parameters] +dotnet build build.proj -t: [optional_parameters] ``` The following build targets can be used to build the following projects. All targets will implicitly build any other @@ -86,18 +80,21 @@ placed in `artifacts/Microsoft.Data.SqlClient.ref/Project-/` #### Examples Build all projects: + ```bash -msbuild build.proj -t:Build +dotnet build build.proj -t:Build ``` Build Microsoft.Data.SqlClient in Release configuration: + ```bash -msbuild build.proj -t:BuildSqlClient -p:Configuration=Release +dotnet build build.proj -t:BuildSqlClient -p:Configuration=Release ``` Build v1.2.3 of Microsoft.Data.SqlClient.Extensions.Abstractions: + ```bash -msbuild build.proj -t:BuildAbstractions -p:PackageVersionAbstractions=1.2.3 +dotnet build build.proj -t:BuildAbstractions -p:PackageVersionAbstractions=1.2.3 ``` ### Testing Projects @@ -105,10 +102,10 @@ msbuild build.proj -t:BuildAbstractions -p:PackageVersionAbstractions=1.2.3 This section provides a summary and brief example of how to execute tests for projects in this repository. **For more information about test procedures, including config file setup, see [TESTGUIDE.md](TESTGUIDE.md).** -From the root of your repository, run `msbuild` against `build.proj` with a test target, following this pattern: +From the root of your repository, run `dotnet build` against `build.proj` with a test target, following this pattern: ```bash -msbuild build.proj -t: [optional_parameters] +dotnet build build.proj -t: [optional_parameters] ``` | `` | Description | @@ -140,37 +137,37 @@ A selection of parameters for test targets in `build.proj` relevant to common de Run Microsoft.Data.SqlClient unit tests: ```bash -msbuild build.proj -t:TestSqlClientUnit +dotnet build build.proj -t:TestSqlClientUnit ``` Run Microsoft.Data.SqlClient manual test set 2: ```bash -msbuild build.proj -t:TestSqlClientManual -p:TestSet=2 +dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2 ``` Run Microsoft.Data.SqlClient functional tests against x86 dotnet: ```bash -msbuild build.proj -t:TestSqlClientFunctional -p:DotnetPath='C:\path\to\dotnet\x86\' +dotnet build build.proj -t:TestSqlClientFunctional -p:DotnetPath='C:\path\to\dotnet\x86\' ``` Run all Microsoft.Data.SqlClient.Extensions.Azure unit tests, including interactive, but excluding failing tests: ```bash -msbuild build.proj -t:TestAzure -p:TestFilters=category!=failing +dotnet build build.proj -t:TestAzure -p:TestFilters=category!=failing ``` Run Microsoft.Data.SqlClient functional tests against net8.0 runtime: ```bash -msbuild build.proj -t:TestSqlClientFunctional -p:TestFramework=net8.0 +dotnet build build.proj -t:TestSqlClientFunctional -p:TestFramework=net8.0 ``` ### Packaging Projects Just like building and testing the various projects in this repository, packaging the projects into NuGet packages is -also handled by `build.proj`. From the root of your repository, run `msbuild` against `build.proj` with a pack target, +also handled by `build.proj`. From the root of your repository, run `dotnet build` against `build.proj` with a pack target, following this pattern: ```bash -msbuild build.proj -t: [optional_parameters] +dotnet build build.proj -t: [optional_parameters] ``` | `` | Description | @@ -191,30 +188,36 @@ A selection of parameters for pack targets in `build.proj` relevant to common de | `[optional_parameter]` | Default Value | Allowed Values | Description | |------------------------------------|---------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | `-p:Configuration=` | `Debug` | `Debug`, `Release` | Build configuration. Only applies if project and dependencies are being built. | -| `-p:NugetPath=` | `[blank]` | eg. `C:\my\nuget.exe` | _Only applies to `PackSqlClient`._ Path to `nuget.exe` to use. If not provided, defaults to `nuget.exe` in the PATH. | | `-p:PackBuild=` | `true` | `true`, `false` | Whether or not to build the project before packing. If `false`, project must be built using the same parameters. | | `-p:PackageVersion=` | `[blank]` | eg. `1.2.3-dev123` | Version to assign to the package, where `` can be one of: `['Abstractions', 'Azure', 'AkvProvider', 'Logging', 'SqlClient', 'SqlServer']`. If `PackBuild` is `true`, the assembly and file versions will be derived from this version. See Versioning for more details. | +For `PackSqlClient`, these additional parameters are optional overrides for dependency versions injected into the SqlClient nuspec during pack: + +- `-p:PackageVersionAbstractions=` +- `-p:PackageVersionLogging=` + +If omitted, `PackSqlClient` computes `AbstractionsPackageVersion` and `LoggingPackageVersion` from sibling projects using the current `BuildNumber` and `BuildSuffix` context. + #### Examples Package Microsoft.Data.SqlClient.Internal.Logging into a NuGet package: ```bash -msbuild build.proj -t:PackLogging +dotnet build build.proj -t:PackLogging ``` -Package Microsoft.Data.SqlClient if `nuget.exe` is not in the `$PATH` environment variable: +Package Microsoft.Data.SqlClient: ```bash -msbuild build.proj -t:PackSqlClient -p:NugetPath="C:\my\nuget.exe" +dotnet build build.proj -t:PackSqlClient ``` Package version 1.2.3 of Microsoft.Data.SqlClient.Extensions.Abstractions: ```bash -msbuild build.proj -t:PackAbstractions -p:PackageVersionAbstractions=1.2.3 +dotnet build build.proj -t:PackAbstractions -p:PackageVersionAbstractions=1.2.3 ``` Package Microsoft.Data.SqlClient.Extensions.Azure without building it beforehand: ```bash -msbuild build.proj -t:PackAzure -p:PackBuild=false +dotnet build build.proj -t:PackAzure -p:PackBuild=false ``` ## Versioning @@ -276,20 +279,20 @@ and Microsoft.Data.SqlClient.Internal.Logging v2.2.2. ```bash # Build v2.2.2 of Logging and copy to packages -msbuild build.proj -t:PackLogging \ +dotnet build build.proj -t:PackLogging \ -p:ReferenceType=Package \ -p:PackageVersionLogging=2.2.2 cp artifacts/Microsoft.Data.SqlClient.Internal.Logging/Debug/*.*pkg packages/ # Build v1.0.1 of Abstractions that depends on v2.2.2 of Logging -msbuild build.proj -t:PackAbstractions \ +dotnet build build.proj -t:PackAbstractions \ -p:ReferenceType=Package \ -p:PackageVersionAbstractions=1.0.1 \ -p:PackageVersionLogging=2.2.2 \ cp artifacts/Microsoft.Data.SqlClient.Extensions.Abstractions/Package-Debug/*.*pkg packages/ # Build SqlClient -msbuild -t:PackSqlClient \ +dotnet build build.proj -t:PackSqlClient \ -p:ReferenceType=Package \ -p:PackageVersionSqlClient=7.1.1 \ -p:PackageVersionAbstractions=1.0.1 \ @@ -299,7 +302,7 @@ cp artifacts/Microsoft.Data.SqlClient/Package-Debug/*.*pkg packages/ Run Microsoft.Data.SqlClient functional tests against the versions built above: ```bash -msbuild build.proj -t:TestSqlClientFunctional \ +dotnet build build.proj -t:TestSqlClientFunctional \ -p:ReferenceType=Package \ -p:PackageVersionSqlClient=7.1.1 \ -p:PackageVersionAbstractions=1.0.1 \ diff --git a/TESTGUIDE.md b/TESTGUIDE.md index fdcb8749ec..349674deee 100644 --- a/TESTGUIDE.md +++ b/TESTGUIDE.md @@ -23,13 +23,7 @@ These projects target `net8.0`, `net9.0`, and `net10.0` on all platforms. On Win Use [build.proj](build.proj) from the repository root: ```bash -msbuild build.proj -t: [optional_parameters] -``` - -If `msbuild` is not available, use `dotnet msbuild`: - -```bash -dotnet msbuild build.proj -t: [optional_parameters] +dotnet build build.proj -t: [optional_parameters] ``` Test targets build the projects they depend on, so a separate build step is not required for normal test runs. @@ -51,55 +45,55 @@ Test targets build the projects they depend on, so a separate build step is not Run the SqlClient unit tests: ```bash -msbuild build.proj -t:TestSqlClientUnit +dotnet build build.proj -t:TestSqlClientUnit ``` Run the SqlClient functional tests: ```bash -msbuild build.proj -t:TestSqlClientFunctional +dotnet build build.proj -t:TestSqlClientFunctional ``` Run the SqlClient manual tests: ```bash -msbuild build.proj -t:TestSqlClientManual +dotnet build build.proj -t:TestSqlClientManual ``` Run only manual test set 2: ```bash -msbuild build.proj -t:TestSqlClientManual -p:TestSet=2 +dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2 ``` Run manual test sets 1 and 3: ```bash -msbuild build.proj -t:TestSqlClientManual -p:TestSet=13 +dotnet build build.proj -t:TestSqlClientManual -p:TestSet=13 ``` Run Always Encrypted manual tests: ```bash -msbuild build.proj -t:TestSqlClientManual -p:TestSet=AE +dotnet build build.proj -t:TestSqlClientManual -p:TestSet=AE ``` Run a specific target framework: ```bash -msbuild build.proj -t:TestSqlClientFunctional -p:TestFramework=net8.0 +dotnet build build.proj -t:TestSqlClientFunctional -p:TestFramework=net8.0 ``` Run functional tests against an x86 `dotnet` installation: ```bash -msbuild build.proj -t:TestSqlClientFunctional -p:DotnetPath='C:\path\to\dotnet\x86\' +dotnet build build.proj -t:TestSqlClientFunctional -p:DotnetPath='C:\path\to\dotnet\x86\' ``` Run all Azure extension tests, including `interactive` tests, while still excluding tests marked `failing` or `flaky`: ```bash -msbuild build.proj -t:TestAzure -p:TestFilters=category!=failing +dotnet build build.proj -t:TestAzure -p:TestFilters=category!=failing ``` ## Test Parameters @@ -132,13 +126,13 @@ Examples: ```bash # Run a single test by fully-qualified name. -msbuild build.proj -t:TestSqlClientUnit -p:TestFilters=FullyQualifiedName=Namespace.ClassName.MethodName +dotnet build build.proj -t:TestSqlClientUnit -p:TestFilters=FullyQualifiedName=Namespace.ClassName.MethodName # Run only flaky tests while investigating quarantine failures. -msbuild build.proj -t:TestSqlClientManual -p:TestFilters=category=flaky +dotnet build build.proj -t:TestSqlClientManual -p:TestFilters=category=flaky # Disable the default filter. -msbuild build.proj -t:TestSqlClientFunctional -p:TestFilters=none +dotnet build build.proj -t:TestSqlClientFunctional -p:TestFilters=none ``` When passing filter expressions that contain shell-sensitive characters such as `&`, quote or escape the value as @@ -222,14 +216,14 @@ For SQL Server in a Linux container, WSL, or another host where SQL authenticati You can override the config file path with the `MDS_TEST_CONFIG` environment variable: ```bash -MDS_TEST_CONFIG=/path/to/config.json msbuild build.proj -t:TestSqlClientManual -p:TestSet=2 +MDS_TEST_CONFIG=/path/to/config.json dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2 ``` On PowerShell: ```powershell $env:MDS_TEST_CONFIG = "C:\path\to\config.json" -msbuild build.proj -t:TestSqlClientManual -p:TestSet=2 +dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2 ``` ## Configuration Properties @@ -289,23 +283,23 @@ If `TestSet` is omitted, all sets are compiled and run. You can combine sets by Test results are written to `test_results` by default. Override the location with `TestResultsFolderPath`: ```bash -msbuild build.proj -t:TestSqlClientUnit -p:TestResultsFolderPath=/tmp/sqlclient-test-results +dotnet build build.proj -t:TestSqlClientUnit -p:TestResultsFolderPath=/tmp/sqlclient-test-results ``` Hang blame collection is enabled by default with a `10m` timeout. To increase the timeout: ```bash -msbuild build.proj -t:TestSqlClientManual -p:TestBlameTimeout=30m +dotnet build build.proj -t:TestSqlClientManual -p:TestBlameTimeout=30m ``` To disable hang blame collection: ```bash -msbuild build.proj -t:TestSqlClientManual -p:TestBlameTimeout=0 +dotnet build build.proj -t:TestSqlClientManual -p:TestBlameTimeout=0 ``` Code coverage is enabled by default. To disable it for a faster local run: ```bash -msbuild build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=false +dotnet build build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=false ``` diff --git a/build.proj b/build.proj index a0ef562934..14db6015ba 100644 --- a/build.proj +++ b/build.proj @@ -69,16 +69,6 @@ --> - - nuget - - BuildSqlClient - $(RepoRoot)tools/specs/Microsoft.Data.SqlClient.nuspec $(RepoRoot)tools/GenAPI/Microsoft.DotNet.GenAPI/ $(GenApiPath)Microsoft.DotNet.GenAPI.csproj @@ -531,107 +513,47 @@ - - - - git rev-parse HEAD - - - $([System.Text.RegularExpressions.Regex]::Replace($(GitCommand), "\s+", " ")) - - - - - + + BuildSqlClient + - + + - - "$(DotnetPath)dotnet" msbuild "$(SqlClientProjectPath)" - -nologo - -verbosity:quiet - -getProperty:SqlClientPackageVersion + + "$(DotnetPath)dotnet" pack "$(SqlClientProjectPath)" + -p:Configuration=$(Configuration) + $(PackBuildArgument) + $(SigningKeyPathArgument) $(BuildNumberArgument) $(BuildSuffixArgument) $(PackageVersionSqlClientArgument) - - - $([System.Text.RegularExpressions.Regex]::Replace($(GetSqlClientPackageVersionCommand), "\s+", " ")) - - - - - - - - - - - "$(DotnetPath)dotnet" msbuild "$(AbstractionsProjectPath)" - -nologo - -verbosity:quiet - -getProperty:AbstractionsPackageVersion - $(BuildNumberArgument) - $(BuildSuffixArgument) - - $([System.Text.RegularExpressions.Regex]::Replace($(GetAbstractionsPackageVersionCommand), "\s+", " ")) - - - - - - - - - - - "$(DotnetPath)dotnet" msbuild "$(LoggingProjectPath)" - -nologo - -verbosity:quiet - -getProperty:LoggingPackageVersion - $(BuildNumberArgument) - $(BuildSuffixArgument) - - $([System.Text.RegularExpressions.Regex]::Replace($(GetLoggingPackageVersionCommand), "\s+", " ")) - - - - - - - - <_EvaluatedSqlClientPackageVersion>$([System.Text.RegularExpressions.Regex]::Replace($(_EvaluatedSqlClientPackageVersion), "\s", "")) - $([System.Text.RegularExpressions.Regex]::Replace($(PackageVersionAbstractions), "\s", "")) - $([System.Text.RegularExpressions.Regex]::Replace($(PackageVersionLogging), "\s", "")) - $([System.Text.RegularExpressions.Regex]::Replace($(CommitId), "\s", "")) - - "$(NugetPath)" pack "$(SqlClientNuspecPath)" - -Symbols - -SymbolPackageFormat snupkg - -Version "$(_EvaluatedSqlClientPackageVersion)" - -OutputDirectory "$(SqlClientArtifactRoot)/$(ReferenceType)-$(Configuration)" - -properties "COMMITID=$(CommitId);Configuration=$(Configuration);ReferenceType=$(ReferenceType);AbstractionsPackageVersion=$(PackageVersionAbstractions);LoggingPackageVersion=$(PackageVersionLogging)" - + + $(ReferenceTypeArgument) + $(PackageVersionAbstractionsArgument) + $(PackageVersionLoggingArgument) + + + -p:PackageOutputPath="$(SqlClientArtifactRoot)/$(ReferenceType)-$(Configuration)" + - $([System.Text.RegularExpressions.Regex]::Replace($(NuGetCommand), "\s+", " ")) + $([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " ")) - - + + diff --git a/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml b/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml index afb20ac80e..31bf8be63b 100644 --- a/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml +++ b/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml @@ -143,16 +143,29 @@ jobs: abstractionsPackageVersion: ${{parameters.abstractionsPackageVersion}} loggingPackageVersion: ${{ parameters.loggingPackageVersion }} - - template: /eng/pipelines/common/templates/steps/generate-nuget-package-step.yml@self - parameters: - buildConfiguration: ${{ parameters.buildConfiguration }} - displayName: 'Create MDS NuGet Package' - generateSymbolsPackage: true - nuspecPath: 'tools/specs/Microsoft.Data.SqlClient.nuspec' - outputDirectory: $(packagePath) - packageVersion: ${{ parameters.mdsPackageVersion }} - properties: 'AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }};LoggingPackageVersion=${{ parameters.loggingPackageVersion }}' - referenceType: ${{ parameters.referenceType }} + - task: DotNetCoreCLI@2 + displayName: 'Create MDS NuGet Package' + inputs: + command: build + projects: build.proj + arguments: >- + -t:PackSqlClient + -p:PackBuild=false + -p:Configuration=${{ parameters.buildConfiguration }} + -p:ReferenceType=${{ parameters.referenceType }} + -p:PackageVersionSqlClient=${{ parameters.mdsPackageVersion }} + -p:PackageVersionAbstractions=${{ parameters.abstractionsPackageVersion }} + -p:PackageVersionLogging=${{ parameters.loggingPackageVersion }} + + # PackSqlClient outputs to artifacts/Microsoft.Data.SqlClient/-/. + # Downstream steps (local feed copy, AKV pack, artifact publish) all expect packages at + # $(packagePath), so copy them there. + - task: CopyFiles@2 + displayName: Copy MDS Package to Output Directory + inputs: + sourceFolder: $(Build.SourcesDirectory)/artifacts/Microsoft.Data.SqlClient/${{ parameters.referenceType }}-${{ parameters.buildConfiguration }} + contents: 'Microsoft.Data.SqlClient.*' + targetFolder: $(packagePath) # When building in Package mode, the AKV Provider restore needs to find the MDS package # we just built. Copy it to the local NuGet feed so NuGet.config can resolve it. diff --git a/eng/pipelines/common/templates/steps/generate-nuget-package-step.yml b/eng/pipelines/common/templates/steps/generate-nuget-package-step.yml deleted file mode 100644 index 46c5c61492..0000000000 --- a/eng/pipelines/common/templates/steps/generate-nuget-package-step.yml +++ /dev/null @@ -1,80 +0,0 @@ -################################################################################# -# Licensed to the .NET Foundation under one or more agreements. # -# The .NET Foundation licenses this file to you under the MIT license. # -# See the LICENSE file in the project root for more information. # -################################################################################# -parameters: - - name: nuspecPath - type: string - - - name: packageVersion - type: string - - - name: outputDirectory - type: string - default: '$(Build.SourcesDirectory)/output' - - # The C# build configuration (e.g. Debug or Release) to use when building the NuGet package. - - name: buildConfiguration - type: string - default: Debug - values: - - Debug - - Release - - - name: generateSymbolsPackage - type: boolean - - - name: displayName - type: string - - - name: installNuget - type: boolean - default: true - - # The C# project reference type to use when building and packing the packages. - - name: referenceType - type: string - values: - # Reference sibling packages as NuGet packages. - - Package - # Reference sibling packages as C# projects. - - Project - - # Semi-colon separated properties to pass to nuget pack via the -properties argument. - - name: properties - type: string - default: '' - -steps: -- ${{ if parameters.installNuget }}: - - task: NuGetToolInstaller@1 - displayName: 'Install Latest Nuget' - inputs: - checkLatest: true - -- powershell: | - $Commit=git rev-parse HEAD - Write-Host "##vso[task.setvariable variable=CommitHead;]$Commit" - displayName: CommitHead - -- task: NuGetCommand@2 - displayName: ${{parameters.displayName }} - inputs: - command: custom - ${{ if parameters.generateSymbolsPackage }}: - arguments: >- - pack - -Symbols - -SymbolPackageFormat snupkg - ${{parameters.nuspecPath}} - -Version ${{parameters.packageVersion}} - -OutputDirectory ${{parameters.outputDirectory}} - -properties "COMMITID=$(CommitHead);Configuration=${{parameters.buildConfiguration}};ReferenceType=${{parameters.referenceType}};${{parameters.properties}}" - ${{else }}: - arguments: >- - pack - ${{parameters.nuspecPath}} - -Version ${{parameters.packageVersion}} - -OutputDirectory ${{parameters.outputDirectory}} - -properties "COMMITID=$(CommitHead);Configuration=${{parameters.buildConfiguration}};ReferenceType=${{parameters.referenceType}};${{parameters.properties}}" diff --git a/release-notes/template/release-notes-template.md b/release-notes/template/release-notes-template.md index 4e3ebcb0c0..9df5a11e7f 100644 --- a/release-notes/template/release-notes-template.md +++ b/release-notes/template/release-notes-template.md @@ -87,7 +87,7 @@ We thank the following public contributors. Their efforts toward this project ar ### Dependencies -(Use the dependencies listed in the package's NuGet spec under tools/specs/ or the project file.) +(Use the dependencies listed in the package's NuGet spec beside the SqlClient project file, or in the project file.) #### [Target Framework Version] diff --git a/src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Versions.props b/src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Versions.props index 25e3ff90ff..31f85b7da4 100644 --- a/src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Versions.props +++ b/src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Versions.props @@ -66,9 +66,7 @@ want a quick build without supplying any parameters. --> - dev - - $(AkvProviderVersionDefault)-$(BuildSuffix) + $(AkvProviderVersionDefault)-dev $(AkvProviderVersionDefault.Split('-')[0]).$(FileVersionBuildNumber) diff --git a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props index 32330ad3a6..14daeda570 100644 --- a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props +++ b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props @@ -67,9 +67,7 @@ want a quick build without supplying any parameters. --> - dev - - $(AbstractionsVersionDefault)-$(BuildSuffix) + $(AbstractionsVersionDefault)-dev $(AbstractionsVersionDefault.Split('-')[0]).$(FileVersionBuildNumber) diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/src/Versions.props b/src/Microsoft.Data.SqlClient.Extensions/Azure/src/Versions.props index 1876c965eb..3c4bb9dfac 100644 --- a/src/Microsoft.Data.SqlClient.Extensions/Azure/src/Versions.props +++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/src/Versions.props @@ -66,9 +66,7 @@ want a quick build without supplying any parameters. --> - dev - - $(AzureVersionDefault)-$(BuildSuffix) + $(AzureVersionDefault)-dev $(AzureVersionDefault.Split('-')[0]).$(FileVersionBuildNumber) diff --git a/src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props b/src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props index 3278bdc2e9..eeb25b93ca 100644 --- a/src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props +++ b/src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props @@ -67,9 +67,7 @@ want a quick build without supplying any parameters. --> - dev - - $(LoggingVersionDefault)-$(BuildSuffix) + $(LoggingVersionDefault)-dev $(LoggingVersionDefault.Split('-')[0]).$(FileVersionBuildNumber) diff --git a/src/Microsoft.Data.SqlClient/Versions.props b/src/Microsoft.Data.SqlClient/Versions.props index 5ec3b8b9ac..2a915285b0 100644 --- a/src/Microsoft.Data.SqlClient/Versions.props +++ b/src/Microsoft.Data.SqlClient/Versions.props @@ -66,9 +66,7 @@ want a quick build without supplying any parameters. --> - dev - - $(SqlClientVersionDefault)-$(BuildSuffix) + $(SqlClientVersionDefault)-dev $(SqlClientVersionDefault.Split('-')[0]).$(FileVersionBuildNumber) diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj index cffc9fe96f..edb31ba0b3 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj @@ -76,6 +76,126 @@ $(ArtifactPath)$(AssemblyName)/$(ReferenceType)-$(Configuration)/$(NormalizedTargetOs)/ + + + + + $(MSBuildProjectDirectory)/Microsoft.Data.SqlClient.nuspec + $(BaseIntermediateOutputPath)Microsoft.Data.SqlClient.pack.nuspec + + $(RepoRoot)/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj + $(RepoRoot)/src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj + $(RepoRoot)/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props + $(RepoRoot)/src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props + + + + + $(SqlClientPackNuspecTemplatePath) + + + $(RepoRoot)artifacts + + + Version=$(Version);Configuration=$(Configuration);ReferenceType=$(ReferenceType) + + + true + + + snupkg + + + true + + + + + + + + + + + + + $(SourceRevisionId) + $(NuspecProperties);COMMITID=$(CommitId) + <_AbstractionsPackageVersionTrimmed>$([System.String]::Copy('$(AbstractionsPackageVersion)').Trim()) + <_LoggingPackageVersionTrimmed>$([System.String]::Copy('$(LoggingPackageVersion)').Trim()) + + + + + + + + <_SqlClientPackNuspecExpandedText>$([System.IO.File]::ReadAllText('$(SqlClientPackNuspecTemplatePath)').Replace('$AbstractionsPackageVersion$','$(AbstractionsPackageVersion)').Replace('$LoggingPackageVersion$','$(LoggingPackageVersion)')) + + + + + + $(SqlClientPackNuspecGeneratedPath) + + + @@ -115,7 +235,7 @@ - @@ -123,7 +243,7 @@ - diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.nuspec b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.nuspec new file mode 100644 index 0000000000..8f04553f94 --- /dev/null +++ b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.nuspec @@ -0,0 +1,238 @@ + + + + Microsoft.Data.SqlClient + $Version$ + Microsoft.Data.SqlClient + Microsoft + true + MIT + https://aka.ms/sqlclientproject + dotnet.png + README.md + + The current data provider for SQL Server and Azure SQL databases. This has replaced System.Data.SqlClient. These classes provide access to SQL and encapsulate database-specific protocols, including tabular data stream (TDS). + + Commonly Used Types: + Microsoft.Data.SqlClient.SqlConnection + Microsoft.Data.SqlClient.SqlException + Microsoft.Data.SqlClient.SqlParameter + Microsoft.Data.SqlClient.SqlDataReader + Microsoft.Data.SqlClient.SqlCommand + Microsoft.Data.SqlClient.SqlTransaction + Microsoft.Data.SqlClient.SqlParameterCollection + Microsoft.Data.SqlClient.SqlClientFactory + + When using NuGet 3.x this package requires at least version 3.4. + https://go.microsoft.com/fwlink/?linkid=2090501 + © Microsoft Corporation. All rights reserved. + sqlclient microsoft.data.sqlclient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.SqlServer.Server/Versions.props b/src/Microsoft.SqlServer.Server/Versions.props index ec959cafbf..0a342f9426 100644 --- a/src/Microsoft.SqlServer.Server/Versions.props +++ b/src/Microsoft.SqlServer.Server/Versions.props @@ -67,9 +67,7 @@ want a quick build without supplying any parameters. --> - dev - - $(SqlServerVersionDefault)-$(BuildSuffix) + $(SqlServerVersionDefault)-dev $(SqlServerVersionDefault.Split('-')[0]).$(FileVersionBuildNumber) diff --git a/tools/scripts/downloadLatestNuget.ps1 b/tools/scripts/downloadLatestNuget.ps1 deleted file mode 100644 index faddf3bb09..0000000000 --- a/tools/scripts/downloadLatestNuget.ps1 +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. -# Script: downloadLatestNuget.ps1 -# Author: Keerat Singh -# Date: 07-Dec-2018 -# Comments: This script downloads the latest NuGet Binary. -# -param( - [string]$nugetDestPath, - [string]$nugetSrcPath="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -) -Function DownloadLatestNuget() -{ - if(!$nugetDestPath) - { - $nugetDestPath = (Get-location).ToString() +'\.nuget\' - } - if (!(Test-Path $nugetDestPath)) - { - New-Item -ItemType Directory -Path $nugetDestPath - } - Write-Output "Source: $nugetSrcPath" - Write-Output "Destination: $nugetDestPath" - Start-BitsTransfer -Source $nugetSrcPath -Destination $nugetDestPath\nuget.exe -} -DownloadLatestNuget \ No newline at end of file diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec deleted file mode 100644 index 75aa9e786d..0000000000 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ /dev/null @@ -1,234 +0,0 @@ - - - - Microsoft.Data.SqlClient - 1.0.0 - Microsoft.Data.SqlClient - Microsoft - true - MIT - https://aka.ms/sqlclientproject - dotnet.png - README.md - - The current data provider for SQL Server and Azure SQL databases. This has replaced System.Data.SqlClient. These classes provide access to SQL and encapsulate database-specific protocols, including tabular data stream (TDS). - - Commonly Used Types: - Microsoft.Data.SqlClient.SqlConnection - Microsoft.Data.SqlClient.SqlException - Microsoft.Data.SqlClient.SqlParameter - Microsoft.Data.SqlClient.SqlDataReader - Microsoft.Data.SqlClient.SqlCommand - Microsoft.Data.SqlClient.SqlTransaction - Microsoft.Data.SqlClient.SqlParameterCollection - Microsoft.Data.SqlClient.SqlClientFactory - - When using NuGet 3.x this package requires at least version 3.4. - https://go.microsoft.com/fwlink/?linkid=2090501 - © Microsoft Corporation. All rights reserved. - sqlclient microsoft.data.sqlclient - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -