b38661f588
Python application / build (push) Has been cancelled
- Add\Rework UI - Add Split Table and Listing - Add Support Customazeble schems
86 lines
2.5 KiB
Batchfile
86 lines
2.5 KiB
Batchfile
@echo off
|
|
setlocal EnableExtensions
|
|
chcp 65001 >nul
|
|
cd /d "%~dp0"
|
|
|
|
set "DO_PAUSE=1"
|
|
set "PYI_CLEAN="
|
|
for %%A in (%*) do (
|
|
if /i "%%~A"=="nopause" set "DO_PAUSE=0"
|
|
if /i "%%~A"=="clean" set "PYI_CLEAN=--clean"
|
|
)
|
|
|
|
echo === md2gost: быстрая сборка exe (onefile, шрифты + plantuml.jar) ===
|
|
echo Каталог: %CD%
|
|
echo Spec: md2gost.fast.spec
|
|
echo Кэш: build-fast\ (без --clean, пока не передадите clean)
|
|
echo.
|
|
|
|
where python >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo Python не найден в PATH. Установите Python 3.10+ и отметьте "Add python.exe to PATH".
|
|
goto :fail
|
|
)
|
|
|
|
python -c "import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)"
|
|
if errorlevel 1 (
|
|
echo Нужен Python 3.10 или новее.
|
|
python --version
|
|
goto :fail
|
|
)
|
|
|
|
echo [1/4] Зависимости ...
|
|
python -c "import PyInstaller, matplotlib, docx, marko, lxml, pygments, PIL, freetype, latex2mathml, requests, docxcompose" 1>nul 2>nul
|
|
if errorlevel 1 (
|
|
echo Ставлю проект + PyInstaller + matplotlib ...
|
|
python -m pip install -q -e . "pyinstaller>=6.0" "matplotlib>=3.7"
|
|
if errorlevel 1 (
|
|
echo Не удалось поставить зависимости.
|
|
goto :fail
|
|
)
|
|
) else (
|
|
echo Уже стоят, pip пропускаю.
|
|
)
|
|
|
|
if not exist "md2gost\Template.docx" (
|
|
echo Нет md2gost\Template.docx — сборка бессмысленна.
|
|
goto :fail
|
|
)
|
|
|
|
echo [2/4] PlantUML jar (обязателен, вшивается в exe) ...
|
|
python scripts\fetch_plantuml.py
|
|
if not exist "md2gost\vendor\plantuml.jar" (
|
|
echo Нет md2gost\vendor\plantuml.jar — portable exe без jar не собираем.
|
|
goto :fail
|
|
)
|
|
|
|
echo [3/4] PyInstaller onefile, кэш build-fast ...
|
|
python -m PyInstaller --noconfirm %PYI_CLEAN% --workpath build-fast --distpath dist md2gost.fast.spec
|
|
if errorlevel 1 (
|
|
echo PyInstaller завершился с ошибкой.
|
|
goto :fail
|
|
)
|
|
|
|
if not exist "dist\md2gost.exe" (
|
|
echo dist\md2gost.exe не появился.
|
|
goto :fail
|
|
)
|
|
|
|
echo.
|
|
echo [4/4] Готово:
|
|
echo %CD%\dist\md2gost.exe
|
|
echo.
|
|
echo Двойной клик — GUI. Из консоли: md2gost.exe report.md -o report.docx
|
|
echo Повторно без clean — быстрее за счёт кэша Analysis.
|
|
echo Полный пересбор: build-exe-fast.bat clean
|
|
echo.
|
|
|
|
if "%DO_PAUSE%"=="1" pause
|
|
exit /b 0
|
|
|
|
:fail
|
|
echo.
|
|
echo Сборка не удалась.
|
|
if "%DO_PAUSE%"=="1" pause
|
|
exit /b 1
|