Skip to content

Commit a4238a8

Browse files
authored
Merge 10fb9b0 into 8950faa
2 parents 8950faa + 10fb9b0 commit a4238a8

19 files changed

+227
-105
lines changed

.github/workflows/build-test.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
- name: Install and start RabbitMQ
3232
run: ./.ci/install.ps1
3333
- name: Restore
34-
run: dotnet restore --verbosity=normal
34+
run: dotnet restore ./Build.csproj --verbosity=normal
3535
- name: Build
36-
run: dotnet build --no-restore --verbosity=normal
36+
run: dotnet build ./Build.csproj --no-restore --verbosity=normal
3737
- name: Verify
38-
run: dotnet format --no-restore --verbosity=diagnostic --verify-no-changes
38+
run: dotnet format ./rabbitmq-stream-dotnet-client.sln --no-restore --verbosity=diagnostic --verify-no-changes
3939
- name: Test
40-
run: dotnet test --no-build --logger "console;verbosity=detailed"
40+
run: dotnet test ./Build.csproj --no-build --logger "console;verbosity=detailed"
4141
build:
4242
name: build/test on ubuntu-latest
4343
runs-on: ubuntu-latest
@@ -70,12 +70,12 @@ jobs:
7070
- name: Enable RabbitMQ Plugins
7171
run: docker exec ${{ job.services.rabbitmq.id }} rabbitmq-plugins enable rabbitmq_stream rabbitmq_stream_management rabbitmq_amqp1_0
7272
- name: Restore
73-
run: dotnet restore --verbosity=normal
73+
run: dotnet restore ./Build.csproj --verbosity=normal
7474
- name: Build
75-
run: dotnet build --no-restore --verbosity=normal
75+
run: dotnet build ./Build.csproj --no-restore --verbosity=normal
7676
- name: Verify
77-
run: dotnet format --no-restore --verbosity=diagnostic --verify-no-changes
77+
run: dotnet format ./rabbitmq-stream-dotnet-client.sln --no-restore --verbosity=diagnostic --verify-no-changes
7878
- name: Test
79-
run: dotnet test --no-build --logger "console;verbosity=detailed" /p:AltCover=true
79+
run: dotnet test ./Build.csproj --no-build --logger "console;verbosity=detailed" /p:AltCover=true
8080
- name: Upload code coverage to Codecov
8181
run: bash <(curl -s https://codecov.io/bash)

.github/workflows/publish-nuget.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ jobs:
2525
restore-keys: |
2626
${{ runner.os }}-v2-nuget-
2727
- name: Build (Release)
28-
run: dotnet build --configuration=Release --verbosity=normal
28+
run: dotnet build ./Build.csproj --verbosity=normal --configuration=Release /p:CI=true
2929
- name: Publish to NuGet
3030
run: dotnet nuget push --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source 'https://api.nuget.org/v3/index.json' ${{github.workspace}}/packages/RabbitMQ.Stream.Client.*.nupkg

Build.csproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.Build.Traversal/3.2.0">
2+
3+
<PropertyGroup>
4+
<IsPackable>false</IsPackable>
5+
<MinVerSkip>true</MinVerSkip>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<ProjectReference Include="docs/Documentation/Documentation.csproj" />
10+
<ProjectReference Include="docs/SuperStream/SuperStream.csproj" />
11+
<ProjectReference Include="Examples/Performances/Performances.csproj" />
12+
<ProjectReference Include="RabbitMQ.Stream.Client.PerfTest/RabbitMQ.Stream.Client.PerfTest.fsproj" />
13+
<ProjectReference Include="RabbitMQ.Stream.Client/RabbitMQ.Stream.Client.csproj" />
14+
<ProjectReference Include="Tests/Tests.csproj" />
15+
</ItemGroup>
16+
17+
</Project>

Directory.Build.props

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!-- vim: set ft=xml: -->
2+
<Project>
3+
4+
<PropertyGroup>
5+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)rabbit.snk</AssemblyOriginatorKeyFile>
6+
<Authors>VMware</Authors>
7+
<Company>VMware, Inc. or its affiliates.</Company>
8+
<Copyright>Copyright © 2007-$([System.DateTime]::Now.Year) VMware, Inc. or its affiliates.</Copyright>
9+
<DebugSymbols>true</DebugSymbols>
10+
<DebugType>embedded</DebugType>
11+
<DefaultLanguage>en-US</DefaultLanguage>
12+
<DisableCheckingDuplicateNuGetItems>false</DisableCheckingDuplicateNuGetItems>
13+
<Features>strict</Features>
14+
<IncludeSymbols>true</IncludeSymbols>
15+
<IsPackable>false</IsPackable>
16+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
17+
<NoWarn>$(NoWarn);CS1591</NoWarn>
18+
<PackageId>$(AssemblyName)</PackageId>
19+
<PackageProjectUrl>https://github.com/rabbitmq/rabbitmq-stream-dotnet-client</PackageProjectUrl>
20+
<PackageReleaseNotes>https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/releases/latest</PackageReleaseNotes>
21+
<PackageTags>rabbitmq, stream</PackageTags>
22+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
23+
<RepositoryType>git</RepositoryType>
24+
<RepositoryUrl>https://github.com/rabbitmq/rabbitmq-stream-dotnet-client</RepositoryUrl>
25+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
26+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
27+
</PropertyGroup>
28+
29+
<PropertyGroup Condition="'$(Configuration)' == 'Release' And '$(CI)' == 'true'">
30+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
31+
<Deterministic>true</Deterministic>
32+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
33+
</PropertyGroup>
34+
35+
<ItemGroup Condition="'$(Configuration)' == 'Release' and '$(SourceRoot)' == ''">
36+
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
37+
</ItemGroup>
38+
39+
</Project>

