1#!/bin/sh 2 3# Restore nuget packages 4mkdir dotnet_tmp 5curl -OL https://dot.net/v1/dotnet-install.sh 6chmod +x dotnet-install.sh 7./dotnet-install.sh --version 3.1.101 --install-dir dotnet_tmp 8dotnet_tmp/dotnet new sln 9dotnet_tmp/dotnet sln add FlatBuffers.Test.csproj 10curl -OL https://dist.nuget.org/win-x86-commandline/v5.4.0/nuget.exe 11mono nuget.exe restore 12 13# Copy Test Files 14cp ../monsterdata_test.mon Resources/ 15cp ../monsterdata_test.json Resources/ 16 17# Testing C# on Linux using Mono. 18 19msbuild -property:Configuration=Release,OutputPath=tempcs -verbosity:minimal FlatBuffers.Test.csproj 20mono tempcs/FlatBuffers.Test.exe 21rm -fr tempcs 22rm Resources/monsterdata_cstest.mon 23rm Resources/monsterdata_cstest_sp.mon 24 25# Repeat with unsafe versions 26 27msbuild -property:Configuration=Release,UnsafeByteBuffer=true,OutputPath=tempcsUnsafe -verbosity:minimal FlatBuffers.Test.csproj 28mono tempcsUnsafe/FlatBuffers.Test.exe 29rm -fr tempcsUnsafe 30rm Resources/monsterdata_cstest.mon 31rm Resources/monsterdata_cstest_sp.mon 32 33# Remove Temp Files 34rm -fr dotnet_tmp 35rm -fr packages 36rm dotnet-install.sh 37rm nuget.exe 38rm FlatBuffers.Test.sln 39rm Resources/monsterdata_test.mon 40rm Resources/monsterdata_test.json 41 42