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: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*
!src/Exercism.Representers.CSharp
src/Exercism.Representers.CSharp/bin/
src/Exercism.Representers.CSharp/obj/
bin/
obj/
!bin/run.sh
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/ .
Expand Down
27 changes: 0 additions & 27 deletions Exercism.Representers.CSharp.sln

This file was deleted.

5 changes: 5 additions & 0 deletions Exercism.Representers.CSharp.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Solution>
<Folder Name="/src/">
<Project Path="src/Exercism.Representers.CSharp/Exercism.Representers.CSharp.csproj" />
</Folder>
</Solution>
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<PropertyGroup>
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
<PackageReference Include="Humanizer.Core" Version="3.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0" />
</ItemGroup>

</Project>
5 changes: 0 additions & 5 deletions src/Exercism.Representers.CSharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}