56 lines
1.5 KiB
Batchfile
56 lines
1.5 KiB
Batchfile
@REM 生成版本信息
|
|
@echo off
|
|
python ../Tests/version.py
|
|
|
|
set "version="
|
|
set "debug_enable="
|
|
set "hart_soft_test_enable="
|
|
set "hart_hard_test_enable="
|
|
|
|
|
|
for /f "tokens=1,2 delims==" %%i in (../Tests/version.txt) do (
|
|
if "%%i"=="VERSION" set "version=%%j"
|
|
if "%%i"=="DEBUG_ENABLE" set "debug_enable=%%j"
|
|
if "%%i"=="HART_SOFT_TEST_ENABLE" set "hart_soft_test_enable=%%j"
|
|
if "%%i"=="HART_HARD_TEST_ENABLE" set "hart_hard_test_enable=%%j"
|
|
)
|
|
|
|
set project_name=controller
|
|
set out_filename=controller
|
|
set path=controller
|
|
|
|
set "output_file_name=%out_filename%_%version%"
|
|
if "%HART_HARD_TEST_ENABLE%" == "TRUE" (
|
|
set "output_file_name=%output_file_name%_HART硬件测试"
|
|
) else if "%HART_SOFT_TEST_ENABLE%" == "TRUE" (
|
|
set "output_file_name=%output_file_name%_HART软件测试"
|
|
) else (
|
|
if /i "%debug_enable%"=="TRUE" (
|
|
set "output_file_name=%output_file_name%_debug"
|
|
) else (
|
|
set "output_file_name=%output_file_name%"
|
|
)
|
|
)
|
|
|
|
|
|
|
|
@REM 判断文件是否存在
|
|
set file_path=%path%\%project_name%.hex
|
|
set "target=..\Public\出厂文件\output\%version%\%output_file_name%.hex"
|
|
echo %file_path%
|
|
echo %target%
|
|
if exist %file_path% (
|
|
@REM 创建目标文件夹路径
|
|
mkdir ..\Public\出厂文件\output\%version% 2>nul
|
|
move %file_path% %target%
|
|
)
|
|
|
|
set file_path=%project_name%.bin
|
|
set "target=..\Public\出厂文件\output\%version%\%output_file_name%.bin"
|
|
echo %file_path%
|
|
if exist %file_path% (
|
|
@REM 创建目标文件夹路径
|
|
mkdir ..\Public\出厂文件\output\%version% 2>nul
|
|
move %file_path% %target%
|
|
)
|