Skip to content

Commit

Permalink
Add target .net 6 for the 1DS Test Server (#1217)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ms-iankudinova authored Oct 6, 2023
1 parent 36bc9b2 commit b776af8
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 5 deletions.
30 changes: 29 additions & 1 deletion tools/server/run.cmd
Original file line number Diff line number Diff line change
@@ -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
38 changes: 37 additions & 1 deletion tools/server/run.sh
Original file line number Diff line number Diff line change
@@ -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

6 changes: 3 additions & 3 deletions tools/server/server.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>

Expand Down

0 comments on commit b776af8

Please sign in to comment.