Skip to content

Commit

Permalink
feat(net): add support for .netstandard2.0 (#38)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Brault <alan.brault@visus.io>
  • Loading branch information
xaevik authored May 21, 2024
1 parent b2a637f commit bad81b0
Show file tree
Hide file tree
Showing 23 changed files with 1,119 additions and 1,191 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ csharp_style_expression_bodied_properties = true
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion

# Namespace Declaration Style
csharp_style_namespace_declarations = block_scoped

# Null-checking preferences
csharp_style_conditional_delegate_call = true:suggestion

Expand Down
29 changes: 12 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- 'release/**'
paths-ignore:
- '**.md'
- '**/renovate.json'
Expand All @@ -16,7 +17,7 @@ on:
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -25,37 +26,31 @@ jobs:
with:
fetch-depth: 0
show-progress: false
- name: NuGet Cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os}}-nuget
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Build
run: dotnet build -c release
- name: Test
run: |
dotnet test -c release --no-restore --no-build \
--logger:trx \
--results-directory ${{ runner.temp }}/TestResults \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=opencover \
-p:CoverletOutput=${{ runner.temp }}/coverage.opencover.xml
dotnet test -c release `
--logger:trx `
--results-directory ${{ runner.temp }}\TestResults `
-p:CollectCoverage=true `
-p:CoverletOutputFormat=opencover `
-p:CoverletOutput=${{ github.workspace }}\CodeCoverage\coverage.opencover.xml
- name: Publish Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test Results
path: ${{ runner.temp }}/TestResults/*.trx
path: ${{ runner.temp }}\TestResults\*.trx
reporter: dotnet-trx
path-replace-backslashes: true
- name: Codacy Coverage
if: always()
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_TOKEN }}
coverage-reports: ${{ runner.temp }}/coverage.opencover.xml
coverage-reports: CodeCoverage/coverage.opencover.*.xml


12 changes: 3 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-latest
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -18,23 +18,17 @@ jobs:
with:
fetch-depth: 0
show-progress: false
- name: NuGet Cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os}}-nuget
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10.2
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.10.2
uses: gittools/actions/gitversion/execute@v1.1.1
with:
useConfigFile: true
- name: Restore
Expand Down
9 changes: 2 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
<PropertyGroup>
<Version>0.0.1</Version>
<Copyright>Copyright (c) 2023 Visus Development Team</Copyright>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<RestoreLockedMode>true</RestoreLockedMode>
<LangVersion>12</LangVersion>
<Nullable Condition="($(TargetFramework) == 'net6.0') Or ($(TargetFramework) == 'net8.0')">enable</Nullable>
</PropertyGroup>
</Project>
37 changes: 20 additions & 17 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="NSec.Cryptography" Version="24.4.0" />
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
<PackageVersion Include="Verify.Xunit" Version="24.2.0" />
<PackageVersion Include="xunit" Version="2.8.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.3.1" />
<PackageVersion Include="CommunityToolkit.Diagnostics" Version="8.2.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="PolySharp" Version="1.14.1" />
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.3" />
<PackageVersion Include="Verify.Xunit" Version="24.2.0" />
<PackageVersion Include="xunit" Version="2.8.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>
</Project>
10 changes: 7 additions & 3 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"extends": [
"config:base",
"mergeConfidence:all-badges",
"config:recommended",
":disableDependencyDashboard",
":gitSignOff"
],
"assigneesFromCodeOwners": true,
"timezone": "America/New_York",
"schedule": [
"before 5am"
],
"packageRules": [
{
"matchPackagePatterns": [
Expand All @@ -21,8 +26,7 @@
],
"automerge": true,
"automergeType": "pr",
"platformAutomerge": true,
"ignoreTests": true
"platformAutomerge": true
},
{
"matchPackagePatterns": [
Expand Down
13 changes: 7 additions & 6 deletions src/cuid.net/Abstractions/FingerprintVersion.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
namespace Visus.Cuid.Abstractions;

internal enum FingerprintVersion : byte
namespace Visus.Cuid.Abstractions
{
None = 0,
One = 1,
Two = 2
internal enum FingerprintVersion : byte
{
None = 0,
One = 1,
Two = 2
}
}
Loading

0 comments on commit bad81b0

Please sign in to comment.