add tool.
Some checks failed
Deploy Applications / PullDocker (push) Failing after 6m52s
Deploy Applications / Build (push) Failing after 2s
Windows CI / build (push) Has been cancelled

This commit is contained in:
2025-10-22 21:51:15 +08:00
parent 0354a73175
commit a842d429b7
6 changed files with 397 additions and 1 deletions

View File

@@ -1,6 +1,41 @@
#!/bin/bash
base_path=$(pwd)
build_path=${base_path}/build
libraries_root="/opt/Libraries"
if command -v cmake >/dev/null 2>&1; then
cmake_exe=cmake
else
cmake_exe=/opt/Qt/Tools/CMake/bin/cmake
fi
function cmake_scan() {
echo "scanning the project..."
if [ ! -d ${build_path} ]; then
mkdir -p ${build_path}
fi
cd ${build_path}
${cmake_exe} -G Ninja -S ${base_path} -B ${build_path} \
-DCMAKE_BUILD_TYPE=Debug \
-DMbedTLS_DIR=${libraries_root}/mbedtls-3.6.5/lib/cmake/MbedTLS \
-Dnng_DIR=${libraries_root}/nng-1.11/lib/cmake/nng \
-DBoost_DIR=${libraries_root}/boost_1_89_0/lib/cmake/Boost-1.89.0
}
function build() {
echo "building the project..."
if [ ! -f "${build_path}/CMakeCache.txt" ]; then
cmake_scan
fi
if [ $? -ne 0 ]; then
exit 1
fi
${cmake_exe} --build ${build_path} --target all
if [ $? -ne 0 ]; then
exit 1
fi
}
function changelog(){
current_tag=$(git describe --tags --abbrev=0)
@@ -15,9 +50,12 @@ function main() {
case $cmd in
changelog)
changelog
;;
build)
build
;;
*)
changelog
build
;;
esac
}

9
resources/wsl2_ssh.ps1 Normal file
View File

@@ -0,0 +1,9 @@
wsl -u root -e sh -c "service ssh start"
$wsl_ip = (wsl hostname -I).trim()
netsh interface portproxy delete v4tov4 listenport=1022
netsh interface portproxy add v4tov4 listenport=1022 connectport=1022 connectaddress=$wsl_ip
netsh interface portproxy delete v4tov4 listenport=2049
netsh interface portproxy add v4tov4 listenport=2049 connectport=2049 connectaddress=$wsl_ip