-
-
Notifications
You must be signed in to change notification settings - Fork 175
/
build.cmd
132 lines (103 loc) · 2.31 KB
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@echo off
setlocal EnableDelayedExpansion
set "py=%cd%\venv\Scripts\python.exe"
IF EXIST %py% (
echo Using VENV Python
) ELSE (
set "py=python"
echo Using system Python
)
set "option="
for %%a in (%*) do (
if not defined option (
set arg=%%a
echo %arg%
if "!arg:~0,2!" equ "--" (
set "option!arg!=1"
set "option="
) else (
if "!arg:~0,1!" equ "-" set "option=!arg!"
)
) else (
set "option!option!=%%a"
set "option="
)
)
set option
%py% -m pip install -r requirements.txt
%py% -m pip install packaging
if defined option--only-requirements (
goto :end
)
%py% scripts/check_python_version.py --min-version "3.11.0"
if %errorlevel% neq 0 (
exit /b %errorlevel%
)
@echo off
%py% scripts/apply_versions.py
rmdir /Q /S ElevenClockBin
xcopy elevenclock elevenclock_bin /E /H /C /I /Y
pushd elevenclock_bin
%py% -m compileall -b .
if %errorlevel% neq 0 goto:error
del /S *.py
rmdir /Q /S __pycache__
rmdir /Q /S build
rmdir /Q /S dist
rmdir /Q /S external\__pycache__
rmdir /Q /S lang\__pycache__
copy ..\elevenclock\__init__.py .\
%py% -m PyInstaller elevenclock.spec
if %errorlevel% neq 0 goto:error
timeout 2
move dist\ElevenClock ..\ElevenClockBin
if %errorlevel% neq 0 goto:error
popd
rmdir /Q /S elevenclock_bin
pushd ElevenClockBin\PySide6
del opengl32sw.dll
del Qt6Network.dll
del Qt6OpenGL.dll
del Qt6Pdf.dll
del Qt6Qml.dll
del Qt6QmlModels.dll
del Qt6Quick.dll
del Qt6VirtualKeyboard.dll
del QtNetwork.pyd
popd
pushd ElevenClockBin\tcl
rmdir /Q /S tzdata
popd
pushd ElevenClockBin\lang
del download_translations.pyc
popd
pushd ElevenClockBin\PySide6\plugins\imageformats
move qico.dll filetomaintain
del *.dll
move filetomaintain qico.dll
popd
if defined option--no-installer (
goto :skip-installer
)
echo You might want to sign your executable now
pause
set INSTALLATOR="%SYSTEMDRIVE%\Program Files (x86)\Inno Setup 6\ISCC.exe"
if exist %INSTALLATOR% (
%INSTALLATOR% "ElevenClock.iss"
ElevenClock.Installer.exe
) else (
echo Make installer is skipped, because installator missing.
echo Running app...
start /b ElevenClockBin/ElevenClock.exe
)
echo You might want to sign your installer now
pause
:skip-installer
if defined option--release (
%py% scripts/generate_release.py
)
goto:end
:error
echo Error!
:end
pause