From adae6fde2f22fd07cb99f142eee277b526ea7969 Mon Sep 17 00:00:00 2001 From: Brikaa Date: Tue, 14 Sep 2021 13:59:19 +0200 Subject: [PATCH] pkg(dotnet-5.0.201): Added F#.net, F# interactive and VB.net --- api/src/job.js | 6 +-- packages/dotnet/5.0.201/build.sh | 6 ++- packages/dotnet/5.0.201/compile | 31 ++++++++++--- packages/dotnet/5.0.201/environment | 3 +- packages/dotnet/5.0.201/metadata.json | 63 ++++++++++++++++++++++++++- packages/dotnet/5.0.201/run | 22 +++++++++- packages/dotnet/5.0.201/test.fs | 6 +++ packages/dotnet/5.0.201/test.fsx | 1 + packages/dotnet/5.0.201/test.vb | 9 ++++ readme.md | 3 +- 10 files changed, 135 insertions(+), 15 deletions(-) create mode 100644 packages/dotnet/5.0.201/test.fs create mode 100644 packages/dotnet/5.0.201/test.fsx create mode 100644 packages/dotnet/5.0.201/test.vb diff --git a/api/src/job.js b/api/src/job.js index d4d19d9..552463a 100644 --- a/api/src/job.js +++ b/api/src/job.js @@ -100,9 +100,9 @@ class Job { const prlimit = [ 'prlimit', - '--nproc=' + this.runtime.max_process_count , - '--nofile=' + this.runtime.max_open_files , - '--fsize=' + this.runtime.max_file_size , + '--nproc=' + this.runtime.max_process_count, + '--nofile=' + this.runtime.max_open_files, + '--fsize=' + this.runtime.max_file_size, ]; if (memory_limit >= 0) { diff --git a/packages/dotnet/5.0.201/build.sh b/packages/dotnet/5.0.201/build.sh index c685668..6318b07 100755 --- a/packages/dotnet/5.0.201/build.sh +++ b/packages/dotnet/5.0.201/build.sh @@ -7,8 +7,10 @@ rm dotnet.tar.gz # Cache nuget packages export DOTNET_CLI_HOME=$PWD ./dotnet new console -o cache_application +./dotnet new console -lang F# -o fs_cache_application +./dotnet new console -lang VB -o vb_cache_application # This calls a restore on the global-packages index ($DOTNET_CLI_HOME/.nuget/packages) # If we want to allow more packages, we could add them to this cache_application -rm -rf cache_application -# Get rid of it, we don't actually need the application - just the restore \ No newline at end of file +rm -rf cache_application fs_cache_application vb_cache_application +# Get rid of it, we don't actually need the application - just the restore diff --git a/packages/dotnet/5.0.201/compile b/packages/dotnet/5.0.201/compile index 8bfcc27..1c34213 100644 --- a/packages/dotnet/5.0.201/compile +++ b/packages/dotnet/5.0.201/compile @@ -1,15 +1,36 @@ #!/usr/bin/env bash +[ "${PISTON_LANGUAGE}" == "fsi" ] && exit 0 + export DOTNET_CLI_HOME=$PWD export HOME=$PWD -rename 's/$/\.cs/' "$@" # Add .cs extension - dotnet build --help > /dev/null # Shut the thing up -dotnet new console -o . --no-restore -rm Program.cs +case "${PISTON_LANGUAGE}" in + basic.net) + rename 's/$/\.vb/' "$@" # Add .vb extension + dotnet new console -lang VB -o . --no-restore + rm Program.vb + ;; + fsharp.net) + first_file=$1 + shift + rename 's/$/\.fs/' "$@" # Add .fs extension + dotnet new console -lang F# -o . --no-restore + mv $first_file Program.fs # For some reason F#.net doesn't work unless the file name is Program.fs + ;; + csharp.net) + rename 's/$/\.cs/' "$@" # Add .cs extension + dotnet new console -o . --no-restore + rm Program.cs + ;; + *) + echo "How did you get here? (${PISTON_LANGUAGE})" + exit 1 + ;; +esac dotnet restore --source $DOTNET_ROOT/.nuget/packages -dotnet build --no-restore \ No newline at end of file +dotnet build --no-restore diff --git a/packages/dotnet/5.0.201/environment b/packages/dotnet/5.0.201/environment index 596d56e..468463d 100644 --- a/packages/dotnet/5.0.201/environment +++ b/packages/dotnet/5.0.201/environment @@ -2,4 +2,5 @@ # Put 'export' statements here for environment variables export DOTNET_ROOT=$PWD -export PATH=$DOTNET_ROOT:$PATH \ No newline at end of file +export PATH=$DOTNET_ROOT:$PATH +export FSI_PATH=$(find $(pwd) -name fsi.dll) diff --git a/packages/dotnet/5.0.201/metadata.json b/packages/dotnet/5.0.201/metadata.json index 619265d..7c73c58 100644 --- a/packages/dotnet/5.0.201/metadata.json +++ b/packages/dotnet/5.0.201/metadata.json @@ -1,5 +1,66 @@ { "language": "dotnet", "version": "5.0.201", - "aliases": ["cs", "csharp"] + "provides": [ + { + "language": "basic.net", + "aliases": [ + "basic", + "visual-basic", + "visual-basic.net", + "vb", + "vb.net", + "vb-dotnet", + "dotnet-vb", + "basic-dotnet", + "dotnet-basic" + ], + "limit_overrides": { "max_process_count": 128 } + }, + { + "language": "fsharp.net", + "aliases": [ + "fsharp", + "fs", + "f#", + "fs.net", + "f#.net", + "fsharp-dotnet", + "fs-dotnet", + "f#-dotnet", + "dotnet-fsharp", + "dotnet-fs", + "dotnet-fs" + ], + "limit_overrides": { "max_process_count": 128 } + }, + { + "language": "csharp.net", + "aliases": [ + "csharp", + "c#", + "cs", + "c#.net", + "cs.net", + "c#-dotnet", + "cs-dotnet", + "csharp-dotnet", + "dotnet-c#", + "dotnet-cs", + "dotnet-csharp" + ], + "limit_overrides": { "max_process_count": 128 } + }, + { + "language": "fsi", + "aliases": [ + "fsx", + "fsharp-interactive", + "f#-interactive", + "dotnet-fsi", + "fsi-dotnet", + "fsi.net" + ] + } + ] } diff --git a/packages/dotnet/5.0.201/run b/packages/dotnet/5.0.201/run index 774a08a..6b5c995 100644 --- a/packages/dotnet/5.0.201/run +++ b/packages/dotnet/5.0.201/run @@ -3,5 +3,23 @@ # Put instructions to run the runtime export DOTNET_CLI_HOME=$PWD -shift -dotnet bin/Debug/net5.0/$(basename $(realpath .)).dll "$@" \ No newline at end of file +case "${PISTON_LANGUAGE}" in + basic.net) + ;& + fsharp.net) + ;& + csharp.net) + shift + dotnet bin/Debug/net5.0/$(basename $(realpath .)).dll "$@" + ;; + fsi) + FILENAME=$1 + rename 's/$/\.fsx/' $FILENAME # Add .fsx extension + shift + dotnet $FSI_PATH $FILENAME.fsx "$@" + ;; + *) + echo "How did you get here? (${PISTON_LANGUAGE})" + exit 1 + ;; +esac diff --git a/packages/dotnet/5.0.201/test.fs b/packages/dotnet/5.0.201/test.fs new file mode 100644 index 0000000..006ac10 --- /dev/null +++ b/packages/dotnet/5.0.201/test.fs @@ -0,0 +1,6 @@ +open System + +[] +let main argv = + printfn "OK" + 0 diff --git a/packages/dotnet/5.0.201/test.fsx b/packages/dotnet/5.0.201/test.fsx new file mode 100644 index 0000000..33d166f --- /dev/null +++ b/packages/dotnet/5.0.201/test.fsx @@ -0,0 +1 @@ +printfn "OK" diff --git a/packages/dotnet/5.0.201/test.vb b/packages/dotnet/5.0.201/test.vb new file mode 100644 index 0000000..291042e --- /dev/null +++ b/packages/dotnet/5.0.201/test.vb @@ -0,0 +1,9 @@ +Imports System + +Module Module1 + + Sub Main() + Console.WriteLine("OK") + End Sub + +End Module diff --git a/readme.md b/readme.md index 5b41e6a..4ee97f1 100644 --- a/readme.md +++ b/readme.md @@ -333,7 +333,6 @@ Content-Type: application/json `d`, `dart`, `dash`, -`dotnet`, `dragon`, `elixir`, `emacs`, @@ -341,6 +340,8 @@ Content-Type: application/json `forte`, `fortran`, `freebasic`, +`fsharp`, +`fsi`, `go`, `golfscript`, `groovy`,