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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'

- name: Display .NET info
run: dotnet --info
Expand Down
4 changes: 2 additions & 2 deletions DocoptNet.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
# Visual Studio Version 18
VisualStudioVersion = 18.1.11312.151 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{AE631D61-6BE6-438F-A535-955BB9A0218F}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion eg/NavalFate/NavalFate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion eg/SourceGenerator/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..'))" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<DebugDocoptNet>false</DebugDocoptNet>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.300",
"version": "10.0.100",
"rollForward": "latestPatch"
}
}
2 changes: 1 addition & 1 deletion src/DocoptNet.Playground/App.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@* Licensed under terms of MIT license (see LICENSE-MIT)
Copyright 2021 Atif Aziz, Dinh Doan Van Bien *@
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" />
</Found>
Expand Down
6 changes: 3 additions & 3 deletions src/DocoptNet.Playground/DocoptNet.Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.6" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.22" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.22" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.1" />
</ItemGroup>

<!--
Expand Down
14 changes: 7 additions & 7 deletions src/DocoptNet/DocoptNet.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;netstandard2.0;netstandard1.5</TargetFrameworks>
<TargetFrameworks>netstandard2.1;netstandard2.0;net47</TargetFrameworks>
<DefineConstants>$(DefineConstants);DOCOPTNET_PUBLIC</DefineConstants>
<!--
TODO Remove the suppression of the following warnings after addressing them:
Expand Down Expand Up @@ -37,19 +37,19 @@ Portions Copyright (C) .NET Foundation and Contributors.
Portions Copyright (C) West Wind Technologies, 2008.
</Copyright>
<PackageTags>parser;command line argument;option library;syntax;shell;beautiful;posix;python;console;command-line;docopt</PackageTags>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1' Or '$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>$(DefineConstants);RUNTIME_SERIALIZATION</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.5'">
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'net47'">
<Compile Remove="CodeGeneration\*.cs" />
<None Include="CodeGeneration\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard1.5'">
<ItemGroup Condition="'$(TargetFramework)' != 'net47'">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.10.0" PrivateAssets="all" />
<AdditionalFiles Include="CodeGeneration\AnalyzerReleases.*.md" />
</ItemGroup>
Expand All @@ -72,19 +72,19 @@ Portions Copyright (C) West Wind Technologies, 2008.
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.39">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="PolySharp" Version="1.14.1">
<PackageReference Include="PolySharp" Version="1.15.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions tests/DocoptNet.Tests/DocoptNet.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;net47</TargetFrameworks>
<TargetFrameworks>net10.0;net8.0;net47</TargetFrameworks>
<AssemblyOriginatorKeyFile>..\..\src\DocoptNet\DocoptNet.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
Expand All @@ -27,13 +27,13 @@
<ItemGroup>
<PackageReference Include="Basic.Reference.Assemblies" Version="1.4.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.10.0" />
<PackageReference Include="morelinq" Version="4.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="morelinq" Version="4.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="nunit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="System.ValueTuple" Version="4.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 10 additions & 4 deletions tests/DocoptNet.Tests/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static MatchResult Match(this Pattern pattern, params LeafPattern[] left)
}
}

#if NETCOREAPP3_1_OR_GREATER
#if NET8_0_OR_GREATER

[Flags]
enum StreamContentComparisonFlags
Expand Down Expand Up @@ -70,11 +70,17 @@ public static bool ContentEquals(this Stream first, Stream second,

for (var i = 0; i < iterations; i++)
{
first.Read(buffer1);
second.Read(buffer2);
buffer1.Clear();
buffer2.Clear();

if (BitConverter.ToInt64(buffer1) != BitConverter.ToInt64(buffer2))
var bytesRead1 = first.Read(buffer1);
var bytesRead2 = second.Read(buffer2);

if (bytesRead1 != bytesRead2
|| BitConverter.ToInt64(buffer1) != BitConverter.ToInt64(buffer2))
{
return false;
}
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion tests/DocoptNet.Tests/NUnitExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class NUnitExtensions
{
// Credit: https://github.com/nunit/nunit/issues/2820#issuecomment-511488287

public static EqualConstraint ParamName(this ConstraintExpression with, string paramName) =>
public static Constraint ParamName(this ConstraintExpression with, string paramName) =>
with.Property("ParamName").EqualTo(paramName);
}
}
2 changes: 1 addition & 1 deletion tests/Integration/DocoptNet.Tests.Integration.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<RestoreAdditionalProjectSources>$(MSBuildThisFileDirectory)..\..\dist</RestoreAdditionalProjectSources>
<RestorePackagesPath>$(MSBuildThisFileDirectory).nuget</RestorePackagesPath>
Expand Down
10 changes: 7 additions & 3 deletions tests/LanguageAgnosticTests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0.300-alpine3.19-amd64 AS build
ARG SDK_VERSION=10.0.101
ARG RUNTIME_VERSION=10.0.1
ARG BASE_IMAGE=alpine3.22-amd64

FROM mcr.microsoft.com/dotnet/sdk:${SDK_VERSION}-${BASE_IMAGE} AS build

WORKDIR /project

Expand All @@ -8,11 +12,11 @@ COPY tests/LanguageAgnosticTests tests/LanguageAgnosticTests

RUN dotnet build tests/LanguageAgnosticTests

FROM mcr.microsoft.com/dotnet/runtime:8.0.6-alpine3.19-amd64
FROM mcr.microsoft.com/dotnet/runtime:${RUNTIME_VERSION}-${BASE_IMAGE}

WORKDIR /tests

COPY --from=build /project/tests/LanguageAgnosticTests/bin/Debug/net8.0/ bin
COPY --from=build /project/tests/LanguageAgnosticTests/bin/Debug/net10.0/ bin
COPY --from=build /project/tests/LanguageAgnosticTests/*.py .
COPY --from=build /project/tests/LanguageAgnosticTests/*.docopt .

Expand Down
2 changes: 1 addition & 1 deletion tests/LanguageAgnosticTests/Testee.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down