Skip to content

Commit af0b4cb

Browse files
authored
Merge pull request #17 from astar-development/features/misc-new-helpers
Features/misc new helpers
2 parents c6b95b1 + a00f1f9 commit af0b4cb

35 files changed

+1055
-317
lines changed

.editorconfig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ csharp_style_conditional_delegate_call = true:warning
104104

105105
# Modifier preferences
106106
csharp_prefer_static_local_function = true:warning
107-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
107+
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async
108108
csharp_style_prefer_readonly_struct = true:warning
109109
csharp_style_prefer_readonly_struct_member = true:suggestion
110110

@@ -212,30 +212,30 @@ dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
212212

213213
dotnet_naming_symbols.interface.applicable_kinds = interface
214214
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
215-
dotnet_naming_symbols.interface.required_modifiers =
215+
dotnet_naming_symbols.interface.required_modifiers =
216216

217217
dotnet_naming_symbols.static_field.applicable_kinds = field
218218
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
219219
dotnet_naming_symbols.static_field.required_modifiers = static
220220

221221
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
222222
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
223-
dotnet_naming_symbols.types.required_modifiers =
223+
dotnet_naming_symbols.types.required_modifiers =
224224

225225
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
226226
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
227-
dotnet_naming_symbols.non_field_members.required_modifiers =
227+
dotnet_naming_symbols.non_field_members.required_modifiers =
228228

229229
# Naming styles
230230

231-
dotnet_naming_style.pascal_case.required_prefix =
232-
dotnet_naming_style.pascal_case.required_suffix =
233-
dotnet_naming_style.pascal_case.word_separator =
231+
dotnet_naming_style.pascal_case.required_prefix =
232+
dotnet_naming_style.pascal_case.required_suffix =
233+
dotnet_naming_style.pascal_case.word_separator =
234234
dotnet_naming_style.pascal_case.capitalization = pascal_case
235235

236236
dotnet_naming_style.begins_with_i.required_prefix = I
237-
dotnet_naming_style.begins_with_i.required_suffix =
238-
dotnet_naming_style.begins_with_i.word_separator =
237+
dotnet_naming_style.begins_with_i.required_suffix =
238+
dotnet_naming_style.begins_with_i.word_separator =
239239
dotnet_naming_style.begins_with_i.capitalization = pascal_case
240240

241241
[*.{cs,vb}]
@@ -273,4 +273,4 @@ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
273273
dotnet_style_qualification_for_field = false:silent
274274
dotnet_style_qualification_for_property = false:error
275275
dotnet_style_qualification_for_method = false:error
276-
dotnet_style_qualification_for_event = false:error
276+
dotnet_style_qualification_for_event = false:error

.github/workflows/dotnet.yml

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,56 +12,56 @@ jobs:
1212
name: Build and analyze
1313
runs-on: windows-latest
1414
steps:
15-
- name: Set up JDK
16-
uses: actions/setup-java@v4.4.0
17-
with:
18-
java-version: 17
19-
distribution: 'zulu'
20-
21-
- name: Checkout
22-
uses: actions/checkout@v4.2.1
23-
with:
24-
fetch-depth: 0
15+
- name: Set up JDK
16+
uses: actions/setup-java@v4.4.0
17+
with:
18+
java-version: 17
19+
distribution: 'zulu'
2520

26-
- name: Cache SonarCloud packages
27-
uses: actions/cache@v4.1.1
28-
with:
29-
path: ~\sonar\cache
30-
key: ${{ runner.os }}-sonar
31-
restore-keys: ${{ runner.os }}-sonar
21+
- name: Checkout
22+
uses: actions/checkout@v4.2.1
23+
with:
24+
fetch-depth: 0
3225

33-
- name: Cache SonarCloud scanner
34-
id: cache-sonar-scanner
35-
uses: actions/cache@v4.1.1
36-
with:
37-
path: .\.sonar\scanner
38-
key: ${{ runner.os }}-sonar-scanner
39-
restore-keys: ${{ runner.os }}-sonar-scanner
40-
41-
- name: Install SonarCloud scanner
42-
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
43-
shell: powershell
44-
run: |
45-
New-Item -Path .\.sonar\scanner -ItemType Directory
46-
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
47-
48-
- name: Build and analyze
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52-
shell: powershell
53-
run: |
54-
dotnet tool install --global dotnet-coverage
55-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_astar-dev-utilities" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
56-
dotnet build --configuration Release
57-
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Acceptance.Tests"' -f xml -o 'coverage.xml'
58-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
26+
- name: Cache SonarCloud packages
27+
uses: actions/cache@v4.2.3
28+
with:
29+
path: ~\sonar\cache
30+
key: ${{ runner.os }}-sonar
31+
restore-keys: ${{ runner.os }}-sonar
5932

