#!/bin/bash SYSTEM=`uname -s` BUILD_CONFIG=Debug PUBLISH_CONFIG=Release NETCOREVER=netcoreapp3.1 RUNTIME_WIN=win-x64 RUNTIME_LINUX=ubuntu.16.04-x64 RUNTIME=$RUNTIME_WIN if [ $SYSTEM = "Linux" ] ; then RUNTIME=$RUNTIME_LINUX fi RELEASE_OUTPUT=./publish/ cd ../Test/SocketTest build_one_proj() { dotnet publish $1 --configuration $PUBLISH_CONFIG --runtime $RUNTIME --output $RELEASE_OUTPUT$1 --framework $NETCOREVER if [ $? -ne 0 ]; then echo "****************************** build error **********************" exit 0 else echo "****************************** build success ********************" fi } build_one_proj ClientSocket build_one_proj ServerSocket