Skip to content

CSHARP-4385: Consider adding Directory.Build.props. #934

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 11 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
12 changes: 9 additions & 3 deletions CSharpDriver.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
# Visual Studio Version 17
VisualStudioVersion = 17.0.31919.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D2012971-32BB-4C5F-BFC4-30A9994AB152}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
Copy link
Contributor Author

@DmitryLukyanov DmitryLukyanov Nov 6, 2022

Choose a reason for hiding this comment

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

it's possible to add this file into solution directory, but given that configuration makes sense only for src folder, probably better to leave it where it's currently placed

EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{E472BDF5-61F1-461D-872B-9F53BB3ACA80}"
ProjectSection(SolutionItems) = preProject
tests\Directory.Build.props = tests\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoDB.Bson", "src\MongoDB.Bson\MongoDB.Bson.csproj", "{9FCB42A5-3BC6-492B-8EA0-53EF32E9F8CD}"
EndProject
Expand Down Expand Up @@ -54,7 +60,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoDB.Driver.TestConsoleA
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AstrolabeWorkloadExecutor", "tests\AstrolabeWorkloadExecutor\AstrolabeWorkloadExecutor.csproj", "{B90F025F-89D3-436A-AD78-6AA304A6E240}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoDB.Driver.SmokeTests.Sdk", "tests\SmokeTests\MongoDB.Driver.SmokeTests.Sdk\MongoDB.Driver.SmokeTests.Sdk.csproj", "{B711A69F-A337-452C-95E1-A6B15C727CBA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoDB.Driver.SmokeTests.Sdk", "tests\SmokeTests\MongoDB.Driver.SmokeTests.Sdk\MongoDB.Driver.SmokeTests.Sdk.csproj", "{B711A69F-A337-452C-95E1-A6B15C727CBA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SmokeTests", "SmokeTests", "{F64BF86A-1EF1-4596-84A6-6B4AB766CD77}"
EndProject
Expand Down
54 changes: 54 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Project>
<PropertyGroup>
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(IsWindows)'=='true'">$(TargetFrameworks);net472</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CodeAnalysisRuleSet>..\..\MongoDB.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup>
<Company>MongoDB Inc.</Company>
<Copyright>Copyright © 2010-present MongoDB Inc.</Copyright>
<Authors>MongoDB Inc.</Authors>
<PackageIcon>packageIcon.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://www.mongodb.com/docs/drivers/csharp/</PackageProjectUrl>
<PackageTags>mongodb;mongo;nosql</PackageTags>
<PackageLicenseFile>License.txt</PackageLicenseFile>
<PackageLanguage>en-US</PackageLanguage>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Version)'==''">
<Version>0.0.0-local</Version>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Include="..\..\License.txt" Pack="true" PackagePath="$(PackageLicenseFile)" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
47 changes: 1 addition & 46 deletions src/MongoDB.Bson/MongoDB.Bson.csproj
Original file line number Diff line number Diff line change
@@ -1,68 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(IsWindows)'!='true'">netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<CodeAnalysisRuleSet>..\..\MongoDBLegacy.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup>
<AssemblyTitle>MongoDB.Bson</AssemblyTitle>
<Product>MongoDB.Bson</Product>
<Company>MongoDB Inc.</Company>
<Copyright>Copyright © 2010-present MongoDB Inc.</Copyright>
<Description>Official MongoDB supported BSON library. See https://www.mongodb.com/docs/drivers/csharp/ for more details.</Description>
<Authors>MongoDB Inc.</Authors>
<PackageIcon>packageIcon.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageDescription>MongoDB's Official Bson Library.</PackageDescription>
<PackageProjectUrl>https://www.mongodb.com/docs/drivers/csharp/</PackageProjectUrl>
<PackageLicenseFile>License.txt</PackageLicenseFile>
<PackageTags>mongodb;mongo;nosql;bson</PackageTags>
<PackageLanguage>en-US</PackageLanguage>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Version)'==''">
<Version>0.0.0-local</Version>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
</ItemGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>$(PackageTags);bson</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" PrivateAssets="All" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Compile Include="..\MongoDB.Shared\Hasher.cs" Link="Hasher.cs" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\License.txt" Pack="true" PackagePath="$(PackageLicenseFile)" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
42 changes: 0 additions & 42 deletions src/MongoDB.Driver.Core/MongoDB.Driver.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,51 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
<IsOSX Condition="$([MSBuild]::IsOSPlatform('OSX'))">true</IsOSX>
<IsLinux Condition="$([MSBuild]::IsOSPlatform('Linux'))">true</IsLinux>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(IsWindows)'!='true'">netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<CodeAnalysisRuleSet>..\..\MongoDB.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup>
<AssemblyTitle>MongoDB.Driver.Core</AssemblyTitle>
<Product>MongoDB.Driver.Core</Product>
<Company>MongoDB Inc.</Company>
<Copyright>Copyright © 2010-present MongoDB Inc.</Copyright>
<Description>Official MongoDB supported Driver Core library. See https://www.mongodb.com/docs/drivers/csharp/ for more details.</Description>
<Authors>MongoDB Inc.</Authors>
<PackageIcon>packageIcon.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageDescription>Core Component of the Official MongoDB .NET Driver.</PackageDescription>
<PackageProjectUrl>https://www.mongodb.com/docs/drivers/csharp/</PackageProjectUrl>
<PackageLicenseFile>License.txt</PackageLicenseFile>
<PackageTags>mongodb;mongo;nosql</PackageTags>
<PackageLanguage>en-US</PackageLanguage>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
</ItemGroup>

