From b776af831a67eaa81ac8835e6e0c549b32b8b0bf Mon Sep 17 00:00:00 2001 From: ms-iankudinova <96417511+ms-iankudinova@users.noreply.github.com> Date: Fri, 6 Oct 2023 09:23:52 +0100 Subject: [PATCH] Add target .net 6 for the 1DS Test Server (#1217) * Update .net version to .net 6 * support both frameworks .net6 and old one .net core 3 * Update scripts, that runs test server to specify flags for target frameworks * Change indent * Use $framework value in the echo --- tools/server/run.cmd | 30 +++++++++++++++++++++++++++++- tools/server/run.sh | 38 +++++++++++++++++++++++++++++++++++++- tools/server/server.csproj | 6 +++--- 3 files changed, 69 insertions(+), 5 deletions(-) diff --git a/tools/server/run.cmd b/tools/server/run.cmd index 1005fcc5a..f1d297ddd 100644 --- a/tools/server/run.cmd +++ b/tools/server/run.cmd @@ -1 +1,29 @@ -dotnet run +@ECHO OFF +set framework="netcoreapp3.1" + +:loop +IF NOT "%1"=="" ( + IF "%1"=="-f" ( + SET framework=%2 + SHIFT + ) + IF "%1"=="--framework" ( + SET framework=%2 + SHIFT + ) + IF "%1"=="-h" GOTO :help + IF "%1"=="--help" GOTO :help + SHIFT + GOTO :loop +) +echo "1DS test telemetry server will be run with %framework%" +dotnet run --framework %framework% +goto:eof + +:help + echo "Run 1DS Test Telemetry Server with specified runtime versions (.net core 3 or .net6)." + echo "Syntax: run.sh [-f,--framework|-h, --help]" + echo "options:" + echo "-f | --framework Run server with specified version of runtime. Supported values: netcoreapp3.1 or net6.0. Default value is netcoreapp3.1, if option is not specified" + echo "-h | --help Help." + goto:eof \ No newline at end of file diff --git a/tools/server/run.sh b/tools/server/run.sh index 2c6f40330..d1cc32ed3 100755 --- a/tools/server/run.sh +++ b/tools/server/run.sh @@ -1,3 +1,39 @@ #!/bin/sh -dotnet run + +############################################################ +# Help # +############################################################ +Help() +{ + # Display Help + echo "Run 1DS Test Telemetry Server with specified runtime versions (.net core 3 or .net6)." + echo + echo "Syntax: run.sh [-f,--framework|-h, --help]" + echo "options:" + echo "-f | --framework Run server with specified version of runtime. Supported values: netcoreapp3.1 or net6.0. Default value is netcoreapp3.1, if option is not specified" + echo "-h | --help Help." + echo + + exit 0 +} + +framework="netcoreapp3.1" +while test $# -gt 0; +do + case "$1" in + -h|--help) Help;; + -f|--framework) + shift + if test $# -gt 0; then + framework=$1 + else + echo "--framework option value is not specified. Server will be run with $framework" + fi + shift + ;; + *) break;; + esac +done +echo "1DS test telemetry server will be run with $framework" +dotnet run -f $framework diff --git a/tools/server/server.csproj b/tools/server/server.csproj index 5c1c0d9be..2885d9e03 100644 --- a/tools/server/server.csproj +++ b/tools/server/server.csproj @@ -1,9 +1,9 @@  - netcoreapp3.1 - true - true + netcoreapp3.1;net6.0 + true + true true