#!/bin/bash set -x SYSTEM=`uname -s` BUILD_CONFIG=Debug PUBLISH_CONFIG=Release NETCOREVER=net6.0 RUNTIME_WIN=win7-x64 RUNTIME_LINUX=ubuntu.18.04-x64 RUNTIME_MAC=osx.10.12-x64 RUNTIME=$RUNTIME_WIN if [ $SYSTEM = "Linux" ] ; then RUNTIME=$RUNTIME_LINUX fi if [ $SYSTEM = "Darwin" ] ; then RUNTIME=$RUNTIME_MAC fi RESTORE=true PUBLISH=true build_one_proj_exe() { if [ $RESTORE = "true" ] ; then dotnet restore ./$1 fi str=$RUNTIME"/bin" 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 } 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 build_one_proj_exe ExcelExport echo $SYSTEM