Directory.Build.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- vim: set ft=xml: -->
2+
<Project>
3+
<ItemGroup>
4+
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
5+
</ItemGroup>
6+
</Project>

Directory.Packages.props

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<!-- RabbitMQ.Stream.Client -->
7+
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.3" />
8+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
9+
<PackageVersion Include="MinVer" Version="3.1.0" />
10+
<PackageVersion Include="System.IO.Pipelines" Version="7.0.0" />
11+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
12+
13+
<!-- Tests -->
14+
<PackageVersion Include="AltCover" Version="8.2.837" />
15+
<PackageVersion Include="AmqpNetLite" Version="2.4.5" />
16+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
17+
<PackageVersion Include="RabbitMQ.Client" Version="6.4.0" />
18+
<PackageVersion Include="xunit" Version="2.4.1" />
19+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
20+
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
21+
<PackageVersion Include="coverlet.collector" Version="3.1.2" />
22+
23+
<!-- docs/**/*.csproj -->
24+
<PackageVersion Include="K4os.Compression.LZ4.Streams" Version="1.2.16" />
25+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="7.0.0" />
26+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
27+
</ItemGroup>
28+
</Project>
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<IsPackable>false</IsPackable>
6+
<MinVerSkip>true</MinVerSkip>
7+
<Nullable>enable</Nullable>
8+
<NoWarn>$(NoWarn);CA2007</NoWarn>
9+
<OutputType>Exe</OutputType>
10+
</PropertyGroup>
911

10-
<ItemGroup>
11-
<ProjectReference Include="..\..\RabbitMQ.Stream.Client\RabbitMQ.Stream.Client.csproj" />
12-
</ItemGroup>
12+
<ItemGroup>
13+
<ProjectReference Include="..\..\RabbitMQ.Stream.Client\RabbitMQ.Stream.Client.csproj" />
14+
</ItemGroup>
1315

1416
</Project>

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
all: format test
22

33
format:
4-
dotnet format
4+
dotnet format $(CURDIR)/rabbitmq-stream-dotnet-client.sln
55

66
build:
7-
dotnet build
7+
dotnet build $(CURDIR)/Build.csproj
88

99
test: build
10-
dotnet test Tests/Tests.csproj --no-build --logger "console;verbosity=detailed" /p:AltCover=true
10+
dotnet test $(CURDIR)/Tests/Tests.csproj --no-build --logger "console;verbosity=detailed" /p:AltCover=true
1111

1212
rabbitmq-server:
1313
docker run -it --rm --name rabbitmq-stream-docker \

