Skip to content

Commit ffc4b78

Browse files
v1.0.0 (#1)
* Initial version of the packages.
1 parent 218a4ec commit ffc4b78

File tree

266 files changed

+20173
-2
lines changed

Some content is hidden

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

266 files changed

+20173
-2
lines changed

.editorconfig

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8-bom
5+
insert_final_newline = false
6+
trim_trailing_whitespace = true
7+
8+
# Markdown specific settings
9+
[*.md]
10+
indent_style = space
11+
indent_size = 2
12+
13+
# YAML specific settings
14+
[*.yaml]
15+
indent_style = space
16+
indent_size = 2
17+
18+
# x.proj specific settings
19+
[*.{csproj,props}]
20+
indent_style = space
21+
indent_size = 2
22+
23+
[*.{cs,vb}]
24+
25+
#### Naming styles ####
26+
tab_width = 4
27+
indent_size = 4
28+
end_of_line = crlf
29+
30+
csharp_style_prefer_primary_constructors = false:suggestion
31+
csharp_using_directive_placement = inside_namespace:warning
32+
33+
# Naming rules
34+
35+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
36+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
37+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
38+
39+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
40+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
41+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
42+
43+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
44+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
45+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
46+
47+
# Symbol specifications
48+
49+
dotnet_naming_symbols.interface.applicable_kinds = interface
50+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
51+
dotnet_naming_symbols.interface.required_modifiers =
52+
53+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
54+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
55+
dotnet_naming_symbols.types.required_modifiers =
56+
57+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
58+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
59+
dotnet_naming_symbols.non_field_members.required_modifiers =
60+
61+
# Naming styles
62+
63+
dotnet_naming_style.begins_with_i.required_prefix = I
64+
dotnet_naming_style.begins_with_i.required_suffix =
65+
dotnet_naming_style.begins_with_i.word_separator =
66+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
67+
68+
dotnet_naming_style.pascal_case.required_prefix =
69+
dotnet_naming_style.pascal_case.required_suffix =
70+
dotnet_naming_style.pascal_case.word_separator =
71+
dotnet_naming_style.pascal_case.capitalization = pascal_case
72+
73+
dotnet_naming_style.pascal_case.required_prefix =
74+
dotnet_naming_style.pascal_case.required_suffix =
75+
dotnet_naming_style.pascal_case.word_separator =
76+
dotnet_naming_style.pascal_case.capitalization = pascal_case
77+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
78+
dotnet_style_coalesce_expression = true:suggestion
79+
dotnet_style_namespace_match_folder = false:suggestion
80+
dotnet_style_null_propagation = true:suggestion
81+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
82+
dotnet_style_prefer_auto_properties = true:silent
83+
dotnet_style_object_initializer = true:suggestion
84+
dotnet_style_collection_initializer = true:suggestion
85+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
86+
87+
### Visual Studio ###
88+
89+
# IDE0005: Using directive is unnecessary.
90+
dotnet_diagnostic.IDE0005.severity = warning
91+
92+
# IDE0130: Namespace does not match folder structure
93+
dotnet_diagnostic.IDE0130.severity = none
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
push:
7+
branches: [ "releases/**" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
checks: write
15+
pull-requests: write
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: 9.0.x
24+
25+
- name: Restore dependencies
26+
run: dotnet restore PosInformatique.Foundations.slnx
27+
28+
- name: Build solution
29+
run: |
30+
dotnet build PosInformatique.Foundations.slnx \
31+
--configuration Release \
32+
--no-restore
33+
34+
- name: Run tests (.NET 8.0)
35+
run: |
36+
dotnet test PosInformatique.Foundations.slnx \
37+
--configuration Release \
38+
--no-build \
39+
--logger "trx" \
40+
--results-directory ./TestResults \
41+
--collect "XPlat Code Coverage" \
42+
--framework net8.0
43+
44+
- name: Run tests (.NET 9.0)
45+
run: |
46+
dotnet test PosInformatique.Foundations.slnx \
47+
--configuration Release \
48+
--no-build \
49+
--logger "trx" \
50+
--results-directory ./TestResults \
51+
--collect "XPlat Code Coverage" \
52+
--framework net9.0
53+
54+
- name: Publish Test Results
55+
uses: EnricoMi/publish-unit-test-result-action@v2
56+
if: (!cancelled())
57+
with:
58+
files: |
59+
TestResults/**/*.trx
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
VersionPrefix:
7+
type: string
8+
description: The version of the library
9+
required: true
10+
default: 1.0.0
11+
VersionSuffix:
12+
type: string
13+
description: The version suffix of the library (for example rc.1)
14+
15+
run-name: ${{ inputs.VersionSuffix && format('{0}-{1}', inputs.VersionPrefix, inputs.VersionSuffix) || inputs.VersionPrefix }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: '9.x'
27+
28+
- name: Build all the NuGet packages
29+
run: |
30+
dotnet pack PosInformatique.Foundations.slnx \
31+
--configuration Release \
32+
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }} \
33+
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }} \
34+
--output ./artifacts
35+
36+
- name: Publish the package to nuget.org
37+
run: |
38+
dotnet nuget push "./artifacts/*.nupkg" \
39+
--api-key "${{ secrets.NUGET_APIKEY }}" \
40+
--source https://api.nuget.org/v3/index.json \
41+
--skip-duplicate

