Skip to content

Commit 780ddaa

Browse files
authored
Merge pull request #266 from DataObjects-NET/master-net6.0-support
Build and pack binaries for both net6.0 and net5.0 Build configs for both target frameworks
2 parents 657c407 + 85bf47e commit 780ddaa

File tree

63 files changed

+936
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+936
-397
lines changed

Directory.Build.props

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,50 @@
3333
<DoGeneratePackage Condition="$(MSBuildProjectName) == 'TestCommon'">false</DoGeneratePackage>
3434
<DoGeneratePackage Condition="$(MSBuildProjectName.Contains('Tests')) == 'true'">false</DoGeneratePackage>
3535

36+
<!-- BuildingInsideVisualStudio is also true in Rider -->
37+
<DoIsIdeBuild>false</DoIsIdeBuild>
38+
<DoIsIdeBuild Condition="$(BuildingInsideVisualStudio) == 'true'">true</DoIsIdeBuild>
39+
3640
<!-- Disable "BinaryFormatter is obsolete" warnings for test projects -->
3741
<NoWarn Condition="$(MSBuildProjectName.Contains('Tests')) == 'true'">$(NoWarn);SYSLIB0011</NoWarn>
3842
</PropertyGroup>
3943

44+
<!-- Debug-NET6, Release-NET6 are mostly for development convenience -->
45+
<PropertyGroup Condition = "$(Configuration.Contains('NET6')) == 'true'">
46+
<!-- hard binding to net6, no property and env variable allowed -->
47+
<TargetFrameworks>net6.0</TargetFrameworks>
48+
</PropertyGroup>
49+
50+
<!-- Debug-NET5, Release-NET5 are mostly for development convenience -->
51+
<PropertyGroup Condition = "$(Configuration.Contains('NET5')) == 'true'">
52+
<!-- hard binding to net5, no property and env variable allowed-->
53+
<TargetFrameworks>net5.0</TargetFrameworks>
54+
</PropertyGroup>
55+
56+
<!--Release and Debug are for final builds, builds on build server, etc. Target frameworks are configurable here -->
57+
<PropertyGroup Label="Defaults" Condition="$(Configuration.Contains('NET5')) == 'false' AND $(Configuration.Contains('NET6')) == 'false'">
58+
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
59+
<TargetFrameworks>$(TargetFrameworks)</TargetFrameworks> <!-- the property -->
60+
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">$(DO_TargetFrameworks)</TargetFrameworks> <!-- env var -->
61+
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net6.0;net5.0</TargetFrameworks> <!-- fallback to default -->
62+
</PropertyGroup>
63+
4064
<PropertyGroup>
4165
<NoLogo>true</NoLogo>
4266
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
43-
<TargetFrameworks>$(TargetFrameworks)</TargetFrameworks> <!-- the property -->
44-
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">$(DO_TargetFrameworks)</TargetFrameworks> <!-- env var -->
45-
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net5.0</TargetFrameworks> <!-- fallback to default -->
4667
<LangVersion>9.0</LangVersion>
4768
<SolutionDir Condition="$(SolutionDir) == ''">$([MSBuild]::EnsureTrailingSlash(
4869
$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)', 'Orm.sln'))))</SolutionDir>
49-
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
5070
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
5171
<ArtifactsDir Condition="'$(ArtifactsDir)'==''">$(SolutionDir)_Build\</ArtifactsDir>
5272
<BaseIntermediateOutputPath>$(ArtifactsDir)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
53-
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\</IntermediateOutputPath>
73+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
5474
<BaseOutputPath>$(ArtifactsDir)bin\$(Configuration)\</BaseOutputPath>
5575
<BaseOutputPath Condition="$(MSBuildProjectName.Contains('Tests'))
5676
OR $(MSBuildProjectName) == 'TestCommon'
5777
OR $(MSBuildProjectName) == 'Xtensive.Orm.Manual'">$(ArtifactsDir)tests\$(Configuration)\</BaseOutputPath>
5878
<OutputPath>$(BaseOutputPath)lib\</OutputPath>
59-
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
79+
<MSBuildProjectExtensionsPath>$(IntermediateOutputPath)</MSBuildProjectExtensionsPath>
6080
<ProjectAssetsFile>$(MSBuildProjectExtensionsPath)project.assets.json</ProjectAssetsFile>
6181
<ProjectAssetsCacheFile>$(MSBuildProjectExtensionsPath)$(TargetFramework)\$(MSBuildProjectName).assets.cache</ProjectAssetsCacheFile>
6282
<OrmKeyFile>$(SolutionDir)Orm\Orm.snk</OrmKeyFile>

Directory.Build.targets

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!--
5+
Restores packages if needed. This helps VS to not go crazy on build configuration change
6+
-->
7+
<Target Name="DORestorePackages" BeforeTargets="PrepareForBuild"
8+
Condition="!Exists($(ProjectAssetsFile)) AND $(DoIsIdeBuild)=='true'">
9+
<CallTarget Targets="Restore" />
10+
</Target>
11+
</Project>

Extensions/TestCommon/TestCommon.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<DocumentationFile />
4+
<Configurations>Debug;Release;Debug-NET5;Release-NET5;Debug-NET6;Release-NET6;</Configurations>
45
</PropertyGroup>
56
<PropertyGroup>
67
<SignAssembly>true</SignAssembly>

Extensions/Xtensive.Orm.BulkOperations.Tests/Xtensive.Orm.BulkOperations.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<DocumentationFile />
4+
<Configurations>Debug;Release;Debug-NET5;Release-NET5;Debug-NET6;Release-NET6;</Configurations>
45
</PropertyGroup>
56
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
67
<ItemGroup>

Extensions/Xtensive.Orm.BulkOperations/Xtensive.Orm.BulkOperations.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<IsPackable>true</IsPackable>
44
<DocumentationFile>$(OutputPath)$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
5+
<Configurations>Debug;Release;Debug-NET5;Release-NET5;Debug-NET6;Release-NET6;</Configurations>
56
</PropertyGroup>
67
<PropertyGroup>
78
<PackageId>Xtensive.Orm.BulkOperations</PackageId>

Extensions/Xtensive.Orm.Localization.Tests/Xtensive.Orm.Localization.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<DocumentationFile />
4+
<Configurations>Debug;Release;Debug-NET5;Release-NET5;Debug-NET6;Release-NET6;</Configurations>
45
</PropertyGroup>
56
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
67
<ItemGroup>

Extensions/Xtensive.Orm.Localization/Xtensive.Orm.Localization.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<IsPackable>true</IsPackable>
44
<DocumentationFile>$(OutputPath)$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
5+
<Configurations>Debug;Release;Debug-NET5;Release-NET5;Debug-NET6;Release-NET6;</Configurations>
56
</PropertyGroup>
67
<PropertyGroup>
78
<PackageId>Xtensive.Orm.Localization</PackageId>

Extensions/Xtensive.Orm.Logging.NLog.Tests/Xtensive.Orm.Logging.NLog.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<DocumentationFile />
4+
<Configurations>Debug;Release;Debug-NET5;Release-NET5;Debug-NET6;Release-NET6;</Configurations>
45
</PropertyGroup>
56
<ItemGroup>
67
<None Include="App.config" />

Extensions/Xtensive.Orm.Logging.NLog/Xtensive.Orm.Logging.NLog.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<IsPackable>true</IsPackable>
44
<DocumentationFile>$(OutputPath)$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
5+
<Configurations>Debug;Release;Debug-NET5;Release-NET5;Debug-NET6;Release-NET6;</Configurations>
56
</PropertyGroup>
67
<PropertyGroup>
78
<PackageId>Xtensive.Orm.Logging.NLog</PackageId>

Extensions/Xtensive.Orm.Logging.log4net.Tests/Xtensive.Orm.Logging.log4net.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<DocumentationFile />
4+
<Configurations>Debug;Release;Debug-NET5;Release-NET5;Debug-NET6;Release-NET6;</Configurations>
45
</PropertyGroup>
56
<ItemGroup>
67
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />

0 commit comments

Comments
 (0)