From ca8551bb1d7bc5f8e4bed9f6d6efa4d9971d84f9 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 4 Mar 2026 08:57:08 +0100 Subject: [PATCH 1/7] Migrate to new solution format --- Exercism.Representers.CSharp.sln | 27 --------------------------- Exercism.Representers.CSharp.slnx | 5 +++++ 2 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 Exercism.Representers.CSharp.sln create mode 100644 Exercism.Representers.CSharp.slnx diff --git a/Exercism.Representers.CSharp.sln b/Exercism.Representers.CSharp.sln deleted file mode 100644 index 795cd22..0000000 --- a/Exercism.Representers.CSharp.sln +++ /dev/null @@ -1,27 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{6A54729E-66DC-4CC4-9A09-3A55E04A715A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exercism.Representers.CSharp", "src\Exercism.Representers.CSharp\Exercism.Representers.CSharp.csproj", "{100CC161-274C-4325-9059-AA00DDE3EFFB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {100CC161-274C-4325-9059-AA00DDE3EFFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {100CC161-274C-4325-9059-AA00DDE3EFFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {100CC161-274C-4325-9059-AA00DDE3EFFB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {100CC161-274C-4325-9059-AA00DDE3EFFB}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {100CC161-274C-4325-9059-AA00DDE3EFFB} = {6A54729E-66DC-4CC4-9A09-3A55E04A715A} - EndGlobalSection -EndGlobal diff --git a/Exercism.Representers.CSharp.slnx b/Exercism.Representers.CSharp.slnx new file mode 100644 index 0000000..511d90b --- /dev/null +++ b/Exercism.Representers.CSharp.slnx @@ -0,0 +1,5 @@ + + + + + From 36d47c37bd95f6e8370a63ea5e2415cb9a3cce1d Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 4 Mar 2026 09:05:26 +0100 Subject: [PATCH 2/7] Upgrade .NET 10 Docker image --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0fddf90..92849e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine3.20-amd64 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0.103-alpine3.23 AS build WORKDIR /app # Copy csproj and restore as distinct layers @@ -10,7 +10,7 @@ COPY src/Exercism.Representers.CSharp/ ./ RUN dotnet publish -r linux-musl-x64 -c Release --self-contained true -o /opt/representer # Build runtime image -FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine3.20-amd64 AS runtime +FROM mcr.microsoft.com/dotnet/runtime-deps:10.0.103-alpine3.23 AS runtime WORKDIR /opt/representer COPY --from=build /opt/representer/ . From cb41af525f01f632a54cd383400d373d25509062 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 4 Mar 2026 14:08:15 +0100 Subject: [PATCH 3/7] Gebruik .NET 10 als project --- .../Exercism.Representers.CSharp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj b/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj index 1eedb0d..486e6bc 100644 --- a/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj +++ b/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 Exe From 79f16584921939c06c7e3e959d5767afd28d6a8f Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 4 Mar 2026 14:23:58 +0100 Subject: [PATCH 4/7] Upgrade packages --- .../Exercism.Representers.CSharp.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj b/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj index 486e6bc..6f4ef3c 100644 --- a/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj +++ b/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj @@ -10,8 +10,8 @@ - - + + From 26d3f42eefa573039ed627f5fb59d9cb1e1de8e1 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 4 Mar 2026 14:24:06 +0100 Subject: [PATCH 5/7] Verwijder ongebruikte klasse --- src/Exercism.Representers.CSharp/Program.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Exercism.Representers.CSharp/Program.cs b/src/Exercism.Representers.CSharp/Program.cs index 9784eeb..5a2965c 100644 --- a/src/Exercism.Representers.CSharp/Program.cs +++ b/src/Exercism.Representers.CSharp/Program.cs @@ -25,8 +25,3 @@ private static void CreateRepresentation(Options options) Console.WriteLine($"Created representation for {options.Slug} solution in directory {options.OutputDirectory}"); } } - -internal static class StringExtensions -{ - internal static string Normalized(this string str) => str.TrimEnd().Replace("\r\n", "\n") + "\n"; -} From ca8b17a410708e5024841a933d06d8bf77830bde Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 4 Mar 2026 15:11:54 +0100 Subject: [PATCH 6/7] Allow for mult-architecture builds --- .dockerignore | 2 ++ Dockerfile | 10 ++++++---- .../Exercism.Representers.CSharp.csproj | 5 +---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index 9f6fe67..ba01d2e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,7 @@ * !src/Exercism.Representers.CSharp +src/Exercism.Representers.CSharp/bin/ +src/Exercism.Representers.CSharp/obj/ bin/ obj/ !bin/run.sh \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 92849e7..5ba6ba6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,18 @@ -FROM mcr.microsoft.com/dotnet/sdk:10.0.103-alpine3.23 AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.103-alpine3.23 AS build +ARG TARGETARCH + WORKDIR /app # Copy csproj and restore as distinct layers COPY src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj . -RUN dotnet restore -r linux-musl-x64 +RUN dotnet restore -a $TARGETARCH --os linux-musl # Copy everything else and build COPY src/Exercism.Representers.CSharp/ ./ -RUN dotnet publish -r linux-musl-x64 -c Release --self-contained true -o /opt/representer +RUN dotnet publish -a $TARGETARCH --os linux-musl --self-contained true -c Release -o /opt/representer --no-restore # Build runtime image -FROM mcr.microsoft.com/dotnet/runtime-deps:10.0.103-alpine3.23 AS runtime +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime-deps:10.0.3-alpine3.23 AS runtime WORKDIR /opt/representer COPY --from=build /opt/representer/ . diff --git a/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj b/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj index 6f4ef3c..8bc1ba2 100644 --- a/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj +++ b/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj @@ -3,12 +3,9 @@ net10.0 Exe - - - true - + From 044d6c8fb8cbd3708f870714f3d8935cd49920bf Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 4 Mar 2026 15:13:28 +0100 Subject: [PATCH 7/7] Simplify dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ba6ba6..5eb1171 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,11 @@ WORKDIR /app # Copy csproj and restore as distinct layers COPY src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj . -RUN dotnet restore -a $TARGETARCH --os linux-musl +RUN dotnet restore -a $TARGETARCH # Copy everything else and build COPY src/Exercism.Representers.CSharp/ ./ -RUN dotnet publish -a $TARGETARCH --os linux-musl --self-contained true -c Release -o /opt/representer --no-restore +RUN dotnet publish -a $TARGETARCH --no-restore --self-contained true --output /opt/representer # Build runtime image FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime-deps:10.0.3-alpine3.23 AS runtime