CodeCoverage.runsettings

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RunSettings>
3+
<DataCollectionRunSettings>
4+
<DataCollectors>
5+
<!-- Data Collector for Visual Studio -->
6+
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
7+
<Configuration>
8+
<CodeCoverage>
9+
10+
<!-- Match assembly file paths: -->
11+
<ModulePaths>
12+
<Include>
13+
<ModulePath>.*\.dll$</ModulePath>
14+
</Include>
15+
<Exclude>
16+
<ModulePath>.*xunit.*</ModulePath>
17+
<ModulePath>.*webjobs.*</ModulePath>
18+
<ModulePath>bunit.*</ModulePath>
19+
<ModulePath>fluentvalidation.*</ModulePath>
20+
<ModulePath>moq.*</ModulePath>
21+
<ModulePath>.*durabletask.*</ModulePath>
22+
<ModulePath>microsoft.*</ModulePath>
23+
<ModulePath>.*tests\.dll$</ModulePath>
24+
</Exclude>
25+
</ModulePaths>
26+
27+
<Attributes>
28+
<Exclude>
29+
<!-- Exclude generated code from code coverage -->
30+
<Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute>
31+
<Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>
32+
</Exclude>
33+
</Attributes>
34+
35+
<Functions>
36+
<Exclude>
37+
<Function>^MimeKit\..*</Function>
38+
</Exclude>
39+
</Functions>
40+
41+
<Sources>
42+
<Exclude>
43+
<Source>.*\.razor</Source>
44+
<Source>.*\.cshtml</Source>
45+
</Exclude>
46+
</Sources>
47+
48+
<!-- We recommend you do not change the following values: -->
49+
<UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
50+
<AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
51+
<CollectFromChildProcesses>True</CollectFromChildProcesses>
52+
<CollectAspDotNet>False</CollectAspDotNet>
53+
54+
</CodeCoverage>
55+
</Configuration>
56+
</DataCollector>
57+
58+
<!-- Data Collector for the CI build -->
59+
<DataCollector friendlyName="XPlat Code Coverage">
60+
<!-- Documentation: https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md -->
61+
62+
<Configuration>
63+
<Format>opencover,cobertura</Format>
64+
<Exclude>[MimeKit.*]*</Exclude>
65+
<ExcludeByAttribute>GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
66+
<ExcludeByFile>**/*.razor,**/*.razor.cs,**/*.cshtml</ExcludeByFile>
67+
<IncludeTestAssembly>false</IncludeTestAssembly>
68+
</Configuration>
69+
70+
</DataCollector>
71+
</DataCollectors>
72+
</DataCollectionRunSettings>
73+
</RunSettings>

Directory.Build.props

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<Project>
2+
3+
<!-- Common properties -->
4+
<PropertyGroup>
5+
<Authors>Gilles TOURREAU</Authors>
6+
<Company>P.O.S Informatique</Company>
7+
<Product>P.O.S Informatique</Product>
8+
<Copyright>Copyright (c) P.O.S Informatique. All rights reserved.</Copyright>
9+
<RepositoryUrl>https://github.com/PosInformatique/PosInformatique.Foundations</RepositoryUrl>
10+
<RepositoryType>git</RepositoryType>
11+
12+
<!-- Enable the last version of C# -->
13+
<LangVersion>latest</LangVersion>
14+
15+
<!-- Enable implict usings -->
16+
<ImplicitUsings>enable</ImplicitUsings>
17+
18+
<!-- Disable the StyleCop 'XML comment analysis is disabled due to project configuration' warning. -->
19+
<NoWarn>$(NoWarn);SA0001;NU1903</NoWarn>
20+
21+
<!-- Enforce .editorconfig style on build -->
22+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
23+
24+
<!-- By default prefix all the assemblies name with ChantierConnect -->
25+
<AssemblyName>PosInformatique.Foundations.$(MSBuildProjectName)</AssemblyName>
26+
<RootNamespace>PosInformatique.Foundations.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<AdditionalFiles Include="..\..\stylecop.json">
31+
<Link>stylecop.json</Link>
32+
</AdditionalFiles>
33+
</ItemGroup>
34+
35+
<!-- Common NuGet packages -->
36+
<ItemGroup>
37+
<PackageReference Include="SonarAnalyzer.CSharp">
38+
<PrivateAssets>all</PrivateAssets>
39+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
40+
</PackageReference>
41+
<PackageReference Include="StyleCop.Analyzers">
42+
<PrivateAssets>all</PrivateAssets>
43+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
44+
</PackageReference>
45+
</ItemGroup>
46+
47+
<!-- Add the default using directive for all the code -->
48+
<ItemGroup>
49+
<Using Include="System" />
50+
<Using Include="System.Collections.ObjectModel" />
51+
<Using Include="System.Threading.Tasks" />
52+
</ItemGroup>
53+
54+
</Project>

Directory.Packages.props

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
<!-- Versions of the packages -->
5+
<DotNetVersion Condition="'$(TargetFramework)' == 'net8.0'">8.0.0</DotNetVersion>
6+
<DotNetVersion Condition="'$(TargetFramework)' == 'net9.0'">9.0.0</DotNetVersion>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageVersion Include="Azure.Communication.Email" Version="1.0.0" />
10+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
11+
<PackageVersion Include="FluentAssertions" Version="7.2.0" />
12+
<PackageVersion Include="FluentValidation" Version="12.0.0" />
13+
<PackageVersion Include="libphonenumber-csharp" Version="9.0.1" />
14+
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="$(DotNetVersion)" />
15+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="$(DotNetVersion)" />
16+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(DotNetVersion)" />
17+
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.2" />
18+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(DotNetVersion)" />
19+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(DotNetVersion)" />
20+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(DotNetVersion)" />
21+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(DotNetVersion)" />
22+
<PackageVersion Include="Microsoft.Extensions.Options" Version="$(DotNetVersion)" />
23+
<PackageVersion Include="Microsoft.Graph" Version="5.89.0" />
24+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
25+
<PackageVersion Include="Moq" Version="4.20.72" />
26+
<PackageVersion Include="PosInformatique.FluentAssertions.Json" Version="1.6.0" />
27+
<PackageVersion Include="PosInformatique.Moq.Analyzers" Version="2.0.1" />
28+
<PackageVersion Include="Scriban" Version="6.5.0" />
29+
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.15.0.120848" />
30+
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
31+
<PackageVersion Include="xunit.v3" Version="3.2.0" />
32+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
33+
</ItemGroup>
34+
</Project>

Icon.png

38.4 KB
Loading

0 commit comments

Comments
 (0)