Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,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
Comment thread
paulmedynski marked this conversation as resolved.

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
Expand Down
204 changes: 176 additions & 28 deletions build.proj

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only build.proj has a default target. Build doesn't exist here anyway, so this was just cruft.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--
"ReferenceType" property supports below options:
Expand Down Expand Up @@ -35,7 +35,11 @@
<!-- Versioning ====================================================== -->
<!--
Versions for packages are assigned in the project's Versions.props file. Below, we provide
defaults for components of versions that are shared across all projects
defaults for components of versions that are shared across all projects.

Directory.Build.props evaluates before Directory.Packages.props, so defining these here
ensures FileVersionBuildNumber is set before any Versions.props runs (including those
imported by Directory.Packages.props in Package mode).
-->
<PropertyGroup>
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
Condition="'$(IsCrossTargetingBuild)' != 'true' AND '$(GenerateDocumentationFile)' == 'true'">

<PropertyGroup>
<PowerShellCommand Condition="'$(OS)' == 'Windows_NT'">powershell.exe</PowerShellCommand>
<PowerShellCommand Condition="'$(OS)' != 'Windows_NT'">pwsh</PowerShellCommand>
<PowerShellCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">powershell.exe</PowerShellCommand>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BuildAll sets $(OS) to whatever it wants, regardless of the actual host OS. This will be clobbered by @mdaigle 's pwsh tool changes anyway, so it's a temp fix.

<PowerShellCommand Condition="!$([MSBuild]::IsOSPlatform('Windows'))">pwsh</PowerShellCommand>
<PowerShellCommand>
$(PowerShellCommand)
-NonInteractive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections;
using System.Collections.Generic;

#nullable enable

namespace Microsoft.Data.SqlClient.Tests.Common
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// 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.using System;
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using Azure.Core;
using Azure.Security.KeyVault.Keys;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;

namespace Microsoft.Data.SqlClient.Tests.Common.Fixtures;

Expand Down Expand Up @@ -110,7 +107,7 @@ protected X509Certificate2 CreateCertificate(string subjectName, IEnumerable<str
ephemeral.Export(X509ContentType.Pkcs12, password),
password,
keyStorageFlags,
new Pkcs12LoaderLimits(Pkcs12LoaderLimits.Defaults)
new Pkcs12LoaderLimits(Pkcs12LoaderLimits.Defaults)
{
PreserveStorageProvider = true,
PreserveKeyName = true
Expand Down Expand Up @@ -211,7 +208,7 @@ exit 1
for (int attempt = 1; attempt <= retries; ++attempt)
{
using Process psProcess = new() { StartInfo = startInfo };

psProcess.Start();
commandOutput = psProcess.StandardOutput.ReadToEnd();

Expand All @@ -227,15 +224,15 @@ exit 1
{
return new X509Certificate2(Convert.FromBase64String(commandOutput), password, X509KeyStorageFlags.Exportable);
}

Console.WriteLine(
$"PowerShell command failed with exit code {code} on " +
$"attempt {attempt} of {retries}; " +
$"retrying in {delay} seconds...");

Thread.Sleep(TimeSpan.FromSeconds(delay));
}

throw new Exception(
"PowerShell command raised exception: " +
$"{commandOutput}; command was: {formattedCommand}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Security.Cryptography.X509Certificates;

namespace Microsoft.Data.SqlClient.Tests.Common.Fixtures;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Text;
using System.Threading;

namespace Microsoft.Data.SqlClient.Tests.Common.Fixtures.DatabaseObjects;

Expand Down Expand Up @@ -170,7 +168,7 @@ public static string GenerateLongName(string prefix, bool escape = true)
///
/// The GUID parts will be the characters from the 1st and 4th blocks
/// from a traditional string representation, as shown here:
///
///
/// <code>
/// 7ff01cb8-88c7-11f0-b433-00155d7e531e
/// ^^^^^^^^ ^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Reflection;
using System.Threading;

namespace Microsoft.Data.SqlClient.Tests.Common;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<PropertyGroup>
<AssemblyName>Microsoft.Data.SqlClient.TestCommon</AssemblyName>
<RootNamespace>Microsoft.Data.SqlClient.TestCommon</RootNamespace>

<ImplicitUsings>enable</ImplicitUsings>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduces 'using' noise.

<Nullable>enable</Nullable>

<!--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="Latest">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToolsVersion is an obsolete attribute we don't need any more.

<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects.">
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
<Name Resource="MinimumRecommendedRules_Name" />
<Description Resource="MinimumRecommendedRules_Description" />
Expand Down Expand Up @@ -71,4 +71,4 @@
<Rules AnalyzerId="xunit.analyzers" RuleNamespace="xunit.analyzers">
<Rule Id="xUnit1024" Action="Info" />
</Rules>
</RuleSet>
</RuleSet>
2 changes: 1 addition & 1 deletion tools/props/AssemblyInfo.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Description>Microsoft.Data.SqlClient</Description>
<Authors>Microsoft</Authors>
Expand Down
2 changes: 1 addition & 1 deletion tools/props/AssemblyRef.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MicrosoftVSDesigner>"Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"</MicrosoftVSDesigner>
<SystemDrawing>"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"</SystemDrawing>
Expand Down
2 changes: 1 addition & 1 deletion tools/targets/RepositoryInfo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ file to you under the MIT license. -->
$(_TranslateUrlPattern), $(_TranslateUrlReplacement)))</ScmRepositoryUrl>
</SourceRoot>
</ItemGroup>
<Message Text="Final Translated ScmRepositoryUrl to $(ScmRepositoryUrl)" Importance="high" />
<Message Text="Final Translated ScmRepositoryUrl to $(ScmRepositoryUrl)" />
</Target>
</Project>
Loading