<PropertyGroup Condition="'$(Version)'==''">
<Version>0.0.0-local</Version>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>MongoDB.Driver</RootNamespace>
</PropertyGroup>

Expand All @@ -55,17 +20,12 @@

<ItemGroup>
<PackageReference Include="DnsClient" Version="1.6.1" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" PrivateAssets="All" />
<PackageReference Include="MongoDB.Libmongocrypt" Version="1.6.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
<PackageReference Include="SharpCompress" Version="0.30.1" />
<PackageReference Include="Snappier" Version="1.0.0" />
<PackageReference Include="ZstdSharp.Port" Version="0.6.2" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
Expand All @@ -82,9 +42,7 @@
</ItemGroup>

<ItemGroup>
<None Include="..\..\License.txt" Pack="true" PackagePath="$(PackageLicenseFile)" />
<None Include="..\..\THIRD-PARTY-NOTICES" Pack="true" PackagePath="\" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
50 changes: 1 addition & 49 deletions src/MongoDB.Driver.GridFS/MongoDB.Driver.GridFS.csproj
Original file line number Diff line number Diff line change
@@ -1,69 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(IsWindows)'!='true'">netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<CodeAnalysisRuleSet>..\..\MongoDB.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup>
<AssemblyTitle>MongoDB.Driver.GridFS</AssemblyTitle>
<Product>MongoDB.Driver.GridFS</Product>
<Company>MongoDB Inc.</Company>
<Copyright>Copyright © 2010-present MongoDB Inc.</Copyright>
<Description>Official MongoDB supported driver for MongoDB GridFS implementation. See https://www.mongodb.com/docs/drivers/csharp/ for more details.</Description>
<Authors>MongoDB Inc.</Authors>
<PackageIcon>packageIcon.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageDescription>GridFS Component of the Official MongoDB .NET Driver.</PackageDescription>
<PackageProjectUrl>https://www.mongodb.com/docs/drivers/csharp/</PackageProjectUrl>
<PackageLicenseFile>License.txt</PackageLicenseFile>
<PackageTags>mongodb;mongo;nosql;gridfs</PackageTags>
<PackageLanguage>en-US</PackageLanguage>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Version)'==''">
<Version>0.0.0-local</Version>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>TRACE</DefineConstants>
<PackageTags>$(PackageTags);gridfs</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
</ItemGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MongoDB.Bson\MongoDB.Bson.csproj" />
<ProjectReference Include="..\MongoDB.Driver\MongoDB.Driver.csproj" />
<ProjectReference Include="..\MongoDB.Driver.Core\MongoDB.Driver.Core.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\License.txt" Pack="true" PackagePath="$(PackageLicenseFile)" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath=""/>
</ItemGroup>

</Project>
41 changes: 0 additions & 41 deletions src/MongoDB.Driver.Legacy/MongoDB.Driver.Legacy.csproj
Original file line number Diff line number Diff line change
@@ -1,55 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(IsWindows)'!='true'">netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<CodeAnalysisRuleSet>..\..\MongoDBLegacy.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup>
<AssemblyTitle>MongoDB.Driver.Legacy</AssemblyTitle>
<Product>MongoDB.Driver.Legacy</Product>
<Company>MongoDB Inc.</Company>
<Copyright>Copyright © 2010-present MongoDB Inc.</Copyright>
<Description>Legacy MongoDB supported driver for MongoDB. See https://www.mongodb.com/docs/drivers/csharp/ for more details.</Description>
<Authors>MongoDB Inc.</Authors>
<PackageId>mongocsharpdriver</PackageId>
<PackageIcon>packageIcon.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageDescription>This package contains the legacy driver. The new driver's package name is MongoDB.Driver</PackageDescription>
<PackageProjectUrl>https://www.mongodb.com/docs/drivers/csharp/</PackageProjectUrl>
<PackageLicenseFile>License.txt</PackageLicenseFile>
<PackageTags></PackageTags>
<PackageLanguage>en-US</PackageLanguage>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Version)'==''">
<Version>0.0.0-local</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>MongoDB.Driver</RootNamespace>
</PropertyGroup>

Expand All @@ -59,9 +23,4 @@
<ProjectReference Include="..\MongoDB.Driver.Core\MongoDB.Driver.Core.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\License.txt" Pack="true" PackagePath="$(PackageLicenseFile)" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
Loading