60-
- name: Pack NuGet package
61-
if: github.ref == 'refs/heads/main'
62-
run: dotnet pack .\src\AStar.Dev.Utilities\AStar.Dev.Utilities.csproj
33+
- name: Cache SonarCloud scanner
34+
id: cache-sonar-scanner
35+
uses: actions/cache@v4.2.3
36+
with:
37+
path: .\.sonar\scanner
38+
key: ${{ runner.os }}-sonar-scanner
39+
restore-keys: ${{ runner.os }}-sonar-scanner
40+
41+
- name: Install SonarCloud scanner
42+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
43+
shell: powershell
44+
run: |
45+
New-Item -Path .\.sonar\scanner -ItemType Directory
46+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
47+
48+
- name: Build and analyze
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52+
shell: powershell
53+
run: |
54+
dotnet tool install --global dotnet-coverage
55+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_astar-dev-utilities" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
56+
dotnet build --configuration Release
57+
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Acceptance.Tests"' -f xml -o 'coverage.xml'
58+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
59+
60+
- name: Pack NuGet package
61+
if: github.ref == 'refs/heads/main'
62+
run: dotnet pack .\src\AStar.Dev.Utilities\AStar.Dev.Utilities.csproj
63+
64+
- name: Push to NuGet
65+
if: github.ref == 'refs/heads/main'
66+
run: dotnet nuget push "**\AStar.Dev.Utilities.*.nupkg" --api-key ${{secrets.nuget_api_key}} --skip-duplicate --source https://api.nuget.org/v3/index.json
6367

64-
- name: Push to NuGet
65-
if: github.ref == 'refs/heads/main'
66-
run: dotnet nuget push "**\AStar.Dev.Utilities.*.nupkg" --api-key ${{secrets.nuget_api_key}} --skip-duplicate --source https://api.nuget.org/v3/index.json
67-

.idea/.idea.AStar.Dev.Utilities/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.AStar.Dev.Utilities/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.AStar.Dev.Utilities/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.AStar.Dev.Utilities/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AStar.Dev.Utilities.sln

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,26 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{538ADD9A
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{4FDD8291-A186-40FE-BB14-CA60EB3274FF}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Utilities.Unit.Tests", "tests\unit\AStar.Dev.Utilities.Unit.Tests\AStar.Dev.Utilities.Unit.Tests.csproj", "{713622F6-BCF6-47AE-BBD2-45CCE257C664}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Utilities.Tests.Unit", "tests\unit\AStar.Dev.Utilities.Tests.Unit\AStar.Dev.Utilities.Tests.Unit.csproj", "{713622F6-BCF6-47AE-BBD2-45CCE257C664}"
1111
EndProject
1212
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{21399C8D-85EE-4D9A-B57C-6EF16EEC03EC}"
1313
EndProject
1414
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Utilities", "src\AStar.Dev.Utilities\AStar.Dev.Utilities.csproj", "{22F07837-7837-4AC9-9CBC-8906325B99A7}"
1515
EndProject
16+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5F0E0041-1B48-4D79-A175-C0D04DD2F303}"
17+
ProjectSection(SolutionItems) = preProject
18+
.editorconfig = .editorconfig
19+
LICENSE = LICENSE
20+
AStar.png = AStar.png
21+
.gitignore = .gitignore
22+
EndProjectSection
23+
EndProject
24+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{58D4DA15-FD32-449A-9DDC-048271C65846}"
25+
ProjectSection(SolutionItems) = preProject
26+
.github\dependabot.yml = .github\dependabot.yml
27+
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
28+
EndProjectSection
29+
EndProject
1630
Global
1731
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1832
Debug|Any CPU = Debug|Any CPU
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/UserDictionary/Words/=deserialised/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

Readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ A collection of useful utilities. At the moment, the collection is small but wil
1717
* ToJson - as you might expect, converts the object to the appropriate JSON representation.
1818

1919
## GitHub build
20+
2021
[![Build and test solution](https://github.com/astar-development/astar-dev-utilities/actions/workflows/dotnet.yml/badge.svg)](https://github.com/astar-development/astar-dev-utilities/actions/workflows/dotnet.yml)
2122

2223
## SonarCloud Analysis Results
@@ -31,4 +32,4 @@ A collection of useful utilities. At the moment, the collection is small but wil
3132

3233
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=astar-development_astar-dev-utilities&metric=coverage)](https://sonarcloud.io/summary/new_code?id=astar-development_astar-dev-utilities)
3334

34-
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=astar-development_astar-dev-utilities&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=astar-development_astar-dev-utilities)
35+
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=astar-development_astar-dev-utilities&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=astar-development_astar-dev-utilities)

