Skip to content

Commit

Permalink
Merge pull request #16 from maxnatamo/feat/global-msbuild
Browse files Browse the repository at this point in the history
feat: Use global MSBuild configuration file
  • Loading branch information
maxnatamo authored Nov 9, 2023
2 parents 6d7e1c9 + 7ab236e commit 0c0d4b0
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 96 deletions.
21 changes: 3 additions & 18 deletions src/Core/src/Paracord.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,12 @@

<PropertyGroup>
<PackageId>Paracord</PackageId>
<AssemblyName>Paracord</AssemblyName>
<RootNamespace>Paracord</RootNamespace>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AssemblyName>Paracord.Core</AssemblyName>
<RootNamespace>Paracord.Core</RootNamespace>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Shared\src\Paracord.Shared.csproj" />
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Paracord.Core.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
Expand Down
35 changes: 2 additions & 33 deletions src/Core/test/Paracord.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,39 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AssemblyName>Paracord.Core.Tests</AssemblyName>
<RootNamespace>Paracord.Core</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../src/Paracord.Core.csproj" />
<ProjectReference Include="../../Shared/src/Paracord.Shared.csproj" />
</ItemGroup>

</Project>
86 changes: 86 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<Project>

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<IsTestProject Condition="$(MSBuildProjectName.EndsWith('Tests'))">true</IsTestProject>
<IsBenchmarkProject Condition="$(MSBuildProjectName.EndsWith('Benchmark'))">true</IsBenchmarkProject>
<IsSourceProject Condition="'$(IsTestProject)' != 'true' AND '$(IsBenchmarkProject)' != 'true'">true</IsSourceProject>
</PropertyGroup>

<PropertyGroup Condition="'$(IsSourceProject)' != 'true'">
<IsPackable>false</IsPackable>
<IncludeSymbols>false</IncludeSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(IsSourceProject)' == 'true'">
<IsPackable>true</IsPackable>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<NoWarn>CS1591;CS1573</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<!-- Source projects -->

<ItemGroup Condition="$(MSBuildProjectName) != 'Paracord.Shared'">
<ProjectReference Include="../../Shared/src/Paracord.Shared.csproj" />
</ItemGroup>

<PropertyGroup Condition="'$(IsSourceProject)' == 'true'">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<ItemGroup Condition="'$(IsSourceProject)' == 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Condition="'$(IsSourceProject)' == 'true'">
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>$(RootNamespace).Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<!-- Test projects -->

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<!-- Reference to corresponding source project -->
<ProjectReference Include="../src/$(RootNamespace).csproj" />
</ItemGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Snapshooter.Xunit" Version="0.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<!-- Benchmark projects -->

<ItemGroup Condition="'$(IsBenchmarkProject)' == 'true'">
<ProjectReference Include="../src/$(RootNamespace).csproj" />
</ItemGroup>

<ItemGroup Condition="'$(IsBenchmarkProject)' == 'true'">
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
</ItemGroup>

</Project>
13 changes: 1 addition & 12 deletions src/Shared/src/Paracord.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,14 @@
<PackageId>Paracord.Shared</PackageId>
<AssemblyName>Paracord.Shared</AssemblyName>
<RootNamespace>Paracord.Shared</RootNamespace>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

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

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Paracord.Shared.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
Expand Down
34 changes: 2 additions & 32 deletions src/Shared/test/Paracord.Shared.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AssemblyName>Paracord.Shared.Tests</AssemblyName>
<RootNamespace>Paracord.Shared</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../src/Paracord.Shared.csproj" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion src/Templates/Paracord.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup Label="Build">
<PackageType>Template</PackageType>
<PackageId>Paracord.Templates</PackageId>
<TargetFramework>net7.0</TargetFramework>

<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
Expand Down

0 comments on commit 0c0d4b0

Please sign in to comment.