Skip to content

Commit

Permalink
Migrate to latest project structure and merge abstractions into base lib
Browse files Browse the repository at this point in the history
  • Loading branch information
mikernet committed Mar 9, 2024
1 parent d7e99c9 commit c502042
Show file tree
Hide file tree
Showing 66 changed files with 1,244 additions and 1,415 deletions.
61 changes: 56 additions & 5 deletions Source/.editorconfig → .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ root = true

guidelines = 160

########### C# Project files ###########
########### Project XML files ###########
[*.csproj]

#### Core EditorConfig Options ####
indent_size = 2
indent_style = space
tab_width = 2

[*.props]

indent_size = 2
indent_style = space
tab_width = 2

[*.targets]

# Indentation and spacing
indent_size = 2
indent_style = space
tab_width = 2
Expand Down Expand Up @@ -81,10 +90,13 @@ dotnet_code_quality_unused_parameters = all:suggestion

#### C# Coding Conventions ####

# Namespace preferences
csharp_style_namespace_declarations = file_scoped:warning

# var preferences
csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = true:warning

# Expression-bodied members
csharp_style_expression_bodied_accessors = true:suggestion
Expand Down Expand Up @@ -184,6 +196,14 @@ dotnet_naming_rule.types_should_be_pascalcase.severity = warning
dotnet_naming_rule.types_should_be_pascalcase.symbols = types
dotnet_naming_rule.types_should_be_pascalcase.style = pascalcase

dotnet_naming_rule.private_static_field_should_be_s_prefixed_camelcase.severity = none
dotnet_naming_rule.private_static_field_should_be_s_prefixed_camelcase.symbols = private_static_field
dotnet_naming_rule.private_static_field_should_be_s_prefixed_camelcase.style = prefixed_camelcase

dotnet_naming_rule.private_field_should_be_prefixed_camelcase.severity = warning
dotnet_naming_rule.private_field_should_be_prefixed_camelcase.symbols = private_field
dotnet_naming_rule.private_field_should_be_prefixed_camelcase.style = prefixed_camelcase

dotnet_naming_rule.constant_field_should_be_pascalcase.severity = warning
dotnet_naming_rule.constant_field_should_be_pascalcase.symbols = constant_field
dotnet_naming_rule.constant_field_should_be_pascalcase.style = pascalcase
Expand All @@ -209,12 +229,25 @@ dotnet_naming_symbols.constant_field.applicable_kinds = field
dotnet_naming_symbols.constant_field.applicable_accessibilities = public, internal, private, protected, protected_internal
dotnet_naming_symbols.constant_field.required_modifiers = const

dotnet_naming_symbols.private_static_field.applicable_kinds = field
dotnet_naming_symbols.private_static_field.applicable_accessibilities = private
dotnet_naming_symbols.private_static_field.required_modifiers = static

dotnet_naming_symbols.private_field.applicable_kinds = field
dotnet_naming_symbols.private_field.applicable_accessibilities = private
dotnet_naming_symbols.private_field.required_modifiers =

# Naming styles
dotnet_naming_style.pascalcase.required_prefix =
dotnet_naming_style.pascalcase.required_suffix =
dotnet_naming_style.pascalcase.word_separator =
dotnet_naming_style.pascalcase.capitalization = pascal_case

dotnet_naming_style.prefixed_camelcase.required_prefix = _
dotnet_naming_style.prefixed_camelcase.required_suffix =
dotnet_naming_style.prefixed_camelcase.word_separator =
dotnet_naming_style.prefixed_camelcase.capitalization = camel_case

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
Expand Down Expand Up @@ -346,3 +379,21 @@ dotnet_diagnostic.SA1519.severity = silent

# SA1214: Readonly fields should appear before non-readonly fields
dotnet_diagnostic.SA1214.severity = suggestion

# SA1518: Use line endings correctly at end of file
dotnet_diagnostic.SA1518.severity = none

# SA1402: File may only contain a single type
dotnet_diagnostic.SA1402.severity = none