NuGet.Config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear/>
5+
<!--<add key="localNuget" value="c:\code\LocalNuget" />-->
6+
<!--<add key="MyGet" value="https://www.myget.org/F/rabbitmq/api/v3/index.json" />-->
7+
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
8+
</packageSources>
9+
</configuration>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project>
2+
<ItemGroup Condition=" '$(EnableCentralPackageVersions)' != 'false' ">
3+
<!--
4+
https://github.com/NuGet/Home/issues/11949#issuecomment-1184772230
5+
Workaround the issue where FSharp SDK adds implicit PackageReference items but doesn't mark them as such
6+
https://github.com/microsoft/MSBuildSdks/issues/90
7+
-->
8+
<PackageReference Update="FSharp.Core"
9+
Condition="'$(MSBuildProjectExtension)' == '.fsproj' And '$(DisableImplicitFSharpCoreReference)' != 'true' And '$(UpdateImplicitFSharpCoreReference)' != 'false'"
10+
IsImplicitlyDefined="true" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
6-
<RootNamespace>RabbitMQ.Stream.Client.Cmd</RootNamespace>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<IsPackable>false</IsPackable>
5+
<MinVerSkip>true</MinVerSkip>
6+
<OutputType>Exe</OutputType>
7+
<RootNamespace>RabbitMQ.Stream.Client.Cmd</RootNamespace>
8+
</PropertyGroup>
89

9-
<ItemGroup>
10-
<Compile Include="Program.fs" />
11-
<Content Include="README.md" />
12-
</ItemGroup>
10+
<ItemGroup>
11+
<Compile Include="Program.fs" />
12+
<Content Include="README.md" />
13+
</ItemGroup>
1314

14-
<ItemGroup>
15-
<ProjectReference Include="..\RabbitMQ.Stream.Client\RabbitMQ.Stream.Client.csproj" />
16-
</ItemGroup>
17-
18-
<ItemGroup>
19-
<PackageReference Update="FSharp.Core" Version="6.0.0" />
20-
</ItemGroup>
15+
<ItemGroup>
16+
<ProjectReference Include="..\RabbitMQ.Stream.Client\RabbitMQ.Stream.Client.csproj" />
17+
</ItemGroup>
2118

2219
</Project>

RabbitMQ.Stream.Client/RabbitMQ.Stream.Client.csproj

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,26 @@
44
<AssemblyName>RabbitMQ.Stream.Client</AssemblyName>
55
<AssemblyOriginatorKeyFile>../rabbit.snk</AssemblyOriginatorKeyFile>
66
<AssemblyTitle>RabbitMQ Stream Client Library for .NET</AssemblyTitle>
7-
<Authors>VMware</Authors>
8-
<Company>VMware, Inc. or its affiliates.</Company>
9-
<Copyright>Copyright © 2007-2022 VMware, Inc. or its affiliates.</Copyright>
107
<Description>The RabbitMQ Stream .NET client is the official client library for C# (and, implicitly, other .NET languages)</Description>
118
<EmbedUntrackedSources>true</EmbedUntrackedSources>
129
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1310
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14-
<IncludeSymbols>true</IncludeSymbols>
11+
<IsPackable>true</IsPackable>
1512
<MinVerTagPrefix>v</MinVerTagPrefix>
1613
<MinVerVerbosity>normal</MinVerVerbosity>
17-
<NoWarn>$(NoWarn);CS1591</NoWarn>
1814
<PackageDescription>The RabbitMQ Stream .NET client is the official client library for C# (and, implicitly, other .NET languages)</PackageDescription>
1915
<PackageIcon>icon.png</PackageIcon>
2016
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2117
<PackageOutputPath>..\packages</PackageOutputPath>
22-
<PackageProjectUrl>https://github.com/rabbitmq/rabbitmq-stream-dotnet-client</PackageProjectUrl>
23-
<PackageTags>rabbitmq, stream</PackageTags>
24-
<RepositoryUrl>https://github.com/rabbitmq/rabbitmq-stream-dotnet-client</RepositoryUrl>
2518
<RootNamespace>RabbitMQ.Stream.Client</RootNamespace>
2619
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
27-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
2820
<Title>RabbitMQ Stream Client Library for .NET</Title>
29-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
30-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
31-
</PropertyGroup>
32-
33-
<PropertyGroup Condition="'$(CI)' == 'true'">
34-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
35-
<Deterministic>true</Deterministic>
3621
</PropertyGroup>
3722

