Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize Repo / Solution with nats.net #26

Merged
merged 8 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
dotnet-version: '8.x'

- name: Check formatting
working-directory: ./src
run: |
if dotnet format --verify-no-changes; then
echo "formatting passed"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:

- id: tag
name: Determine tag
working-directory: ./src
run: |
version="$(head -n 1 version.txt)"
ref_name="v$version"
Expand All @@ -38,12 +39,14 @@ jobs:

- if: ${{ fromJSON(steps.tag.outputs.create) }}
name: Pack
working-directory: ./src
# https://learn.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg
# https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/
run: dotnet pack -c Release -o dist -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true

- if: ${{ fromJSON(steps.tag.outputs.create) }}
name: Push
working-directory: ./src
run: |
cd dist
ls -lh
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@ jobs:
8.x

- name: Restore
working-directory: ./src
run: dotnet restore

- name: Build
working-directory: ./src
run: dotnet build --no-restore -p:ContinuousIntegrationBuild=true

- name: Test
working-directory: ./src
# Collect code coverage
# https://github.com/MarcoRossignoli/coverlet/blob/master/Documentation/KnownIssues.md#tests-fail-if-assembly-is-strong-named
run: dotnet test --no-build --logger:"console;verbosity=normal" --collect:"XPlat Code Coverage" --settings Default.runsettings -- RunConfiguration.DisableAppDomain=true
Expand All @@ -71,6 +74,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Test Native AOT
working-directory: ./tests
shell: bash
run: |
echo ">> Set up for AOT compilation..."
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions Directory.Build.props → src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)LICENSE" Pack="true" PackagePath=""/>
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath=""/>
<None Include="$(MSBuildThisFileDirectory)Icon.png" Pack="true" PackagePath=""/>
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath=""/>
<None Include="$(MSBuildThisFileDirectory)..\README.md" Pack="true" PackagePath=""/>
<None Include="$(MSBuildThisFileDirectory)..\Icon.png" Pack="true" PackagePath=""/>
</ItemGroup>

