WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit a7acc91

Browse files
authored
Merge pull request #26 from BenjaminAbt/feature/overhead-files
2 parents f1d7074 + 16e6bea commit a7acc91

File tree

106 files changed

+725
-480
lines changed

Some content is hidden

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

106 files changed

+725
-480
lines changed

.editorconfig

Lines changed: 225 additions & 88 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

Lines changed: 13 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,18 @@ on:
77
pull_request:
88
branches:
99
- main
10-
11-
permissions:
12-
contents: read
13-
actions: read
14-
checks: write
15-
16-
env:
17-
BuildConfig: Release
18-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
10+
release:
11+
types: [published]
1912

2013
jobs:
21-
build:
22-
runs-on: ubuntu-latest
23-
steps:
24-
25-
- name: Cancel previous builds in PR
26-
uses: styfle/[email protected]
27-
with:
28-
access_token: ${{ github.token }}
29-
30-
- name: Checkout code
31-
uses: actions/checkout@v4
32-
with:
33-
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
34-
35-
- name: Setup .NET SDK
36-
uses: actions/setup-dotnet@v4
37-
with:
38-
global-json-file: ./global.json
39-
40-
- name: Restore dependencies
41-
run: dotnet restore
42-
43-
- name: Setup Git Versioning
44-
uses: dotnet/nbgv@master
45-
id: nbgv
46-
47-
- name: Show Version Info
48-
run: |
49-
echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'
50-
51-
- name: Build with dotnet
52-
run: dotnet build
53-
--no-restore --configuration ${{ env.BuildConfig }}
54-
/p:Version=${{ steps.nbgv.outputs.AssemblyVersion }}
55-
56-
- name: Test with dotnet
57-
run: dotnet test
58-
--no-build --configuration ${{ env.BuildConfig }}
59-
--logger "trx;LogFileName=test-results.trx" --results-directory ./artifacts/testResults
60-
continue-on-error: true
61-
62-
- name: Test Report
63-
uses: dorny/test-reporter@v1
64-
if: always()
65-
with:
66-
name: DotNET Tests
67-
path: "./artifacts/testResults/test-results.trx"
68-
reporter: dotnet-trx
69-
fail-on-error: true
70-
71-
- name: Pack NuGet
72-
run: dotnet pack
73-
--configuration ${{ env.BuildConfig }}
74-
/p:ContinuousIntegrationBuild=true
75-
/p:Version=${{ steps.nbgv.outputs.NuGetPackageVersion }}
76-
77-
- name: Push to NuGet
78-
run: dotnet nuget push **/*.nupkg
79-
--api-key ${{ secrets.NUGET_DEPLOY_KEY }}
80-
--source https://api.nuget.org/v3/index.json
81-
--no-symbols
82-
--skip-duplicate
14+
build:
15+
uses: mycsharp/github-actions/.github/workflows/dotnet-nuget-build-multi-sdk.yml@main
16+
with:
17+
configuration: Release
18+
dotnet-sdks: |
19+
8.0.x
20+
9.0.x
21+
10.0.x
22+
23+
secrets:
24+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

Directory.Build.props

Lines changed: 116 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,130 @@
11
<Project>
2+
<PropertyGroup Label="Project">
3+
<Product>BenjaminAbt.StrongOf</Product>
4+
<Authors>Benjamin Abt, SchwabenCode</Authors>
5+
<Company>Benjamin Abt</Company>
6+
<Copyright>Benjamin Abt</Copyright>
7+
</PropertyGroup>
28

3-
<!-- Head -->
4-
<PropertyGroup>
5-
<Company>Benjamin Abt</Company>
6-
<Authors>Benjamin Abt, SchwabenCode</Authors>
7-
<Product>BenjaminAbt.StrongOf</Product>
8-
<Copyright>Benjamin Abt</Copyright>
9-
<Title>StrongOf - Strong Type your stuff!</Title>
10-
<Description>
11-
StrongOf helps to implement primitives as a strong type that represents a domain object (e.g. UserId, EmailAddress, etc.). It is a simple class that wraps a value and provides a few helper methods to make it easier to work with.
12-
In contrast to other approaches, StrongOf is above all simple and performant - and not over-engineered.
13-
</Description>
14-
<DefaultLanguage>en-US</DefaultLanguage>
15-
<NoPackageAnalysis>true</NoPackageAnalysis>
16-
<DebugType>embedded</DebugType>
17-
</PropertyGroup>
9+
<PropertyGroup Label="Vars">
10+
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
11+
<IsOSX Condition="$([MSBuild]::IsOSPlatform('OSX'))">true</IsOSX>
12+
<IsLinux Condition="$([MSBuild]::IsOSPlatform('Linux'))">true</IsLinux>
13+
14+
<IsTestProject>$(MSBuildProjectName.EndsWith('Tests'))</IsTestProject>
15+
<IsUnitTestProject>$(MSBuildProjectName.EndsWith('UnitTests'))</IsUnitTestProject>
16+
<IsIntegrationTestProject>$(MSBuildProjectName.EndsWith('IntegrationTests'))</IsIntegrationTestProject>
17+
<IsBenchmarkProject>$(MsBuildProjectName.EndsWith('Benchmarks'))</IsBenchmarkProject>
18+
</PropertyGroup>
19+
20+
<PropertyGroup Label="Assembly">
21+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
22+
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
23+
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
24+
</PropertyGroup>
1825

19-
<PropertyGroup Label="Env">
20-
<IsUnitTestProject>$(MSBuildProjectName.EndsWith('UnitTests'))</IsUnitTestProject>
21-
<IsBenchmarkProject>$(MsBuildProjectName.Contains('Benchmark'))</IsBenchmarkProject>
22-
</PropertyGroup>
26+
<PropertyGroup>
27+
<SignAssembly>true</SignAssembly>
28+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)BenjaminAbt.StrongOf.snk</AssemblyOriginatorKeyFile>
2329

24-
<PropertyGroup Label="Assembly">
25-
<GlobalNamespacePrefix>StrongOf</GlobalNamespacePrefix>
26-
<GlobalAssemblyNamePrefix>BenjaminAbt.StrongOf</GlobalAssemblyNamePrefix>
27-
</PropertyGroup>
30+
<PublicKey>
31+
0024000004800000940000000602000000240000525341310004000001000100a19f5c9b522bba
32+
2b14442a92edac88ebfad09ade036005cdbcfdb574e78f5b60612a92b18b73acb1a3ecc933fb2d
33+
5836f648ef15819a49eea44b6de6d9966375cc4fa08f523c18463f4ee57ef3ed63500a993e125f
34+
44a374ea17b450962a1b14a13d8ccb0c36d7d3886e54a739103aa32d8c66b92aa25880e80ec088
35+
1e91649c
36+
</PublicKey>
37+
</PropertyGroup>
2838

29-
<PropertyGroup Label="Project Defaults">
30-
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
31-
</PropertyGroup>
39+
<PropertyGroup Label="Compiler">
40+
<LangVersion>preview</LangVersion>
41+
<DebugType>embedded</DebugType>
42+
<Nullable>enable</Nullable>
43+
<DefaultLanguage>en-US</DefaultLanguage>
44+
<ImplicitUsings>enable</ImplicitUsings>
45+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
46+
</PropertyGroup>
3247

33-
<PropertyGroup Label="Package">
34-
<IsPackable>false</IsPackable>
35-
<PackageProjectUrl>https://github.com/BenjaminAbt/StrongOf</PackageProjectUrl>
36-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
37-
<Description>StrongOf - Strong Type your stuff and fight primitive Obsession with .NET</Description>
38-
<MinClientVersion>2.12</MinClientVersion>
39-
<PackageTags>Strong, StrongOf, DDD, Value Objects, Domain Driven Design</PackageTags>
40-
<IsPackable>false</IsPackable>
41-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
42-
</PropertyGroup>
48+
<PropertyGroup Label="Package">
49+
<IsPackable>false</IsPackable>
50+
<NoPackageAnalysis>true</NoPackageAnalysis>
51+
<MinClientVersion>2.12</MinClientVersion>
52+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
53+
54+
<Title>StrongOf - Strong Type your stuff!</Title>
55+
<Description>
56+
StrongOf helps to implement primitives as a strong type that represents a domain object (e.g. UserId, EmailAddress, etc.). It is a simple class that wraps a value and provides a few helper methods to make it easier to work with.
57+
In contrast to other approaches, StrongOf is above all simple and performant - and not over-engineered.
58+
</Description>
59+
<PackageProjectUrl>https://github.com/BenjaminAbt/StrongOf</PackageProjectUrl>
60+
<RepositoryUrl>https://github.com/BenjaminAbt/StrongOf</RepositoryUrl>
61+
<PackageTags>Strong, StrongOf, DDD, Value Objects, Domain Driven Design</PackageTags>
62+
</PropertyGroup>
4363

44-
<PropertyGroup Label="C#">
45-
<LangVersion>preview</LangVersion>
46-
<Nullable>enable</Nullable>
47-
<ImplicitUsings>enable</ImplicitUsings>
48-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
49-
</PropertyGroup>
64+
<PropertyGroup Condition="'$(IsTestProject)' != 'true' AND '$(IsBenchmarkProject)' != 'true'">
65+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
66+
</PropertyGroup>
5067

51-
<PropertyGroup Condition="'$(IsUnitTestProject)' != 'true' AND '$(IsBenchmarkProject)' != 'true'">
52-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
53-
</PropertyGroup>
68+
<PropertyGroup Label="Visual Studio">
69+
<!-- https://devblogs.microsoft.com/visualstudio/visual-studio-2022-17-5-performance-enhancements/ -->
70+
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
71+
</PropertyGroup>
5472

73+
<PropertyGroup Label="NuGet Audit">
74+
<NuGetAudit>true</NuGetAudit>
75+
<NuGetAuditMode>all</NuGetAuditMode>
76+
<NuGetAuditLevel>low</NuGetAuditLevel>
77+
</PropertyGroup>
5578

56-
<PropertyGroup>
57-
<SignAssembly>true</SignAssembly>
58-
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)BenjaminAbt.StrongOf.snk</AssemblyOriginatorKeyFile>
79+
<ItemGroup Label="Default Test Dependencies" Condition="'$(IsTestProject)' == 'true'">
80+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
81+
<PackageReference Include="Microsoft.Extensions.Diagnostics.Testing" />
82+
<PackageReference Include="NSubstitute" />
83+
<PackageReference Include="NSubstitute.Analyzers.CSharp">
84+
<PrivateAssets>all</PrivateAssets>
85+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
86+
</PackageReference>
87+
<PackageReference Include="xunit.v3" />
88+
<PackageReference Include="xunit.v3.extensibility.core"/>
89+
<PackageReference Include="xunit.v3.assert" />
90+
<PackageReference Include="xunit.runner.console">
91+
<PrivateAssets>all</PrivateAssets>
92+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
93+
</PackageReference>
94+
<PackageReference Include="xunit.runner.visualstudio">
95+
<PrivateAssets>all</PrivateAssets>
96+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
97+
</PackageReference>
98+
</ItemGroup>
5999

60-
<PublicKey>
61-
0024000004800000940000000602000000240000525341310004000001000100a19f5c9b522bba
62-
2b14442a92edac88ebfad09ade036005cdbcfdb574e78f5b60612a92b18b73acb1a3ecc933fb2d
63-
5836f648ef15819a49eea44b6de6d9966375cc4fa08f523c18463f4ee57ef3ed63500a993e125f
64-
44a374ea17b450962a1b14a13d8ccb0c36d7d3886e54a739103aa32d8c66b92aa25880e80ec088
65-
1e91649c
66-
</PublicKey>
67-
</PropertyGroup>
100+
<ItemGroup Label="Default Analyzers">
101+
<PackageReference Include="Roslynator.Analyzers">
102+
<PrivateAssets>all</PrivateAssets>
103+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
104+
</PackageReference>
105+
<PackageReference Include="Roslynator.Formatting.Analyzers">
106+
<PrivateAssets>all</PrivateAssets>
107+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
108+
</PackageReference>
109+
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers">
110+
<PrivateAssets>all</PrivateAssets>
111+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
112+
</PackageReference>
113+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
114+
<PackageReference Include="Microsoft.CodeAnalysis.Common" />
115+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
116+
<PackageReference Include="Meziantou.Analyzer">
117+
<PrivateAssets>all</PrivateAssets>
118+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
119+
</PackageReference>
120+
</ItemGroup>
68121

69-
<ItemGroup Label="Analyzers">
70-
<PackageReference Include="Roslynator.Analyzers">
71-
<PrivateAssets>all</PrivateAssets>
72-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
73-
</PackageReference>
74-
<PackageReference Include="Roslynator.Formatting.Analyzers">
75-
<PrivateAssets>all</PrivateAssets>
76-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
77-
</PackageReference>
78-
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers">
79-
<PrivateAssets>all</PrivateAssets>
80-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
81-
</PackageReference>
82-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
83-
<PackageReference Include="Microsoft.CodeAnalysis.Common" />
84-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
85-
<PackageReference Include="Meziantou.Analyzer">
86-
<PrivateAssets>all</PrivateAssets>
87-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
88-
</PackageReference>
89-
</ItemGroup>
122+
<!-- Block Projects with Privacy/Security/License Concerns -->
123+
<Target Name="CheckBlockedPackages" AfterTargets="ResolvePackageDependenciesForBuild">
124+
<Error Code="420" Text="Blocked package dependency detected: %(PackageDependencies.Identity)"
125+
Condition="'%(PackageDependencies.Identity)' == 'Devlooped.SponsorLink'" />
126+
<Error Code="420" Text="Blocked package dependency detected: %(PackageDependencies.Identity)"
127+
Condition="'%(PackageDependencies.Identity)' == 'FluentAssertions'" />
128+
</Target>
90129

91-
<ItemGroup Condition="'$(IsUnitTestProject)' == 'true'">
92-
<PackageReference Include="Microsoft.NET.Test.Sdk" />
93-
<PackageReference Include="NSubstitute" />
94-
<PackageReference Include="NSubstitute.Analyzers.CSharp">
95-
<PrivateAssets>all</PrivateAssets>
96-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
97-
</PackageReference>
98-
<PackageReference Include="xunit.v3" />
99-
<PackageReference Include="xunit.v3.extensibility.core"/>
100-
<PackageReference Include="xunit.v3.assert" />
101-
<PackageReference Include="xunit.runner.console">
102-
<PrivateAssets>all</PrivateAssets>
103-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
104-
</PackageReference>
105-
<PackageReference Include="xunit.runner.visualstudio">
106-
<PrivateAssets>all</PrivateAssets>
107-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
108-
</PackageReference>
109-
<PackageReference Include="FluentValidation" />
110-
</ItemGroup>
111130
</Project>

0 commit comments

Comments
 (0)