# IDE0028: Simplify collection initialization
dotnet_diagnostic.IDE0028.severity = warning

# IDE0057: Use range operator
dotnet_diagnostic.IDE0057.severity = warning

# IDE0059: Unnecessary assignment of a value
dotnet_diagnostic.IDE0059.severity = warning

# RS0030: Do not use banned APIs
dotnet_diagnostic.RS0030.severity = error
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ updates:
interval: weekly
- package-ecosystem: "github-actions"
directory: "/"
schedule:
schedule:
interval: weekly
target-branch: main
12 changes: 3 additions & 9 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Clean
run: dotnet clean --configuration Debug && dotnet nuget locals all --clear
working-directory: Source
- name: Install dependencies
run: dotnet restore
working-directory: Source
- name: Build
run: dotnet build --configuration Debug --no-restore
working-directory: Source
- name: Test
run: dotnet test --configuration Debug --no-build --verbosity normal
working-directory: Source

release-windows:

Expand All @@ -44,15 +41,12 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
working-directory: Source
- name: Install dependencies
run: dotnet restore
working-directory: Source
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: Source
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
working-directory: Source
run: dotnet test --configuration Release --no-build --verbosity normal
30 changes: 30 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project>
<PropertyGroup>
<LangVersion>12.0</LangVersion>
<Nullable Condition="'$(TargetFramework)' != 'netstandard2.0'">enable</Nullable>
<Nullable Condition="'$(TargetFramework)' == 'netstandard2.0'">annotations</Nullable>
<NoWarn>CS8769</NoWarn>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<WeaverConfiguration>
<Weavers>
<RuntimeNullables />
</Weavers>
</WeaverConfiguration>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<!-- Fody -->
<PackageReference Include="RuntimeNullables.Fody" Version="1.0.6" PrivateAssets="all" />

<!-- Analyzers -->
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.11.0" PrivateAssets="all" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

The MIT License (MIT)