3823
<ItemGroup>
3924
<None Remove="icon.png" />
40-
<Content Include="icon.png" PackagePath="" />
41-
<None Include="..\LICENSE" Pack="true" PackagePath="" />
25+
<Content Include="icon.png" PackagePath="icon.png" />
26+
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" Visible="false" PackagePath="" />
4227
</ItemGroup>
4328

4429
<ItemGroup>
@@ -48,20 +33,20 @@
4833
</ItemGroup>
4934

5035
<ItemGroup>
51-
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.3">
36+
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers">
5237
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5338
<PrivateAssets>all</PrivateAssets>
5439
</PackageReference>
55-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
40+
<PackageReference Include="Microsoft.SourceLink.GitHub">
5641
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5742
<PrivateAssets>all</PrivateAssets>
5843
</PackageReference>
59-
<PackageReference Include="MinVer" Version="3.1.0">
44+
<PackageReference Include="MinVer">
6045
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
6146
<PrivateAssets>all</PrivateAssets>
6247
</PackageReference>
63-
<PackageReference Include="System.IO.Pipelines" Version="7.0.0" />
64-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
48+
<PackageReference Include="System.IO.Pipelines" />
49+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
6550
</ItemGroup>
6651

6752
</Project>

Tests/Tests.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
54
<IsPackable>false</IsPackable>
6-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5+
<MinVerSkip>true</MinVerSkip>
76
</PropertyGroup>
87

98
<ItemGroup>
10-
<PackageReference Include="AltCover" Version="8.2.837" />
11-
<PackageReference Include="AmqpNetLite" Version="2.4.5" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
13-
<PackageReference Include="RabbitMQ.Client" Version="6.4.0" />
14-
<PackageReference Include="xunit" Version="2.4.1" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
9+
<PackageReference Include="AltCover" />
10+
<PackageReference Include="AmqpNetLite" />
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
12+
<PackageReference Include="RabbitMQ.Client" />
13+
<PackageReference Include="xunit" />
14+
<PackageReference Include="xunit.runner.visualstudio">
1615
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1716
<PrivateAssets>all</PrivateAssets>
1817
</PackageReference>
19-
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
20-
<PackageReference Include="coverlet.collector" Version="3.1.2">
18+
<PackageReference Include="Xunit.SkippableFact" />
19+
<PackageReference Include="coverlet.collector">
2120
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2221
<PrivateAssets>all</PrivateAssets>
2322
</PackageReference>
@@ -26,6 +25,7 @@
2625
<ItemGroup>
2726
<ProjectReference Include="..\RabbitMQ.Stream.Client\RabbitMQ.Stream.Client.csproj" />
2827
</ItemGroup>
28+
2929
<ItemGroup>
3030
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
3131
</ItemGroup>

build.bat

Lines changed: 0 additions & 4 deletions
This file was deleted.

build.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[CmdletBinding(PositionalBinding=$false)]
2+
param(
3+
[switch]$RunTests
4+
)
5+
6+
Write-Host "Run Parameters:" -ForegroundColor Cyan
7+
Write-Host "`tPSScriptRoot: $PSScriptRoot"
8+
Write-Host "`tRunTests: $RunTests"
9+
Write-Host "`tdotnet --version: $(dotnet --version)"
10+
11+
Write-Host "Building all projects (Build.csproj traversal)..." -ForegroundColor "Magenta"
12+
dotnet build "$PSScriptRoot\Build.csproj"
13+
Write-Host "Done building." -ForegroundColor "Green"
14+
15+
if ($RunTests) {
16+
Write-Host "Running tests: Build.csproj traversal (all frameworks)" -ForegroundColor "Magenta"
17+
dotnet test "$PSScriptRoot\Build.csproj" --no-build --logger "console;verbosity=detailed"
18+
if ($LastExitCode -ne 0) {
19+
Write-Host "Error with tests, aborting build." -Foreground "Red"
20+
Exit 1
21+
}
22+
Write-Host "Tests passed!" -ForegroundColor "Green"
23+
}
24+
25+
Write-Host "Done."

0 commit comments

Comments
 (0)