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 0fddf90..5eb1171 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,18 @@ -FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine3.20-amd64 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 # 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 --no-restore --self-contained true --output /opt/representer # Build runtime image -FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine3.20-amd64 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/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 @@ + + + + + diff --git a/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj b/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj index 1eedb0d..8bc1ba2 100644 --- a/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj +++ b/src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj @@ -1,17 +1,14 @@ - net9.0 + net10.0 Exe - - - true - + - - + + 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"; -}