You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.3 KiB

1 month ago
#!/bin/bash
set -x
SYSTEM=`uname -s`
BUILD_CONFIG=Debug
PUBLISH_CONFIG=Release
NETCOREVER=net5.0
RUNTIME_WIN=win10-x64
RUNTIME_LINUX=ubuntu.16.04-x64
RUNTIME_MAC=osx-x64
RUNTIME=$RUNTIME_WIN
if [ $SYSTEM = "Linux" ] ; then
RUNTIME=$RUNTIME_LINUX;
elif [ $SYSTEM = "Darwin" ] ; then
RUNTIME=$RUNTIME_MAC;
fi
Cli_Str="../../../pandora_share_proj/protocol"
RESTORE=true
PUBLISH=false
build_one_proj_exe()
{
if [ $RESTORE = "true" ] ; then
dotnet restore $1
fi
str=$Cli_Str"/"$RUNTIME
if [ $SYSTEM = "Darwin" ] ; then
str="../"$str
fi
echo $str
if [ $PUBLISH = "true" ] ; then
dotnet publish $1 --configuration $PUBLISH_CONFIG --runtime $RUNTIME --output $str --framework $NETCOREVER
else
dotnet build $1 --configuration $BUILD_CONFIG --runtime $RUNTIME --output $str --framework $NETCOREVER
fi
if [ $? -ne 0 ]; then
echo "****************************** build error ******************************"
exit 0
fi
}
#echo "input:" $1 $2
#if [ "$1" = "publish" ] ; then
# RUNTIME=$RUNTIME_LINUX
# PUBLISH=true
#fi
if [ "$2" = "mac" ]||[ "$1" == "mac" ] ; then
RUNTIME=$RUNTIME_MAC
fi
if [ "$2" = "win" ]||[ "$1" == "win" ] ; then
RUNTIME=$RUNTIME_WIN
fi
if [ "$2" = "linux" ]||[ "$1" == "linux" ] ; then
RUNTIME=$RUNTIME_LINUX
fi
cd protocsstruct
build_one_proj_exe protocsstruct.csproj
echo $SYSTEM