Skip to content

Commit

Permalink
Update build system (#431)
Browse files Browse the repository at this point in the history
Update build system to use Directory.Build.props and Directory.Packages.props instead of custom solutions
  • Loading branch information
jamescourtney authored Mar 2, 2024
1 parent 1394a9e commit 3218da4
Show file tree
Hide file tree
Showing 22 changed files with 140 additions and 140 deletions.
12 changes: 5 additions & 7 deletions src/Benchmarks/Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
Expand All @@ -10,11 +8,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="protobuf-net" Version="3.2.30" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
<PackageReference Include="MessagePack" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="protobuf-net" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 7 additions & 9 deletions src/Benchmarks/BenchmarkOld/BenchmarkOld.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
Expand All @@ -16,13 +14,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="protobuf-net" Version="3.2.30" />
<PackageReference Include="FlatSharp" Version="7.4.0" />
<PackageReference Include="FlatSharp.Runtime" Version="7.4.0" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
<PackageReference Include="MessagePack" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="protobuf-net" />
<PackageReference Include="FlatSharp" VersionOverride="7.4.0" />
<PackageReference Include="FlatSharp.Runtime" VersionOverride="7.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
Expand All @@ -13,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
Expand All @@ -12,13 +10,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageReference Include="FlatSharp.Compiler" Version="7.4.0">
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
<PackageReference Include="FlatSharp.Compiler" VersionOverride="7.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FlatSharp.Runtime" Version="7.4.0" />
<PackageReference Include="FlatSharp.Runtime" VersionOverride="7.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 5 additions & 7 deletions src/Benchmarks/MicroBench.Current/Microbench.Current.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -19,11 +17,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
<PackageReference Include="Grpc" Version="2.46.6" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
<PackageReference Include="Grpc" />
<PackageReference Include="System.IO.FileSystem.Primitives" />
<PackageReference Include="System.Runtime.InteropServices" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/common.props → src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</PropertyGroup>

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>7.5.1</Version>
<PackageVersion>7.5.1</PackageVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
Expand Down
30 changes: 30 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="coverlet.collector" Version="3.1.2" />
<PackageVersion Include="Grpc" Version="2.46.6" />
<PackageVersion Include="Grpc.Core" Version="2.46.6" />
<PackageVersion Include="Grpc.Core.Api" Version="2.61.0" />
<PackageVersion Include="MessagePack" Version="2.5.140" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.9.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="17.9.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="protobuf-net" Version="3.2.30" />
<PackageVersion Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageVersion Include="System.Threading.Channels" Version="8.0.0" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
<PackageVersion Include="xunit.runner.utility" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
</ItemGroup>
</Project>
9 changes: 4 additions & 5 deletions src/FlatSharp.Compiler/FlatSharp.Compiler.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<AssemblyName>FlatSharp.Compiler</AssemblyName>
<RootNamespace>FlatSharp.Compiler</RootNamespace>
<OutputType>Exe</OutputType>
Expand All @@ -21,8 +20,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="CommandLineParser" />
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 2 additions & 7 deletions src/FlatSharp.Runtime/FlatSharp.Runtime.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<AssemblyName>FlatSharp.Runtime</AssemblyName>
<RootNamespace>FlatSharp.Runtime</RootNamespace>
Expand Down Expand Up @@ -29,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Memory" />
</ItemGroup>

<ItemGroup>
Expand All @@ -44,8 +43,4 @@
<DependentUpon>UnionTypes.tt</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
</Project>
4 changes: 1 addition & 3 deletions src/FlatSharp.UnityPolyfills/FlatSharp.UnityPolyfills.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<RootNamespace>FlatSharp.UnityPolyfills</RootNamespace>
Expand All @@ -16,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Memory" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 5 additions & 10 deletions src/FlatSharp/FlatSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<AssemblyName>FlatSharp</AssemblyName>
<RootNamespace>FlatSharp</RootNamespace>
Expand All @@ -16,10 +15,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<None Remove="SimpleLazyReferenceVector.txt" />
</ItemGroup>

<ItemGroup>
<None Update="TypeModel\ScalarTypeModels.tt">
<LastGenOutput>ScalarTypeModels.cs</LastGenOutput>
Expand All @@ -32,13 +27,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.8.0">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="NetStandard.Library" Version="2.0.3" GeneratePathProperty="true" PrivateAssets="All" />
<PackageReference Include="System.Memory" />
<PackageReference Include="NetStandard.Library" VersionOverride="2.0.3" GeneratePathProperty="true" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions src/Google.FlatBuffers/Google.FlatBuffers.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

</Project>
8 changes: 4 additions & 4 deletions src/Tests/CompileTests/CSharp8/CSharp8.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Core" Version="2.46.5" />
<PackageReference Include="Grpc.Core.Api" Version="2.49.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Threading.Channels" Version="6.0.0" />
<PackageReference Include="Grpc.Core" />
<PackageReference Include="Grpc.Core.Api" />
<PackageReference Include="Microsoft.CSharp" />
<PackageReference Include="System.Threading.Channels" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/Tests/CompileTests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<!-- Only here so that the default Directory.Build.props will not be used. -->
</Project>
1 change: 1 addition & 0 deletions src/Tests/CompileTests/NativeAot/NativeAot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>annotations</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>
<LangVersion>11.0</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'net472' ">
Expand Down
33 changes: 18 additions & 15 deletions src/Tests/FlatSharpCompilerTests/FlatSharpCompilerTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<Import Project="..\unittest.props" />

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
Expand All @@ -10,26 +7,32 @@
<RootNamespace>FlatSharpTests</RootNamespace>
<Nullable>annotations</Nullable>
<DeploymentEnabled>false</DeploymentEnabled>
<NoWarn>$(NoWarn);CA2255</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Core" Version="2.46.6" />
<PackageReference Include="Grpc.Core.Api" Version="2.61.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="coverlet.collector" Condition=" '$(CoverageBuild)' == 'true' ">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Grpc.Core" />
<PackageReference Include="Grpc.Core.Api" />
<PackageReference Include="Microsoft.CSharp" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.abstractions" />
<PackageReference Include="xunit.runner.utility" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\FlatSharp.Compiler\FlatSharp.Compiler.csproj" />
<ProjectReference Include="..\..\FlatSharp.Runtime\FlatSharp.Runtime.csproj" />
<ProjectReference Include="..\..\FlatSharp.UnityPolyfills\FlatSharp.UnityPolyfills.csproj" />
<ProjectReference Include="..\..\FlatSharp\FlatSharp.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="xunit" Version="2.7.0" />
<PackageReference Update="xunit.runner.utility" Version="2.7.0" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
Loading

0 comments on commit 3218da4

Please sign in to comment.