Skip to content

Commit

Permalink
build: Use central package management (#1424)
Browse files Browse the repository at this point in the history
* build: Use central package management

* build: Fix `DefineConstants` value for test project

---------

Co-authored-by: Jan Källman <jan.kallman@epplussoftware.com>
  • Loading branch information
akorda and JanKallman authored May 3, 2024
1 parent b84aee9 commit 5360a3f
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 338 deletions.
35 changes: 35 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>Core;Standard20</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<DefineConstants>Core;Standard21</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<DefineConstants>Core;NET60</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0'">
<DefineConstants>Core;NET70</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<DefineConstants>Core;NET80</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net481'">
<DefineConstants>NET481;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net462'">
<DefineConstants>NET462;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net35'">
<DefineConstants>NET35;NETFULL</DefineConstants>
</PropertyGroup>

</Project>
23 changes: 23 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Drawing.Common" Version="8.0.4" />
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.0" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="FakeItEasy" Version="8.0.0" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.10" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>
54 changes: 15 additions & 39 deletions src/EPPlus.Interfaces/EPPlus.Interfaces.csproj
Original file line number Diff line number Diff line change
@@ -1,44 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netstandard2.1;netstandard2.0;net462;net35</TargetFrameworks>
<AssemblyVersion>6.1.1.0</AssemblyVersion>
<FileVersion>6.1.1.0</FileVersion>
<Version>6.1.1</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseFile>license.md</PackageLicenseFile>
<RepositoryType>git</RepositoryType>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>EPPlus.Interfaces.snk</AssemblyOriginatorKeyFile>
<RootNamespace>OfficeOpenXml.Interfaces</RootNamespace>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageIcon>EPPlusLogo.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>Core;Standard20</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<DefineConstants>Core;Standard21</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<DefineConstants>Core;NET60</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0'">
<DefineConstants>Core;NET70</DefineConstants>
<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0;net462;net35</TargetFrameworks>
<AssemblyVersion>6.1.1.0</AssemblyVersion>
<FileVersion>6.1.1.0</FileVersion>
<Version>6.1.1</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseFile>license.md</PackageLicenseFile>
<RepositoryType>git</RepositoryType>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>EPPlus.Interfaces.snk</AssemblyOriginatorKeyFile>
<RootNamespace>OfficeOpenXml.Interfaces</RootNamespace>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageIcon>EPPlusLogo.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net452'">
<DefineConstants>NET45;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net35'">
<DefineConstants>NET35;NETFULL</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Include="EPPlusLogo.png">
<Pack>True</Pack>
Expand All @@ -53,4 +29,4 @@
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>
</Project>
80 changes: 19 additions & 61 deletions src/EPPlus.System.Drawing/EPPlus.System.Drawing.csproj
Original file line number Diff line number Diff line change
@@ -1,82 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netstandard2.1;netstandard2.0;net462;net35</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0;net462;net35</TargetFrameworks>
<AssemblyVersion>6.1.1.0</AssemblyVersion>
<FileVersion>6.1.1.0</FileVersion>
<Version>6.1.1</Version>
<SignAssembly>true</SignAssembly>
<PackageLicenseFile>license.md</PackageLicenseFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyOriginatorKeyFile>EPPlus.System.Drawing.snk</AssemblyOriginatorKeyFile>
<RootNamespace>OfficeOpenXml.System.Drawing</RootNamespace>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageIcon>EPPlusLogo.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>Core;Standard20</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<DefineConstants>Core;Standard21</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<DefineConstants>Core;NET60</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0'">
<DefineConstants>Core;NET70</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net462'">
<DefineConstants>NET462;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net35'">
<DefineConstants>NET35;NETFULL</DefineConstants>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\EPPlus.Interfaces\EPPlus.Interfaces.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="System.Drawing.Common">
<Version>6.0.0</Version>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="System.Drawing.Common">
<Version>7.0.0</Version>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Drawing.Common">
<Version>4.7.3</Version>
</PackageReference>
<ItemGroup Condition="'$(TargetFramework)' != 'net35'">
<PackageReference Include="System.Drawing.Common" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Drawing.Common">
<Version>4.7.3</Version>
</PackageReference>
<ItemGroup>
<None Include="EPPlusLogo.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="license.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="readme.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<None Include="EPPlusLogo.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="license.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="readme.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>
</Project>
Loading

0 comments on commit 5360a3f

Please sign in to comment.