Skip to content

Commit

Permalink
add new build file that compiles .py to .pyc before building to .exe
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Mar 19, 2022
1 parent 20d685a commit b264f40
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
cd elevenclock
xcopy elevenclock elevenclock_bin /E /H /C /I
cd elevenclock_bin
python -m compileall -b .
del /S *.py
rmdir /Q /S __pycache__
rmdir /Q /S external\__pycache__
rmdir /Q /S lang\__pycache__
rmdir /Q /S build
rmdir /Q /S dist
python -m PyInstaller __init__.py --icon "resources/icon.ico" --add-binary "*.py;." --add-data "resources;resources" --add-data "lang;lang" --onefile --windowed --clean --version-file ../elevenclock-version-info
python -m PyInstaller ../elevenclock/__init__.py --icon "resources/icon.ico" --add-binary "*.pyc;." --add-data "resources;resources" --add-data "lang;lang" --onefile --windowed --clean --version-file ../elevenclock-version-info
rem --add-data "%homedrive%%homepath%\AppData\Local\Programs\Python\Python39\Lib\site-packages\PySide6\plugins;PySide6/plugins"
cd dist
move __init__.exe ../../
Expand All @@ -10,6 +16,7 @@ rmdir /Q /S build
rmdir /Q /S dist
del __init__.spec
cd ..
rmdir /Q /S elevenclock_bin
taskkill /im ElevenClock.exe /f
del ElevenClock.exe
rename __init__.exe ElevenClock.exe
Expand Down
17 changes: 17 additions & 0 deletions build_legacy.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cd elevenclock
rmdir /Q /S build
rmdir /Q /S dist
python -m PyInstaller __init__.py --icon "resources/icon.ico" --add-binary "*.py;." --add-data "resources;resources" --add-data "lang;lang" --onefile --windowed --clean --version-file ../elevenclock-version-info
rem --add-data "%homedrive%%homepath%\AppData\Local\Programs\Python\Python39\Lib\site-packages\PySide6\plugins;PySide6/plugins"
cd dist
move __init__.exe ../../
cd ..
rmdir /Q /S build
rmdir /Q /S dist
del __init__.spec
cd ..
taskkill /im ElevenClock.exe /f
del ElevenClock.exe
rename __init__.exe ElevenClock.exe
ElevenClock.exe
pause

0 comments on commit b264f40

Please sign in to comment.