feat(CORE/bash): implemented acore dashboard for Windows (#13476)

+ implemented acore dashboard for windows
+ integrated acore dashboard for windows in our pipeline
+ implemented dry run for windows build
+ fixed permissions issue for all the operating systems
+ code clean
This commit is contained in:
Yehonal
2022-10-22 15:40:13 +02:00
committed by GitHub
parent b35c907cde
commit 171df31196
8 changed files with 130 additions and 54 deletions

View File

@@ -19,12 +19,7 @@ function comp_ccacheEnable() {
export CCACHE_COMPRESSLEVEL=${CCACHE_COMPRESSLEVEL:-9}
#export CCACHE_NODIRECT=true
unamestr=$(uname)
if [[ "$unamestr" == 'Darwin' ]]; then
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libcrypto.dylib"
else
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
fi
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
}
function comp_ccacheClean() {
@@ -70,6 +65,19 @@ function comp_configure() {
comp_ccacheEnable
OSOPTIONS=""
echo "Platform: $OSTYPE"
case "$OSTYPE" in
darwin*)
OSOPTIONS=" -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libcrypto.dylib "
;;
msys*)
OSOPTIONS=" -DMYSQL_INCLUDE_DIR=C:\tools\mysql\current\include -DMYSQL_LIBRARY=C:\tools\mysql\current\lib\mysqlclient.lib "
;;
esac
cmake $SRCPATH -DCMAKE_INSTALL_PREFIX=$BINPATH $DCONF \
-DAPPS_BUILD=$CAPPS_BUILD \
-DTOOLS_BUILD=$CTOOLS_BUILD \
@@ -82,7 +90,7 @@ function comp_configure() {
-DWITH_WARNINGS=$CWARNINGS \
-DCMAKE_C_COMPILER=$CCOMPILERC \
-DCMAKE_CXX_COMPILER=$CCOMPILERCXX \
$CBUILD_APPS_LIST $CBUILD_TOOLS_LIST $CCUSTOMOPTIONS
$CBUILD_APPS_LIST $CBUILD_TOOLS_LIST $OSOPTIONS $CCUSTOMOPTIONS
cd $CWD
@@ -100,25 +108,50 @@ function comp_compile() {
comp_ccacheResetStats
time make -j $MTHREADS
make -j $MTHREADS install
time cmake --build . --config $CTYPE -j $MTHREADS
comp_ccacheShowStats
cd $CWD
echo "Platform: $OSTYPE"
case "$OSTYPE" in
msys*)
cmake --install . --config $CTYPE
if [[ $DOCKER = 1 ]]; then
echo "Generating confs..."
cp -n "env/dist/etc/worldserver.conf.dockerdist" "env/dist/etc/worldserver.conf"
cp -n "env/dist/etc/authserver.conf.dockerdist" "env/dist/etc/authserver.conf"
cp -n "env/dist/etc/dbimport.conf.dockerdist" "env/dist/etc/dbimport.conf"
fi
cd $CWD
echo "Done"
;;
linux*|darwin*)
local confDir=${CONFDIR:-"$AC_BINPATH_FULL/../etc"}
# create the folders before installing to
# set the current user and permissions
echo "Creating $AC_BINPATH_FULL..."
mkdir -p "$AC_BINPATH_FULL"
echo "Creating $confDir..."
mkdir -p "$confDir"
echo "Cmake install..."
sudo cmake --install . --config $CTYPE
cd $CWD
if [[ $DOCKER = 1 ]]; then
echo "Generating confs..."
cp -n "env/dist/etc/worldserver.conf.dockerdist" "env/dist/${confDir}/worldserver.conf"
cp -n "env/dist/etc/authserver.conf.dockerdist" "env/dist/${confDir}/authserver.conf"
cp -n "env/dist/etc/dbimport.conf.dockerdist" "env/dist/${confDir}/dbimport.conf"
fi
# set all aplications SUID bit
echo "Setting permissions on binary files"
find "$AC_BINPATH_FULL" -type f -exec sudo chown root:root -- {} +
find "$AC_BINPATH_FULL" -type f -exec sudo chmod u+s -- {} +
echo "Done"
;;
esac
runHooks "ON_AFTER_BUILD"
# set all aplications SUID bit
sudo chown -R root:root "$AC_BINPATH_FULL"
sudo chmod -R u+s "$AC_BINPATH_FULL"
}
function comp_build() {