mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 00:58:39 +00:00
[C#] Cleaned up .NET testing script for Mono (#6016)
* Cleaned up .NET testing script for Mono Cleaned up the .NET testing script to make it a little better. It purposefully doesn't delete the .NET installer and SDk after running the script, so that they can be used in subsequent invocations. This greatly speeds up the script. The downloaded files are ignored by git by default. They can be explicitly cleaned up by runnning the clean script (clean.sh). * Trying using older Version indicator * Remove lins to monsterdata and reference it directly. * Updated appveryor script to remove copying of files no longer needed * Continue to update appveyor script to work. Disabled CS0169 in ByteBufferTest
This commit is contained in:
@@ -1,41 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Restore nuget packages
|
||||
mkdir dotnet_tmp
|
||||
curl -OL https://dot.net/v1/dotnet-install.sh
|
||||
chmod +x dotnet-install.sh
|
||||
./dotnet-install.sh --version latest --install-dir dotnet_tmp
|
||||
dotnet_tmp/dotnet new sln
|
||||
dotnet_tmp/dotnet sln add FlatBuffers.Test.csproj
|
||||
curl -OL https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe
|
||||
mono nuget.exe restore
|
||||
PROJ_FILE=FlatBuffers.Test.csproj
|
||||
|
||||
# Copy Test Files
|
||||
cp ../monsterdata_test.mon Resources/
|
||||
cp ../monsterdata_test.json Resources/
|
||||
TEMP_DOTNET_DIR=.dotnet_tmp
|
||||
TEMP_BIN=.tmp
|
||||
|
||||
[ -d $TEMP_DOTNET_DIR ] || mkdir $TEMP_DOTNET_DIR
|
||||
|
||||
[ -f dotnet-install.sh ] || curl -OL https://dot.net/v1/dotnet-install.sh
|
||||
|
||||
./dotnet-install.sh --version latest --install-dir $TEMP_DOTNET_DIR
|
||||
|
||||
DOTNET=$TEMP_DOTNET_DIR/dotnet
|
||||
|
||||
$DOTNET new sln
|
||||
$DOTNET sln add $PROJ_FILE
|
||||
$DOTNET restore -r linux-x64 $PROJ_FILE
|
||||
|
||||
# Testing C# on Linux using Mono.
|
||||
|
||||
msbuild -property:Configuration=Release,OutputPath=tempcs -verbosity:minimal FlatBuffers.Test.csproj
|
||||
mono tempcs/FlatBuffers.Test.exe
|
||||
rm -fr tempcs
|
||||
rm Resources/monsterdata_cstest.mon
|
||||
rm Resources/monsterdata_cstest_sp.mon
|
||||
msbuild -property:Configuration=Release,OutputPath=$TEMP_BIN -verbosity:minimal $PROJ_FILE
|
||||
mono $TEMP_BIN/FlatBuffers.Test.exe
|
||||
rm -fr $TEMP_BIN
|
||||
|
||||
# Repeat with unsafe versions
|
||||
msbuild -property:Configuration=Release,UnsafeByteBuffer=true,OutputPath=$TEMP_BIN -verbosity:minimal $PROJ_FILE
|
||||
mono $TEMP_BIN/FlatBuffers.Test.exe
|
||||
rm -fr $TEMP_BIN
|
||||
|
||||
msbuild -property:Configuration=Release,UnsafeByteBuffer=true,OutputPath=tempcsUnsafe -verbosity:minimal FlatBuffers.Test.csproj
|
||||
mono tempcsUnsafe/FlatBuffers.Test.exe
|
||||
rm -fr tempcsUnsafe
|
||||
rm Resources/monsterdata_cstest.mon
|
||||
rm Resources/monsterdata_cstest_sp.mon
|
||||
|
||||
# Remove Temp Files
|
||||
rm -fr dotnet_tmp
|
||||
rm -fr packages
|
||||
rm dotnet-install.sh
|
||||
rm nuget.exe
|
||||
rm FlatBuffers.Test.sln
|
||||
rm Resources/monsterdata_test.mon
|
||||
rm Resources/monsterdata_test.json
|
||||
|
||||
rm -rf obj
|
||||
|
||||
Reference in New Issue
Block a user