1#!/bin/sh 2 3PROJ_FILE=FlatBuffers.Test.csproj 4CORE_PROJ_FILE=FlatBuffers.Core.Test.csproj 5 6TEMP_DOTNET_DIR=.dotnet_tmp 7TEMP_BIN=.tmp 8 9[ -d $TEMP_DOTNET_DIR ] || mkdir $TEMP_DOTNET_DIR 10 11[ -f dotnet-install.sh ] || curl -OL https://dot.net/v1/dotnet-install.sh 12 13./dotnet-install.sh --version latest --install-dir $TEMP_DOTNET_DIR 14 15DOTNET=$TEMP_DOTNET_DIR/dotnet 16 17$DOTNET new sln 18$DOTNET sln add $PROJ_FILE 19$DOTNET restore -r linux-x64 $PROJ_FILE 20 21# Testing C# on Linux using Mono. 22msbuild -property:Configuration=Release,OutputPath=$TEMP_BIN -verbosity:minimal $PROJ_FILE 23mono $TEMP_BIN/FlatBuffers.Test.exe 24rm -fr $TEMP_BIN 25 26# Repeat with unsafe versions 27msbuild -property:Configuration=Release,UnsafeByteBuffer=true,OutputPath=$TEMP_BIN -verbosity:minimal $PROJ_FILE 28mono $TEMP_BIN/FlatBuffers.Test.exe 29rm -fr $TEMP_BIN 30 31rm FlatBuffers.Test.sln 32rm -rf obj 33 34$DOTNET new sln 35$DOTNET sln add $CORE_PROJ_FILE 36$DOTNET restore -r linux-x64 $CORE_PROJ_FILE 37 38# Testing C# on Linux using .Net Core. 39msbuild -property:Configuration=Release,OutputPath=$TEMP_BIN -verbosity:minimal $CORE_PROJ_FILE 40$TEMP_BIN/FlatBuffers.Core.Test.exe 41rm -fr $TEMP_BIN 42 43# Repeat with unsafe versions 44msbuild -property:Configuration=Release,UnsafeByteBuffer=true,OutputPath=$TEMP_BIN -verbosity:minimal $CORE_PROJ_FILE 45$TEMP_BIN/FlatBuffers.Core.Test.exe 46rm -fr $TEMP_BIN 47 48# Repeat with SpanT versions 49msbuild -property:Configuration=Release,EnableSpanT=true,OutputPath=$TEMP_BIN -verbosity:minimal $CORE_PROJ_FILE 50$TEMP_BIN/FlatBuffers.Core.Test.exe 51rm -fr $TEMP_BIN 52 53rm FlatBuffers.Core.Test.sln 54rm -rf obj 55