Skip to content

Commit

Permalink
move to mono with scriptcs
Browse files Browse the repository at this point in the history
  • Loading branch information
corsicanec82 committed Dec 10, 2021
1 parent 4dc751d commit bc8a2f6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
25 changes: 11 additions & 14 deletions 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
4 changes: 3 additions & 1 deletion bin/test.sh
@@ -1 +1,3 @@
dotnet script Test.csx 2>&1
#!/bin/bash

scriptcs Test.csx 2>&1
2 changes: 1 addition & 1 deletion modules/10-basics/10-hello-world/Exercise.csx
@@ -1 +1 @@
Console.WriteLine("Hello, World!");
Console.WriteLine("Hello, World!");
12 changes: 10 additions & 2 deletions 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();
}
}
2 changes: 1 addition & 1 deletion 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"

0 comments on commit bc8a2f6

Please sign in to comment.