Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
9.0.x
10.0.x

- name: Run local/dotnet-tool-restore@v1
run: dotnet tool restore

- name: Run local/dotnet-restore@v1
run: dotnet restore

Expand Down
2 changes: 1 addition & 1 deletion dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"aspire.cli": {
"version": "13.4.5",
"version": "13.5.2",
"commands": [
"aspire"
],
Expand Down
4 changes: 2 additions & 2 deletions generators/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
</ItemGroup>

<ItemGroup>
<PackageVersion Include="Meziantou.Polyfill" Version="1.0.160" />
<PackageVersion Include="Meziantou.Polyfill" Version="1.0.161" />
</ItemGroup>

<ItemGroup Label="Coding Standards">
<GlobalPackageReference Include="Altemiq.DotNet.CodingStandard" Version="1.0.360" />
<GlobalPackageReference Include="Altemiq.DotNet.CodingStandard" Version="1.0.373" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion generators/IO.Las.CodeGeneration/ColorSourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Altemiq.IO.Las.CodeGeneration;
/// The color source generator.
/// </summary>
[Generator(LanguageNames.CSharp)]
public class ColorSourceGenerator : BaseSourceGenerator
public sealed class ColorSourceGenerator : BaseSourceGenerator
{
/// <inheritdoc/>
public override void Initialize(IncrementalGeneratorInitializationContext context)
Expand Down
2 changes: 1 addition & 1 deletion generators/IO.Las.CodeGeneration/ModelSourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Altemiq.IO.Las.CodeGeneration;
/// The LAS source generators.
/// </summary>
[Generator(LanguageNames.CSharp)]
public class ModelSourceGenerator : BaseSourceGenerator
public sealed class ModelSourceGenerator : BaseSourceGenerator
{
/// <inheritdoc/>
public override void Initialize(IncrementalGeneratorInitializationContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Altemiq.IO.Las.CodeGeneration;
/// The LAS source generators.
/// </summary>
[Generator(LanguageNames.CSharp)]
public class PlatformSourceGenerator : BaseSourceGenerator
public sealed class PlatformSourceGenerator : BaseSourceGenerator
{
/// <inheritdoc/>
public override void Initialize(IncrementalGeneratorInitializationContext context)
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
</ItemGroup>

<ItemGroup>
<PackageVersion Include="Meziantou.Polyfill" Version="1.0.160" />
<PackageVersion Include="Meziantou.Polyfill" Version="1.0.161" />
</ItemGroup>

<ItemGroup Label="Coding Standards">
<GlobalPackageReference Include="Altemiq.DotNet.CodingStandard" Version="1.0.360" />
<GlobalPackageReference Include="Altemiq.DotNet.CodingStandard" Version="1.0.373" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/IO.Las.Cloud/CloudExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

namespace Altemiq.IO.Las.Cloud;

#pragma warning disable SA1101

/// <summary>
/// The <see cref="Cloud"/> extensions.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "False positive")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Minor Code Smell", "S2325:Methods and properties that don't access instance data should be static", Justification = "False positive")]
public static class CloudExtensions
{
/// <summary>
Expand Down
70 changes: 70 additions & 0 deletions src/IO.Las.Compression/ChunkedReader.Mock.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// -----------------------------------------------------------------------
// <copyright file="ChunkedReader.Mock.cs" company="Altemiq">
// Copyright (c) Altemiq. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

#if DEBUG

namespace Altemiq.IO.Las;

/// <content>
/// The mock components.
/// </content>
internal partial class ChunkedReader
{
/// <summary>
/// Creates a mock <see cref="ChunkedReader"/> for testing.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="headerBlock">The header block.</param>
/// <param name="chunkSize">The chunk size.</param>
/// <returns>The mock <see cref="ChunkReader"/>.</returns>
public static ChunkedReader CreateMock(Readers.Compressed.ICompressedPointDataRecordReader reader, in HeaderBlock headerBlock, uint chunkSize) => new MockChunkedReader(reader, in headerBlock, chunkSize);

private sealed class MockChunkedReader : ChunkedReader
{
public MockChunkedReader(Readers.Compressed.ICompressedPointDataRecordReader reader, in HeaderBlock headerBlock, uint chunkSize)
: base(
new MockChunkReader(
reader,
headerBlock,
#if LAS1_4_OR_GREATER
new(headerBlock.PointDataFormat, 0, Compressor.PointWiseChunked),
#else
new(headerBlock.PointDataFormat, Compressor.PointWiseChunked),
#endif
GpsPointDataRecord.Size),
chunkSize) => this.chunkCount = 0;
}

private sealed class MockChunkReader : ChunkReader
{
public MockChunkReader(Readers.Compressed.ICompressedPointDataRecordReader rawReader, in HeaderBlock header, LasZip zip, int pointDataLength)
: base(rawReader, in header, zip, pointDataLength)
{
#if NET8_0_OR_GREATER
ref var reader = ref ReaderField(this);
reader = rawReader;
#else
SetReaderField(this, rawReader);
#endif
}

#if NET8_0_OR_GREATER
[System.Runtime.CompilerServices.UnsafeAccessor(System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "reader")]
private static extern ref Readers.Compressed.ICompressedPointDataRecordReader ReaderField(PointWiseReader reader);
#else
[System.Diagnostics.CodeAnalysis.SuppressMessage("Major Code Smell", "S3011:Reflection should not be used to increase accessibility of classes, methods, or fields", Justification = "Checked")]
private static void SetReaderField(PointWiseReader reader, Readers.Compressed.ICompressedPointDataRecordReader rawReader)
{
if (typeof(PointWiseReader).GetField("reader", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) is { } field)
{
field.SetValue(reader, rawReader);
}
}
#endif
}
}

#endif
56 changes: 1 addition & 55 deletions src/IO.Las.Compression/ChunkedReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Altemiq.IO.Las;
/// <summary>
/// The chunked <see cref="IPointReader"/>.
/// </summary>
internal closed class ChunkedReader : IPointReader
internal closed partial class ChunkedReader : IPointReader
{
private const uint DefaultChunkCount = 256;

Expand Down Expand Up @@ -45,17 +45,6 @@ protected ChunkedReader(ChunkReader reader, uint chunkSize)
/// </summary>
protected ChunkReader Reader { get; }

#if DEBUG
/// <summary>
/// Creates a mock <see cref="ChunkedReader"/> for testing.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="headerBlock">The header block.</param>
/// <param name="chunkSize">The chunk size.</param>
/// <returns>The mock <see cref="ChunkReader"/>.</returns>
public static ChunkedReader CreateMock(Readers.Compressed.ICompressedPointDataRecordReader reader, in HeaderBlock headerBlock, uint chunkSize) => new MockChunkedReader(reader, in headerBlock, chunkSize);
#endif

/// <inheritdoc/>
public virtual void Close(Stream stream)
{
Expand Down Expand Up @@ -861,47 +850,4 @@ public async ValueTask<bool> MoveNextAsync()
return this.Current.PointDataRecord is not null;
}
}

#if DEBUG
private sealed class MockChunkedReader : ChunkedReader
{
public MockChunkedReader(Readers.Compressed.ICompressedPointDataRecordReader reader, in HeaderBlock headerBlock, uint chunkSize)
: base(
new MockChunkReader(
reader,
headerBlock,
#if LAS1_4_OR_GREATER
new(headerBlock.PointDataFormat, 0, Compressor.PointWiseChunked),
#else
new(headerBlock.PointDataFormat, Compressor.PointWiseChunked),
#endif
GpsPointDataRecord.Size),
chunkSize) => this.chunkCount = 0;
}

private sealed class MockChunkReader : ChunkReader
{
public MockChunkReader(Readers.Compressed.ICompressedPointDataRecordReader rawReader, in HeaderBlock header, LasZip zip, int pointDataLength)
: base(rawReader, in header, zip, pointDataLength)
{
#if NET8_0_OR_GREATER
ref var reader = ref ReaderField(this);
reader = rawReader;
#else
SetReaderField(this, rawReader);
#endif
}

#if NET8_0_OR_GREATER
[System.Runtime.CompilerServices.UnsafeAccessor(System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "reader")]
private static extern ref Readers.Compressed.ICompressedPointDataRecordReader ReaderField(PointWiseReader reader);
#else
[System.Diagnostics.CodeAnalysis.SuppressMessage("Major Code Smell", "S3011:Reflection should not be used to increase accessibility of classes, methods, or fields", Justification = "Checked")]
private static void SetReaderField(PointWiseReader reader, Readers.Compressed.ICompressedPointDataRecordReader rawReader) =>
typeof(PointWiseReader)
.GetField("reader", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!
.SetValue(reader, rawReader);
#endif
}
#endif
}
2 changes: 1 addition & 1 deletion src/IO.Las.Compression/IO.Las.Compression.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</ItemGroup>

<ItemGroup>
<Compile Update="ExtensionMethods.*.cs;PolyfillExtensions.*.cs">
<Compile Update="ChunkedReader.*.cs;ExtensionMethods.*.cs;PolyfillExtensions.*.cs">
<DependentUpon>$([System.Text.RegularExpressions.Regex]::Replace('%(Filename)%(Extension)', '\.[^.]+\%(Extension)$', '%(Extension)'))</DependentUpon>
</Compile>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public virtual bool ChunkBytes()
public virtual void Write(Span<byte> item, ref uint context) => this.Write(item, ref context, item.Length);

/// <inheritdoc/>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "MA0042:Do not use blocking calls in an async method", Justification = "This would cause recursion.")]
public virtual ValueTask<uint> WriteAsync(Memory<byte> item, uint context, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand Down
7 changes: 3 additions & 4 deletions tests/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
</ItemGroup>

<ItemGroup Label="Aspire">
<PackageVersion Include="Aspire.Hosting.AWS" Version="13.6.0" />
<PackageVersion Include="Aspire.Hosting.Testing" Version="13.4.6" />
<PackageVersion Include="Aspire.Hosting.Testing" Version="13.5.2" />
</ItemGroup>

<ItemGroup Label="AWS">
<PackageVersion Include="AWSSDK.S3" Version="4.0.102.1" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.102.2" />
</ItemGroup>

<ItemGroup Label="Azure">
Expand All @@ -45,7 +44,7 @@
</ItemGroup>

<ItemGroup>
<GlobalPackageReference Include="Meziantou.Polyfill" Version="1.0.160" />
<GlobalPackageReference Include="Meziantou.Polyfill" Version="1.0.161" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions tools/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</ItemGroup>

<ItemGroup Label="AWS">
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.100.8" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.102.1" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.100.9" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.102.2" />
</ItemGroup>

<ItemGroup Label="Azure">
Expand All @@ -36,7 +36,7 @@
</ItemGroup>

<ItemGroup Label="Coding Standards">
<GlobalPackageReference Include="Altemiq.DotNet.CodingStandard" Version="1.0.360" />
<GlobalPackageReference Include="Altemiq.DotNet.CodingStandard" Version="1.0.373" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions web/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="AWSSDK.S3" Version="4.0.102.1" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.102.2" />
</ItemGroup>

<ItemGroup Label="Coding Standards">
<GlobalPackageReference Include="Altemiq.DotNet.CodingStandard" Version="1.0.360" />
<GlobalPackageReference Include="Altemiq.DotNet.CodingStandard" Version="1.0.373" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions web/hosts/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('$(MSBuildThisFile)', '$(MSBuildThisFileDirectory)../'))" />

<ItemGroup Label="AWS">
<PackageVersion Include="Altemiq.Aspire.Hosting.MiniStack" Version="13.4.6.1" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.100.8" />
<PackageVersion Include="Altemiq.Aspire.Hosting.MiniStack" Version="13.5.2" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.100.9" />
</ItemGroup>

<ItemGroup Label="Azure">
<PackageVersion Include="Azure.Storage.Blobs" Version="12.29.1" />
<PackageVersion Include="Aspire.Hosting.Azure.Storage" Version="13.4.6" />
<PackageVersion Include="Aspire.Hosting.Azure.Storage" Version="13.5.2" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion web/hosts/IO.Las.AWS.AppHost/IO.Las.AWS.AppHost.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Aspire.AppHost.Sdk/13.4.6">
<Project Sdk="Aspire.AppHost.Sdk/13.5.2">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<AspireUseCliBundle>true</AspireUseCliBundle>
<UserSecretsId>6467f0b0-1f4a-47cb-a251-feec08cbd622</UserSecretsId>
</PropertyGroup>

Expand Down
3 changes: 2 additions & 1 deletion web/hosts/IO.Las.Azure.AppHost/IO.Las.Azure.AppHost.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Aspire.AppHost.Sdk/13.4.6">
<Project Sdk="Aspire.AppHost.Sdk/13.5.2">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<AspireUseCliBundle>true</AspireUseCliBundle>
<UserSecretsId>b444d889-eaeb-4dca-a14d-5abe4dbbf38d</UserSecretsId>
</PropertyGroup>

Expand Down
Loading