代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/NHibernate 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/sh
cd "$(dirname "$0")"
SCRIPT_PATH="$(pwd)"
BUILD_TOOL_PATH="./Tools/BuildTool/bin/BuildTool.dll"
BUILD_TOOL="dotnet $BUILD_TOOL_PATH"
AVAILABLE_CONFIGURATIONS="available-test-configurations"
CONFIG_NAME=""
TEST_PLATFORM=""
LIB_FILES=""
LIB_FILES2=""
CURRENT_CONFIGURATION="./current-test-configuration"
OPTION=0
async_generator_path=""
async_generator_version=""
if [ ! -f $BUILD_TOOL_PATH ]
then
cd ./Tools/BuildTool
dotnet build BuildTool.sln -c Release -o bin
fi
cd "$SCRIPT_PATH"
buildDebug(){
dotnet build ./src/NHibernate.sln
echo "."
echo "Assuming the build succeeded, your results will be in the build folder."
echo "."
mainMenu
}
buildRelease(){
dotnet build ./src/NHibernate.sln -c Release
echo "."
echo "Assuming the build succeeded, your results will be in the build folder."
echo "."
mainMenu
}
testActivate(){
FILE_TEMP="folder.tmp"
$BUILD_TOOL pick-folder $AVAILABLE_CONFIGURATIONS $FILE_TEMP "Which test configuration should be activated?"
if [ -d $CURRENT_CONFIGURATION ]
then
rm -r $CURRENT_CONFIGURATION/
fi
CURRENT_FOLDER=$(pwd)
INFORMATION=$(cat $CURRENT_FOLDER/$FILE_TEMP)
cp -r $INFORMATION/ $CURRENT_CONFIGURATION
rm $FILE_TEMP
echo "Configuration activated."
mainMenu
}
testSetupGeneric() {
echo "Enter a name for your test configuration or press enter to use default name:"
read CFGNAME
if [ $CFGNAME = ""]
then
CFGNAME="$CONFIG_NAME-$TEST_PLATFORM"
echo $CFGNAME
fi
mkdir -p $AVAILABLE_CONFIGURATIONS/$CFGNAME
if [ ! "$LIB_FILES" ]
then
cp $LIB_FILES $AVAILABLE_CONFIGURATIONS/$CFGNAME
if [ ! "$LIB_FILES2" ]
then
cp $LIB_FILES2 $AVAILABLE_CONFIGURATIONS/$CFGNAME
fi
fi
cp "src/NHibernate.Config.Templates/$CONFIG_NAME.cfg.xml" "$AVAILABLE_CONFIGURATIONS/$CFGNAME/hibernate.cfg.xml"
echo "Done setting up files. Please edit the connection string in file:"
echo "$AVAILABLE_CONFIGURATIONS/$CFGNAME/hibernate.cfg.xml"
echo "When you're done, don't forget to activate the configuration through the menu."
mainMenu
}
testSetupSqlServer() {
CONFIG_NAME="MSSQL"
TEST_PLATFORM="AnyCPU"
LIB_FILES=""
LIB_FILES2=""
testSetupGeneric
}
testSetupFirebird() {
CONFIG_NAME="FireBird"
TEST_PLATFORM="AnyCPU"
LIB_FILES=""
LIB_FILES2=""
testSetupGeneric
}
testSetupSqlite() {
CONFIG_NAME="SQLite"
TEST_PLATFORM="AnyCPU"
LIB_FILES=""
LIB_FILES2=""e
testSetupGeneric
}
testSetupPostgresql() {
CONFIG_NAME="PostgreSQL"
TEST_PLATFORM="AnyCPU"
LIB_FILES=""
LIB_FILES2=""
testSetupGeneric
}
testSetupMysql() {
CONFIG_NAME="MySql"
TEST_PLATFORM="AnyCPU"
LIB_FILES=""
LIB_FILES2=""
testSetupGeneric
}
testSetupMenu() {
echo "A. Add a test configuration for SQL Server."
echo "B. Add a test configuration for Firebird."
echo "C. Add a test configuration for SQLite."
echo "D. Add a test configuration for PostgreSQL."
echo "E. Add a test configuration for MySql."
echo "."
echo "X. Exit to main menu."
echo "."
$BUILD_TOOL prompt ABCDEX
OPTION=$?
if [ $OPTION -eq 5 ]
then
echo "Main menu"
mainMenu
elif [ $OPTION -eq 4 ]
then
echo "MySQL"
testSetupMysql
mainMenu
elif [ $OPTION -eq 3 ]
then
echo "PostgreSQL"
testSetupPostgresql
mainMenu
elif [ $OPTION -eq 2 ]
then
echo "Sqlite"
testSetupSqlite
mainMenu
elif [ $OPTION -eq 1 ]
then
echo "Firebird"
testSetupFirebird
mainMenu
elif [ $OPTION -eq 0 ]
then
echo "SQL Server"
testSetupSqlServer
mainMenu
fi
}
testRun(){
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f net6.0
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net6.0
mainMenu
}
generateAsync(){
cd src
dotnet tool restore
dotnet restore ./NHibernate.sln
dotnet async-generator
cd ..
mainMenu
}
mainMenu() {
echo "========================= NHIBERNATE BUILD MENU =========================="
echo "--- TESTING ---"
echo "A. (Step 1) Set up a new test configuration for a particular database."
echo "B. (Step 2) Activate a test configuration."
echo "C. (Step 3) Run tests."
echo "."
echo "--- BUILD ---"
echo "E. Build NHibernate (Debug)"
echo "F. Build NHibernate (Release)"
echo "."
echo "--- Code generation ---"
echo "H. Generate async code (Generates files in Async sub-folders)"
echo "."
echo "--- Exit ---"
echo "X. Make the beautiful build menu go away."
echo "."
$BUILD_TOOL prompt ABCEFHX
OPTION=$?
if [ $OPTION -eq 5 ]
then
generateAsync
elif [ $OPTION -eq 4 ]
then
buildRelease
elif [ $OPTION -eq 3 ]
then
buildDebug
elif [ $OPTION -eq 2 ]
then
testRun
elif [ $OPTION -eq 1 ]
then
testActivate
elif [ $OPTION -eq 0 ]
then
testSetupMenu
fi
}
mainMenu
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。