diff --git a/Dockerfile b/Dockerfile index 9ad7ba8..b1d87ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,22 @@ FROM hexletbasics/base-image:latest -ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 +RUN apt-get update && apt-get install -yq mono-devel -RUN wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \ - dpkg -i packages-microsoft-prod.deb && \ - rm packages-microsoft-prod.deb -RUN apt-get update && apt-get install -y dotnet-sdk-5.0 +ARG SCRIPCS_VERSION=0.17.1 -WORKDIR /exercises-csharp -ENV PATH=/exercises-csharp/bin:$PATH +RUN wget -q https://github.com/scriptcs/scriptcs/archive/refs/tags/v${SCRIPCS_VERSION}.tar.gz \ + && tar -xzf v${SCRIPCS_VERSION}.tar.gz \ + && rm v${SCRIPCS_VERSION}.tar.gz -RUN dotnet tool install -g JetBrains.ReSharper.GlobalTools -RUN dotnet tool install -g dotnet-script +RUN cd scriptcs-${SCRIPCS_VERSION} && ./build.sh +ENV PATH=/scriptcs-${SCRIPCS_VERSION}/artifacts/Release/bin:$PATH -ENV PATH=/root/.dotnet/tools:$PATH +RUN scriptcs -install PowerAssert 1.0.87 -COPY src/ src/ +WORKDIR /exercises-csharp +ENV PATH=/exercises-csharp/bin:$PATH -RUN dotnet script src/Warmup.csx +COPY src src RUN ln -s /exercises-csharp/src /src COPY . . - -RUN make test diff --git a/bin/test.sh b/bin/test.sh index 5188d69..cc70c08 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -1 +1,3 @@ -dotnet script Test.csx 2>&1 +#!/bin/bash + +scriptcs Test.csx 2>&1 diff --git a/modules/10-basics/10-hello-world/Exercise.csx b/modules/10-basics/10-hello-world/Exercise.csx index 193a0ed..b0d8124 100644 --- a/modules/10-basics/10-hello-world/Exercise.csx +++ b/modules/10-basics/10-hello-world/Exercise.csx @@ -1 +1 @@ -Console.WriteLine("Hello, World!"); \ No newline at end of file +Console.WriteLine("Hello, World!"); diff --git a/src/Functions.csx b/src/Functions.csx index af46543..772b791 100644 --- a/src/Functions.csx +++ b/src/Functions.csx @@ -1,5 +1,13 @@ class Functions { - public static double Random() => new Random().Next(); - public static double RandomDouble() => new Random().NextDouble(); + // public static double Random() => new Random().Next(); + // public static double RandomDouble() => new Random().NextDouble(); + + public static double Random() { + return new Random().Next(); + } + + public static double RandomDouble() { + return new Random().NextDouble(); + } } diff --git a/src/Init.csx b/src/Init.csx index e1e75ea..7c25ea5 100644 --- a/src/Init.csx +++ b/src/Init.csx @@ -1,2 +1,2 @@ -#r "/root/.nuget/packages/powerassert/1.0.87/lib/netstandard2.0/PowerAssert.dll" +#r "/scriptcs_packages/PowerAssert.1.0.87/lib/netstandard2.0/PowerAssert.dll" #load "Functions.csx"