</Project>
36 changes: 22 additions & 14 deletions NATS.Jwt.sln → src/NATS.Jwt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,43 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NATS.Jwt", "NATS.Jwt\NATS.Jwt.csproj", "{9B613C47-922B-4AA8-82D7-1520A13E0F74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NATS.Jwt.Tests", "NATS.Jwt.Tests\NATS.Jwt.Tests.csproj", "{707139DF-D75B-40F8-9AA7-816C64E98572}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NATS.Jwt.Tests", "..\tests\NATS.Jwt.Tests\NATS.Jwt.Tests.csproj", "{707139DF-D75B-40F8-9AA7-816C64E98572}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NATS.Jwt.TestNativeAot", "..\tests\NATS.Jwt.TestNativeAot\NATS.Jwt.TestNativeAot.csproj", "{E144211D-3549-4E78-BFC4-B5BF7E70AEDA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F3E7EFAD-B3EA-45F4-907B-F3C2338771CE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{79B0CD3B-C106-44A2-9A2A-CFDA69A3016A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".", ".", "{1F24478C-D5CB-4A58-A74E-6371F7F95C01}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
LICENSE = LICENSE
README.md = ..\README.md
LICENSE = ..\LICENSE
Directory.Build.props = Directory.Build.props
Icon.png = Icon.png
Icon.png = ..\Icon.png
version.txt = version.txt
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
.gitattributes = ..\.gitattributes
.gitignore = ..\.gitignore
Default.runsettings = Default.runsettings
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{03E5999C-5D20-4EA2-B8C8-53ACE65B221F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{1EB01F81-8857-4646-B8BF-16024F357506}"
ProjectSection(SolutionItems) = preProject
.github\ISSUE_TEMPLATE\config.yml = .github\ISSUE_TEMPLATE\config.yml
.github\ISSUE_TEMPLATE\defect.yml = .github\ISSUE_TEMPLATE\defect.yml
.github\ISSUE_TEMPLATE\proposal.yml = .github\ISSUE_TEMPLATE\proposal.yml
.github\ISSUE_TEMPLATE\config.yml = ..\.github\ISSUE_TEMPLATE\config.yml
.github\ISSUE_TEMPLATE\defect.yml = ..\.github\ISSUE_TEMPLATE\defect.yml
.github\ISSUE_TEMPLATE\proposal.yml = ..\.github\ISSUE_TEMPLATE\proposal.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{9C98B59B-D0C0-4F2B-8333-2242ED1B5F70}"
ProjectSection(SolutionItems) = preProject
.github\workflows\format.yml = .github\workflows\format.yml
.github\workflows\release.yml = .github\workflows\release.yml
.github\workflows\test.yml = .github\workflows\test.yml
.github\workflows\format.yml = ..\.github\workflows\format.yml
.github\workflows\release.yml = ..\.github\workflows\release.yml
.github\workflows\test.yml = ..\.github\workflows\test.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NATS.Jwt.TestNativeAot", "NATS.Jwt.TestNativeAot\NATS.Jwt.TestNativeAot.csproj", "{E144211D-3549-4E78-BFC4-B5BF7E70AEDA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -61,7 +65,11 @@ Global
{E144211D-3549-4E78-BFC4-B5BF7E70AEDA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9B613C47-922B-4AA8-82D7-1520A13E0F74} = {F3E7EFAD-B3EA-45F4-907B-F3C2338771CE}
{E144211D-3549-4E78-BFC4-B5BF7E70AEDA} = {79B0CD3B-C106-44A2-9A2A-CFDA69A3016A}
{707139DF-D75B-40F8-9AA7-816C64E98572} = {79B0CD3B-C106-44A2-9A2A-CFDA69A3016A}
{1EB01F81-8857-4646-B8BF-16024F357506} = {03E5999C-5D20-4EA2-B8C8-53ACE65B221F}
{9C98B59B-D0C0-4F2B-8333-2242ED1B5F70} = {03E5999C-5D20-4EA2-B8C8-53ACE65B221F}
{03E5999C-5D20-4EA2-B8C8-53ACE65B221F} = {1F24478C-D5CB-4A58-A74E-6371F7F95C01}
EndGlobalSection
EndGlobal
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
using NATS.Jwt.Models;

namespace NATS.Jwt.Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
using NATS.Jwt.Models;

namespace NATS.Jwt.Internal;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright (c) The NATS Authors.
// Licensed under the Apache License, Version 2.0.

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;

namespace NATS.Jwt.Models
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright (c) The NATS Authors.
// Licensed under the Apache License, Version 2.0.

using System;
using System.Collections.Generic;
using System.Text;

namespace NATS.Jwt.Models
{
/// <summary>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
82 changes: 38 additions & 44 deletions NATS.Jwt/NATS.Jwt.csproj → src/NATS.Jwt/NATS.Jwt.csproj
Original file line number Diff line number Diff line change
@@ -1,44 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

<!-- NuGet Packaging -->
<PackageTags>nats;jwt</PackageTags>
<Description>NATS JWT for .NET</Description>
<IsPackable>true</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'netstandard2.0' AND '$(TargetFramework)' != 'netstandard2.1'">
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<!-- Dependencies for netstandard only -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Threading.Channels" Version="8.0.0"/>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.1"/>
<PackageReference Include="Nullable" Version="1.3.1"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.5"/>
<PackageReference Include="System.Buffers" Version="4.5.1"/>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0"/>
<!-- Nerdbank.Streams for SequenceReader support https://github.com/dotnet/standard/issues/1493 -->
<PackageReference Include="Nerdbank.Streams" Version="2.10.72"/>
<PackageReference Include="IndexRange" Version="1.0.3"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.5"/>
<PackageReference Include="NATS.NKeys" Version="1.0.0-preview.1"/>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" ExcludeAssets="Compile" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="NATS.Jwt.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a56954898c64f94b3785de8ff48cf4b9cf7ce5398602da1680f15e3dccc398e8bca151641158df6542afc9623805c0f6ac513a4bcf1b3289f45a27c5eb927711854ebc8a42afce2cbbe7deebde1a431ee53d2bdf64418ff964fc3a2c561e344ba79b30704d916a879afac5e7aea531198afa8a3a1979a4232a9c590f6ee5cfc2"/>
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

<!-- NuGet Packaging -->
<PackageTags>nats;jwt</PackageTags>
<Description>NATS JWT for .NET</Description>
<IsPackable>true</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'netstandard2.0' AND '$(TargetFramework)' != 'netstandard2.1'">
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<!-- Dependencies for netstandard only -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Nullable" Version="1.3.1"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.6.0" />
<PackageReference Include="System.Buffers" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.5"/>
<PackageReference Include="NATS.NKeys" Version="1.0.0-preview.1"/>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" ExcludeAssets="Compile" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="NATS.Jwt.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a56954898c64f94b3785de8ff48cf4b9cf7ce5398602da1680f15e3dccc398e8bca151641158df6542afc9623805c0f6ac513a4bcf1b3289f45a27c5eb927711854ebc8a42afce2cbbe7deebde1a431ee53d2bdf64418ff964fc3a2c561e344ba79b30704d916a879afac5e7aea531198afa8a3a1979a4232a9c590f6ee5cfc2"/>
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)..\src\NATS.Jwt.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NATS.Jwt\NATS.Jwt.csproj" />
<ProjectReference Include="..\..\src\NATS.Jwt\NATS.Jwt.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@

<ItemGroup>
<PackageReference Include="JsonDiffPatch.Net" Version="2.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="NATS.Client.Core" Version="2.3.0-preview.1" />
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NATS.Client.Core" Version="2.5.4" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NATS.Jwt\NATS.Jwt.csproj" />
<ProjectReference Include="..\..\src\NATS.Jwt\NATS.Jwt.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
Loading