-
Notifications
You must be signed in to change notification settings - Fork 318
Merge Project | Build the Common Project #3837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
871859c
Add reference to MSS for netcore to fix InvalidUdtException reference…
benrr101 8250468
SqlDependencyUtils.* are all netcore files, rename as such, and wrap …
benrr101 d253767
Set build output path
benrr101 477219d
Add OS-specific check for target frameworks
benrr101 70fa18f
Builds! Whoohooo!
benrr101 61978e1
Common project build targets
benrr101 946f41b
Add common project back to the solution build targets
benrr101 2e92020
Comments from PR
benrr101 8d4ca14
Rework package references as per comments, add normalized target os v…
benrr101 4c25b0f
Merge branch 'dev/russellben/build-common-project' of github.com:dotn…
benrr101 2a0ff49
Add message on exec
benrr101 ca43c20
Add strong name signing and triple check package references
benrr101 392702b
Unconditional assembly originator key file, clarify command
benrr101 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- Build Parameters ============================================== --> | ||
| <PropertyGroup> | ||
| <!-- Configuration: Which build configuration to build --> | ||
| <!-- Allowed values: Debug, Release --> | ||
| <!-- Default value: Debug --> | ||
| <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> | ||
|
|
||
| <!-- DotnetPath: Path to folder containing the `dotnet` binary. Override this if a --> | ||
| <!-- specific version (eg, x86) is required. Otherwise, this defaults to using the --> | ||
| <!-- dotnet binary in the PATH variable. The provided path should end with a `\` (or --> | ||
| <!-- `/`) character. Eg. C:\x86\ --> | ||
| <DotnetPath Condition="'$(DotnetPath)' == ''"></DotnetPath> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Imports ======================================================= --> | ||
| <Import Project="src/Directory.Build.props" /> | ||
|
|
||
| <!-- Microsoft.Data.SqlClient Build Targets ======================== --> | ||
| <PropertyGroup> | ||
| <MdsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj</MdsProjectPath> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- BuildMds: Builds all binaries for MDS --> | ||
| <Target Name="BuildMds" DependsOnTargets="BuildMdsUnix;BuildMdsWindows" /> | ||
|
|
||
| <!-- BuildMdsUnix: Builds all unix-specific MDS binaries --> | ||
| <Target Name="BuildMdsUnix"> | ||
| <PropertyGroup> | ||
| <DotnetCommand> | ||
| $(DotnetPath)dotnet build $(MdsProjectPath) | ||
| -p:Configuration=$(Configuration) | ||
| -p:TargetOs=Unix | ||
| </DotnetCommand> | ||
| <!-- Convert more than one whitespace character into one space --> | ||
| <DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand> | ||
| </PropertyGroup> | ||
| <Message Text=">>> Building MDS for Unix via command: $(DotnetCommand)"/> | ||
| <Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" /> | ||
| </Target> | ||
|
|
||
| <!-- BuildMdsWindows: Builds all windows-specific MDS binaries --> | ||
| <Target Name="BuildMdsWindows"> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <PropertyGroup> | ||
| <DotnetCommand> | ||
| $(DotnetPath)dotnet build $(MdsProjectPath) | ||
| -p:Configuration=$(Configuration) | ||
| -p:TargetOs=Windows_NT | ||
| </DotnetCommand> | ||
| <!-- Convert more than one whitespace character into one space --> | ||
| <DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </PropertyGroup> | ||
| <Message Text=">>> Building MDS for Windows via command: $(DotnetCommand)"/> | ||
| <Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" /> | ||
| </Target> | ||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 75 additions & 22 deletions
97
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,55 +1,108 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net462;net8.0;net9.0</TargetFrameworks> | ||
| <!-- General Properties ============================================== --> | ||
| <PropertyGroup> | ||
| <Configurations>Debug;Release;</Configurations> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <RootNamespace /> | ||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
| <RootNamespace /> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Strong name signing ============================================= --> | ||
| <PropertyGroup> | ||
| <AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(CDP_BUILD_TYPE)' == 'Official'"> | ||
| <SignAssembly>true</SignAssembly> | ||
| <KeyFile>$(SigningKeyPath)</KeyFile> | ||
| </PropertyGroup> | ||
|
|
||
|
|
||
| <!-- OS Constants ==================================================== --> | ||
| <PropertyGroup> | ||
| <!-- @TODO: Move to directory.build.props? --> | ||
| <!-- If a target OS was not specified, use the current OS as the target OS. --> | ||
| <TargetOs Condition="'$(TargetOs)' == ''">$(OS)</TargetOs> | ||
paulmedynski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <!-- Uncomment the following line to override the OS you are developing for --> | ||
| <!--<TargetOs>Unix</TargetOs>--> | ||
| <!--<TargetOs>Windows_NT</TargetOs>--> | ||
|
|
||
| <NormalizedTargetOs>$(TargetOs.ToLower())</NormalizedTargetOs> | ||
|
|
||
| <!-- NOTE: These constants are prefixed with _ to keep them separate from .NET 5+ precompiler --> | ||
| <!-- flags. Those only apply to OS-specific target frameworks, and would interfere here. --> | ||
| <DefineConstants Condition="'$(TargetOs.ToUpper())' == 'UNIX'">$(DefineConstants),_UNIX</DefineConstants> | ||
| <DefineConstants Condition="'$(TargetOs.ToUpper())' == 'WINDOWS_NT'">$(DefineConstants),_WINDOWS</DefineConstants> | ||
| <!-- flags. Those only apply to OS-specific target frameworks, and would interfere here. --> | ||
| <DefineConstants Condition="'$(NormalizedTargetOs)' == 'unix'">$(DefineConstants);_UNIX</DefineConstants> | ||
| <DefineConstants Condition="'$(NormalizedTargetOs)' == 'windows_nt'">$(DefineConstants);_WINDOWS</DefineConstants> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </PropertyGroup> | ||
|
|
||
| <!-- Target Frameworks =============================================== --> | ||
| <PropertyGroup> | ||
| <!-- net462 is only supported on Windows, so we will only add it if we're building for Windows --> | ||
| <TargetFrameworks>net8.0;net9.0</TargetFrameworks> | ||
| <TargetFrameworks Condition="'$(NormalizedTargetOs)' == 'windows_nt'">$(TargetFrameworks);net462</TargetFrameworks> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </PropertyGroup> | ||
|
|
||
| <!-- Build Output ==================================================== --> | ||
| <PropertyGroup> | ||
| <!-- @TODO: Move to directory.build.props? --> | ||
| <ArtifactPath>$(RepoRoot)artifacts/</ArtifactPath> | ||
|
|
||
| <!-- MSBuild will add the target framework to the end of this path by default. Telling it not --> | ||
| <!-- to is possible but requires also specifying the IntermediateOutputPath. So while it --> | ||
| <!-- would be nice to have a flat directory structure, it's more hassle than its worth. --> | ||
| <OutputPath>$(ArtifactPath)$(AssemblyName)/$(Configuration)/$(NormalizedTargetOs)/</OutputPath> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </PropertyGroup> | ||
|
|
||
| <!-- Embedded resources ============================================== --> | ||
| <ItemGroup> | ||
| <!-- Linker directives to replace UseManagedNetworking with a constant if consumer specifies --> | ||
| <!-- the app context switch in their csproj. This file only applies to netcore on windows. --> | ||
| <!-- This file does not support pre-processor directives, so it must be conditionally --> | ||
| <!-- included into the build. --> | ||
| <EmbeddedResource Include="Resources/ILLink.Substitutions.xml" | ||
| Condition="'$(TargetOs.ToUpper())' == 'WINDOWS_NT'" /> | ||
| Condition="'$(NormalizedTargetOs)' == 'windows_nt' AND '$(TargetFramework)' != 'net462'" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- References ====================================================== --> | ||
| <ItemGroup> | ||
| <!-- References that apply to all target frameworks --> | ||
| <!-- References for netframework --> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'net462'"> | ||
| <Reference Include="System.Configuration" /> | ||
| <Reference Include="System.EnterpriseServices" /> | ||
| <Reference Include="System.Transactions" /> | ||
|
|
||
| <PackageReference Include="Azure.Core" /> | ||
| <PackageReference Include="Azure.Identity" /> | ||
| <PackageReference Include="Microsoft.Bcl.Cryptography" /> | ||
| <PackageReference Include="Microsoft.Data.SqlClient.SNI"> | ||
| <PrivateAssets>All</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| <PackageReference Include="Microsoft.Extensions.Caching.Memory" /> | ||
| <PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" /> | ||
| <PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" /> | ||
| <PackageReference Include="System.Configuration.ConfigurationManager" /> | ||
| <PackageReference Include="System.Security.Cryptography.Pkcs" /> | ||
| </ItemGroup> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'net462'"> | ||
| <!-- References that only apply to net462 --> | ||
| <Reference Include="System.Configuration" /> | ||
| <Reference Include="System.Transactions" /> | ||
| <PackageReference Include="System.ValueTuple" /> | ||
| <PackageReference Include="System.Threading.Channels" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- System.Buffers, System.Memory, and System.Runtime.InteropServices.RuntimeInformation are included in .NET 10+ BCL --> | ||
| <ItemGroup Condition="$([MSBuild]::VersionLessThan($([MSBuild]::GetTargetFrameworkVersion($(TargetFramework))), '10.0'))"> | ||
| <PackageReference Include="System.Buffers" /> | ||
| <PackageReference Include="System.Diagnostics.DiagnosticSource" /> | ||
| <PackageReference Include="System.Memory" /> | ||
| <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" /> | ||
| <PackageReference Include="System.Security.Cryptography.Pkcs" /> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <PackageReference Include="System.Text.Json" /> | ||
| <PackageReference Include="System.Threading.Channels" /> | ||
| <PackageReference Include="System.ValueTuple" /> | ||
| </ItemGroup> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <!-- References for netcore --> | ||
| <ItemGroup Condition="'$(TargetFramework)' != 'net462'"> | ||
| <PackageReference Include="Azure.Core" /> | ||
| <PackageReference Include="Azure.Identity" /> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <PackageReference Include="Microsoft.Bcl.Cryptography" /> | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <PackageReference Include="Microsoft.Data.SqlClient.SNI.runtime" /> | ||
| <PackageReference Include="Microsoft.Extensions.Caching.Memory" /> | ||
| <PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" /> | ||
| <PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" /> | ||
| <PackageReference Include="Microsoft.SqlServer.Server" /> | ||
| <PackageReference Include="System.Configuration.ConfigurationManager" /> | ||
| <PackageReference Include="System.Security.Cryptography.Pkcs" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- CodeGen Targets ================================================= --> | ||
| <Import Project="$(ToolsDir)targets\GenerateThisAssemblyCs.targets" /> | ||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.