Copyright (c) 2023
Copyright (c) 2023 Singulink

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
101 changes: 101 additions & 0 deletions Singulink.Collections.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Singulink.Collections", "Source\Singulink.Collections\Singulink.Collections.csproj", "{1078945F-D4EB-45D7-BD1F-EF33D7A7D308}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Singulink.Collections.Weak", "Source\Singulink.Collections.Weak\Singulink.Collections.Weak.csproj", "{D13CB713-78B9-422B-9BAF-2A35B434FA42}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Singulink.Collections.Tests", "Tests\Singulink.Collections.Tests\Singulink.Collections.Tests.csproj", "{221DC5F0-312A-4FB8-B2FC-D171C921CED6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Singulink.Collections.Weak.Tests", "Tests\Singulink.Collections.Weak.Tests\Singulink.Collections.Weak.Tests.csproj", "{2F4F3F7C-86C3-473D-90D1-9EFC7147B8D8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{3F3E66F3-E5F4-4243-AB36-583AC6BDDB22}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D641285C-EB50-4B2E-9FCB-6650DAA65342}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{77D5520C-C625-44CF-9D13-94563173C295}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
CHANGELOG.md = CHANGELOG.md
Directory.Build.props = Directory.Build.props
LICENSE.md = LICENSE.md
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{13264A11-5846-4A14-8E15-0A54AA04BEAB}"
ProjectSection(SolutionItems) = preProject
Docs\docfx.json = Docs\docfx.json
Docs\index.md = Docs\index.md
Docs\toc.yml = Docs\toc.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{85134FD9-55CA-477B-A8E9-E3F8A6B323F1}"
ProjectSection(SolutionItems) = preProject
Docs\api\index.md = Docs\api\index.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{4C819D2C-90B2-4490-B5B0-53F1DD9D9EE1}"
ProjectSection(SolutionItems) = preProject
.github\dependabot.yml = .github\dependabot.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source Items", "Source Items", "{E264B84B-C48C-4D27-8FD2-8C2DE0BAB9B2}"
ProjectSection(SolutionItems) = preProject
Source\Directory.Build.props = Source\Directory.Build.props
Source\Directory.Build.targets = Source\Directory.Build.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test Items", "Test Items", "{3C98511D-3E04-4D16-B96C-8EFC5216CF4E}"
ProjectSection(SolutionItems) = preProject
Tests\.editorconfig = Tests\.editorconfig
Tests\BannedSymbols.txt = Tests\BannedSymbols.txt
Tests\Directory.Build.props = Tests\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{6371A96E-144C-47C4-BB04-8BC4E6ADA28F}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1078945F-D4EB-45D7-BD1F-EF33D7A7D308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1078945F-D4EB-45D7-BD1F-EF33D7A7D308}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1078945F-D4EB-45D7-BD1F-EF33D7A7D308}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1078945F-D4EB-45D7-BD1F-EF33D7A7D308}.Release|Any CPU.Build.0 = Release|Any CPU
{D13CB713-78B9-422B-9BAF-2A35B434FA42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D13CB713-78B9-422B-9BAF-2A35B434FA42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D13CB713-78B9-422B-9BAF-2A35B434FA42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D13CB713-78B9-422B-9BAF-2A35B434FA42}.Release|Any CPU.Build.0 = Release|Any CPU
{221DC5F0-312A-4FB8-B2FC-D171C921CED6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{221DC5F0-312A-4FB8-B2FC-D171C921CED6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{221DC5F0-312A-4FB8-B2FC-D171C921CED6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{221DC5F0-312A-4FB8-B2FC-D171C921CED6}.Release|Any CPU.Build.0 = Release|Any CPU
{2F4F3F7C-86C3-473D-90D1-9EFC7147B8D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F4F3F7C-86C3-473D-90D1-9EFC7147B8D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F4F3F7C-86C3-473D-90D1-9EFC7147B8D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F4F3F7C-86C3-473D-90D1-9EFC7147B8D8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1078945F-D4EB-45D7-BD1F-EF33D7A7D308} = {3F3E66F3-E5F4-4243-AB36-583AC6BDDB22}
{D13CB713-78B9-422B-9BAF-2A35B434FA42} = {3F3E66F3-E5F4-4243-AB36-583AC6BDDB22}
{221DC5F0-312A-4FB8-B2FC-D171C921CED6} = {D641285C-EB50-4B2E-9FCB-6650DAA65342}
{2F4F3F7C-86C3-473D-90D1-9EFC7147B8D8} = {D641285C-EB50-4B2E-9FCB-6650DAA65342}
{85134FD9-55CA-477B-A8E9-E3F8A6B323F1} = {13264A11-5846-4A14-8E15-0A54AA04BEAB}
{E264B84B-C48C-4D27-8FD2-8C2DE0BAB9B2} = {3F3E66F3-E5F4-4243-AB36-583AC6BDDB22}
{3C98511D-3E04-4D16-B96C-8EFC5216CF4E} = {D641285C-EB50-4B2E-9FCB-6650DAA65342}
{6371A96E-144C-47C4-BB04-8BC4E6ADA28F} = {4C819D2C-90B2-4490-B5B0-53F1DD9D9EE1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A726AC5A-8E85-4678-ABD0-6746252A4C38}
EndGlobalSection
EndGlobal
47 changes: 22 additions & 25 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
<Project>
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AnnotatedReferenceAssemblyVersion>6.0.0</AnnotatedReferenceAssemblyVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<Authors>Singulink</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>© Singulink. All rights reserved.</Copyright>
<PackageIcon>Singulink Icon 128x128.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="RuntimeNullables.Fody" Version="1.0.5" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup Label="Source Link" Condition="'$(Configuration)' == 'Release'">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup Label="Analyzers">
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.3" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.4.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Label="Source Link" Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="Nullable Annotations" Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]"/>
</ItemGroup>
<ItemGroup>
<None Include="..\..\Resources\Singulink Icon 128x128.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>
Loading

0 comments on commit c502042

Please sign in to comment.