From ae11977a707a59b86d44a2822e067b5932c0d4a8 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Mon, 9 Dec 2024 20:54:08 +0530 Subject: [PATCH 1/2] feat: add Dockerfile for .NET 9.0 with build configuration --- dockerfiles/dotnet-9.0.Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dockerfiles/dotnet-9.0.Dockerfile diff --git a/dockerfiles/dotnet-9.0.Dockerfile b/dockerfiles/dotnet-9.0.Dockerfile new file mode 100644 index 0000000..e2c7723 --- /dev/null +++ b/dockerfiles/dotnet-9.0.Dockerfile @@ -0,0 +1,20 @@ +# syntax=docker/dockerfile:1.7-labs +FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine + +WORKDIR /app + +# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses +COPY --exclude=.git --exclude=README.md . /app + +# This saves nuget packages to ~/.nuget +RUN dotnet build --configuration Release . + +# This seems to cause a caching issue with the dotnet build command, where old contents are used +# TODO: See if this needs to be brought back? +# RUN rm -rf /app/obj +# RUN rm -rf /app/bin + +RUN echo "cd \${CODECRAFTERS_REPOSITORY_DIR} && dotnet build --configuration Release ." > /codecrafters-precompile.sh +RUN chmod +x /codecrafters-precompile.sh + +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="codecrafters-redis.csproj,codecrafters-redis.sln" From ec0c4cf195fc8cada8d8609c7d7235fadedfda0f Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Mon, 9 Dec 2024 20:54:42 +0530 Subject: [PATCH 2/2] chore: update C# project files to target .NET 9.0 --- compiled_starters/csharp/codecrafters-redis.csproj | 2 +- compiled_starters/csharp/codecrafters.yml | 4 ++-- solutions/csharp/01-jm1/code/codecrafters-redis.csproj | 2 +- solutions/csharp/01-jm1/code/codecrafters.yml | 4 ++-- starter_templates/csharp/code/codecrafters-redis.csproj | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiled_starters/csharp/codecrafters-redis.csproj b/compiled_starters/csharp/codecrafters-redis.csproj index 3629673..ee68fa9 100644 --- a/compiled_starters/csharp/codecrafters-redis.csproj +++ b/compiled_starters/csharp/codecrafters-redis.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 codecrafters_redis enable enable diff --git a/compiled_starters/csharp/codecrafters.yml b/compiled_starters/csharp/codecrafters.yml index 80bc236..a8805bf 100644 --- a/compiled_starters/csharp/codecrafters.yml +++ b/compiled_starters/csharp/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the C# version used to run your code # on Codecrafters. # -# Available versions: dotnet-8.0 -language_pack: dotnet-8.0 +# Available versions: dotnet-9.0 +language_pack: dotnet-9.0 diff --git a/solutions/csharp/01-jm1/code/codecrafters-redis.csproj b/solutions/csharp/01-jm1/code/codecrafters-redis.csproj index 3629673..ee68fa9 100644 --- a/solutions/csharp/01-jm1/code/codecrafters-redis.csproj +++ b/solutions/csharp/01-jm1/code/codecrafters-redis.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 codecrafters_redis enable enable diff --git a/solutions/csharp/01-jm1/code/codecrafters.yml b/solutions/csharp/01-jm1/code/codecrafters.yml index 80bc236..a8805bf 100644 --- a/solutions/csharp/01-jm1/code/codecrafters.yml +++ b/solutions/csharp/01-jm1/code/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the C# version used to run your code # on Codecrafters. # -# Available versions: dotnet-8.0 -language_pack: dotnet-8.0 +# Available versions: dotnet-9.0 +language_pack: dotnet-9.0 diff --git a/starter_templates/csharp/code/codecrafters-redis.csproj b/starter_templates/csharp/code/codecrafters-redis.csproj index 3629673..ee68fa9 100644 --- a/starter_templates/csharp/code/codecrafters-redis.csproj +++ b/starter_templates/csharp/code/codecrafters-redis.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 codecrafters_redis enable enable