src/AStar.Dev.Utilities/AStar.Dev.Utilities.csproj

Lines changed: 59 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,67 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
8+
<Title>AStar Dev Utilities</Title>
9+
<Company>AStar Development</Company>
10+
<Copyright>AStar Development, 2024</Copyright>
11+
<IncludeSymbols>True</IncludeSymbols>
12+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
13+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
14+
<RepositoryUrl>https://github.com/astar-development/astar-dev-utilities.git</RepositoryUrl>
15+
<RepositoryType>git</RepositoryType>
16+
<PackageProjectUrl>https://github.com/astar-development/astar-dev-utilities</PackageProjectUrl>
17+
<Description>A collection of useful utilities that do not fit within any of the other, more targeted, AStar NuGet packages.</Description>
18+
<Version>1.6.0</Version>
19+
<Authors>AStar Development, Jason Barden</Authors>
20+
<RepositoryType>git</RepositoryType>
21+
<IncludeSymbols>True</IncludeSymbols>
22+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
23+
<PackageReadmeFile>Readme.md</PackageReadmeFile>
24+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
25+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
26+
<DocumentationFile>$(AssemblyName).xml</DocumentationFile>
27+
<PackageIcon>AStar.png</PackageIcon>
28+
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
29+
<AnalysisLevel>latest-recommended</AnalysisLevel>
30+
</PropertyGroup>
831

32+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
33+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
34+
<NoWarn>1701;1702;</NoWarn>
35+
</PropertyGroup>
936

10-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
11-
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
12-
</PropertyGroup>
37+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
38+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
39+
<NoWarn>1701;1702;</NoWarn>
40+
</PropertyGroup>
1341

14-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
15-
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
16-
</PropertyGroup>
42+
<ItemGroup>
43+
<None Include="..\..\AStar.png">
44+
<Pack>True</Pack>
45+
<PackagePath>\</PackagePath>
46+
</None>
47+
<None Include="..\..\LICENSE">
48+
<Pack>True</Pack>
49+
<PackagePath>\</PackagePath>
50+
</None>
51+
<None Include="..\..\Readme.md">
52+
<Pack>True</Pack>
53+
<PackagePath>\</PackagePath>
54+
</None>
55+
</ItemGroup>
1756

18-
<PropertyGroup>
19-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
20-
<Title>AStar.Dev.Utilities</Title>
21-
<Company>AStar Development</Company>
22-
<Copyright>AStar Development, 2024</Copyright>
23-
<PackageReadmeFile>README.md</PackageReadmeFile>
24-
<PackageLicenseFile>LICENSE</PackageLicenseFile>
25-
<IncludeSymbols>True</IncludeSymbols>
26-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
27-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
28-
<RepositoryUrl>https://github.com/astar-development/astar-dev-utilities.git</RepositoryUrl>
29-
<RepositoryType>git</RepositoryType>
30-
<PackageProjectUrl>https://github.com/astar-development/astar-dev-utilities</PackageProjectUrl>
31-
<Description>A collection of useful utilities.</Description>
32-
<Version>1.5.2</Version>
33-
<Authors>AStar Development, Jason Barden</Authors>
34-
<DocumentationFile>$(AssemblyName).xml</DocumentationFile>
35-
<PackageIcon>AStar.png</PackageIcon>
36-
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
37-
<PackageReleaseNotes>version 1.5.2 fixes the project links, no functionality is affected.</PackageReleaseNotes>
38-
</PropertyGroup>
57+
<ItemGroup>
58+
<None Update="AStar.png">
59+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
60+
</None>
61+
</ItemGroup>
3962

40-
<ItemGroup>
41-
<None Include="..\..\AStar.png">
42-
<Pack>True</Pack>
43-
<PackagePath>\</PackagePath>
44-
</None>
45-
<None Include="..\..\LICENSE">
46-
<Pack>True</Pack>
47-
<PackagePath>\</PackagePath>
48-
</None>
49-
<None Include="..\..\README.md">
50-
<Pack>True</Pack>
51-
<PackagePath>\</PackagePath>
52-
</None>
53-
</ItemGroup>
63+
<ItemGroup>
64+
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.14"/>
65+
</ItemGroup>
5466

5567
</Project>
56-
57-

0 commit comments

Comments
 (0)