Skip to content

Commit

Permalink
Merge pull request #164 from bmazzarol/feat/monorepo
Browse files Browse the repository at this point in the history
feat: update code to mono-repo structure
  • Loading branch information
bmazzarol authored Feb 16, 2025
2 parents 6c4d5d0 + dc5826d commit 9b4ee8f
Show file tree
Hide file tree
Showing 39 changed files with 740 additions and 622 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"csharpier": {
"version": "0.30.4",
"version": "0.30.6",
"commands": [
"dotnet-csharpier"
]
Expand Down
20 changes: 0 additions & 20 deletions .github/dependabot.yml

This file was deleted.

16 changes: 14 additions & 2 deletions .globalconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
is_global = true

dotnet_diagnostic.MA0048.severity = none

# Type name should not match containing namespace
dotnet_diagnostic.MA0049.severity = warning

# Use Task.ConfigureAwait(false) if the current SynchronizationContext is not needed
dotnet_diagnostic.MA0004.severity = none

# Fix TODO comment
dotnet_diagnostic.MA0026.severity = suggestion

# Remove the unused internal class
dotnet_diagnostic.S1144.severity = suggestion

# Track uses of "TODO" tags
dotnet_diagnostic.S1135.severity = suggestion

# logging performance
dotnet_diagnostic.CA1848.severity = none

# Add comma after the last value
dotnet_diagnostic.MA0007.severity = none
28 changes: 28 additions & 0 deletions Common.Benchmark.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
This file contains all the shared properties and targets for
the benchmark projects that are in this solution
-->

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<SonarQubeExclude>true</SonarQubeExclude>
<ProjectName>$(AssemblyName.Replace('.Benchmarks', ''))</ProjectName>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet"/>
<PackageReference Include="BenchmarkDotNet.Diagnostics.dotTrace"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(MSBuildProjectDirectory)\..\$(ProjectName)\$(ProjectName).csproj"/>
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"/>
</ItemGroup>

</Project>
51 changes: 51 additions & 0 deletions Common.Docs.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
This file contains all the shared properties and targets for
the docs projects that are in this solution
-->

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<Target Name="BuildDocs" AfterTargets="AfterBuild" BeforeTargets="PostBuildEvent">
<!-- Prevent parallel execution -->
<PropertyGroup>
<BuildDocInParallel>false</BuildDocInParallel>
</PropertyGroup>

<!-- Check if docfx.json exists -->
<PropertyGroup>
<DocFxConfigExists Condition="Exists('docfx.json')">true</DocFxConfigExists>
</PropertyGroup>

<!-- Only proceed if docfx.json exists -->
<Message Text="docfx.json not found. Skipping documentation generation."
Condition="'$(DocFxConfigExists)' != 'true'"/>

<CallTarget Targets="ExecuteBuildDocs"
Condition="'$(DocFxConfigExists)' == 'true'"/>
</Target>

<Target Name="ExecuteBuildDocs">
<!-- Restore tools with error handling -->
<Exec Command="dotnet tool restore"
ContinueOnError="false"
StandardOutputImportance="low"
StandardErrorImportance="high"/>

<!-- Clean output directories -->
<RemoveDir Directories="_site;api"/>

<!-- Generate and build documentation -->
<Exec Command="dotnet docfx metadata docfx.json"
ContinueOnError="false"
StandardOutputImportance="normal"
StandardErrorImportance="high"/>

<Exec Command="dotnet docfx build docfx.json --warningsAsErrors"
ContinueOnError="false"
StandardOutputImportance="normal"
StandardErrorImportance="high"/>
</Target>
</Project>
4 changes: 0 additions & 4 deletions Common.Release.targets → Common.Release.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

<PropertyGroup>
<Authors>Ben Mazzarol</Authors>
<PackageProjectUrl>https://bmazzarol.github.io/Http-BuildR</PackageProjectUrl>
<RepositoryUrl>https://github.com/bmazzarol/Http-BuildR</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) Ben Mazzarol. All rights reserved.</Copyright>
Expand All @@ -20,14 +18,12 @@
<IsPackable>True</IsPackable>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>construction-icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
<OutputType>library</OutputType>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="..\..\..\construction-icon.png" Pack="true" PackagePath="\" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>

Expand Down
14 changes: 6 additions & 8 deletions Common.Test.Xunit.targets → Common.Test.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,18 @@
-->

<PropertyGroup>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
<TargetFramework>net8.0</TargetFramework>
<SonarQubeExclude>true</SonarQubeExclude>
<ImplicitUsings>enable</ImplicitUsings>
<ProjectName>$(AssemblyName.Replace('.Tests', ''))</ProjectName>
<OutputType>Exe</OutputType>
</PropertyGroup>

<Import Project="$(MSBuildProjectDirectory)\..\$(ProjectName)\build\$(ProjectName).props"
Condition="Exists('$(MSBuildProjectDirectory)\..\$(ProjectName)\build\$(ProjectName).props')"/>

<ItemGroup>
<PackageReference Include="BunsenBurner"/>
<PackageReference Include="Docfx.ResultSnippets" />
<PackageReference Include="FluentAssertions"/>
<PackageReference Include="Meziantou.Xunit.ParallelTestFramework"/>
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.v3"/>
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand All @@ -36,4 +31,7 @@
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"/>
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
</Project>
49 changes: 3 additions & 46 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,50 +1,7 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ParentDirectoryPackageProps>$([MSBuild]::GetPathOfFileAbove('Directory.Packages.props', '$(MSBuildThisFileDirectory)/../'))</ParentDirectoryPackageProps>
</PropertyGroup>
<!-- Project packages -->
<ItemGroup>
<PackageVersion Include="System.Text.Json" Version="[6.0.10,)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>
<!-- Test packages -->
<ItemGroup>
<PackageVersion Include="BunsenBurner" Version="7.0.0" />
<PackageVersion Include="Docfx.ResultSnippets" Version="2.0.0" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="Meziantou.Xunit.ParallelTestFramework" Version="2.3.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
</ItemGroup>
<!-- Shared analysers -->
<ItemGroup>
<GlobalPackageReference Include="AsyncFixer" Version="1.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</GlobalPackageReference>
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.184">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</GlobalPackageReference>
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.12.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</GlobalPackageReference>
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.4.0.108396">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</GlobalPackageReference>
<GlobalPackageReference Include="FluentAssertions.Analyzers" Version="0.34.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</GlobalPackageReference>
</ItemGroup>
<Import Project="$(ParentDirectoryPackageProps)" Condition="Exists('$(ParentDirectoryPackageProps)')" />
<Import Project="Parent.Directory.Packages.props" Condition="$(BuiltInMonoRepo) != 'true'" />
</Project>
65 changes: 65 additions & 0 deletions Parent.Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<Project>
<PropertyGroup>
<BuiltInMonoRepo>false</BuiltInMonoRepo>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
</PropertyGroup>
<!-- Project packages -->
<ItemGroup>
<PackageVersion Include="Humanizer.Core" Version="2.14.1"/>
<PackageVersion Include="Polyfill" Version="7.9.1"/>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.1" />
<PackageVersion Include="TypeNameFormatter.Sources" Version="1.1.1"/>
<PackageVersion Include="System.Text.Json" Version="8.0.5"/>
<PackageVersion Include="ValueTaskSupplement" Version="1.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0"/>
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11"/>
</ItemGroup>
<!-- Test packages -->
<ItemGroup>
<PackageVersion Include="BunsenBurner" Version="7.0.1" Condition="$(BuiltInMonoRepo) != 'true'"/>
<PackageVersion Include="Docfx.ResultSnippets" Version="2.0.0" Condition="$(BuiltInMonoRepo) != 'true'"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.2"/>
<PackageVersion Include="Polly" Version="8.5.2"/>
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
<PackageVersion Include="Verify.XunitV3" Version="28.10.1"/>
<PackageVersion Include="xunit.v3" Version="1.1.0"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2"/>
</ItemGroup>
<!-- Benchmark pacakges -->
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0"/>
<PackageVersion Include="BenchmarkDotNet.Diagnostics.dotTrace" Version="0.14.0"/>
</ItemGroup>
<!-- Pinned Transitive packages -->
<ItemGroup>
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
<!-- Shared analysers -->
<ItemGroup>
<GlobalPackageReference Include="AsyncFixer" Version="1.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</GlobalPackageReference>
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.186">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</GlobalPackageReference>
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.12.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</GlobalPackageReference>
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.6.0.109712">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</GlobalPackageReference>
</ItemGroup>
</Project>
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "http-buildr",
"name": "bmazzarol",
"version": "1.0.0",
"devDependencies": {
"@commitlint/cli": "^19.6.1",
Expand Down
Loading

0 comments on commit 9b4ee8f

Please sign in to comment.