Move Build Scripts again
This commit is contained in:
28
source/meta/build-dr.py
Normal file
28
source/meta/build-dr.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import subprocess
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
# Spec file
|
||||
SPEC_FILE = os.path.join(".", "source", "DungeonRandomizer.spec")
|
||||
|
||||
# Destination is current dir
|
||||
DEST_DIRECTORY = '.'
|
||||
|
||||
# Check for UPX
|
||||
if os.path.isdir("upx"):
|
||||
upx_string = "--upx-dir=upx"
|
||||
else:
|
||||
upx_string = ""
|
||||
|
||||
if os.path.isdir("build") and not sys.platform.find("mac") and not sys.platform.find("osx"):
|
||||
shutil.rmtree("build")
|
||||
|
||||
# Run pyinstaller for DungeonRandomizer
|
||||
subprocess.run(" ".join([f"pyinstaller {SPEC_FILE} ",
|
||||
upx_string,
|
||||
"-y ",
|
||||
"--onefile ",
|
||||
f"--distpath {DEST_DIRECTORY} ",
|
||||
]),
|
||||
shell=True)
|
||||
28
source/meta/build-gui.py
Normal file
28
source/meta/build-gui.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import subprocess
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
# Spec file
|
||||
SPEC_FILE = os.path.join(".", "source", "Gui.spec")
|
||||
|
||||
# Destination is current dir
|
||||
DEST_DIRECTORY = '.'
|
||||
|
||||
# Check for UPX
|
||||
if os.path.isdir("upx"):
|
||||
upx_string = "--upx-dir=upx"
|
||||
else:
|
||||
upx_string = ""
|
||||
|
||||
if os.path.isdir("build") and not sys.platform.find("mac") and not sys.platform.find("osx"):
|
||||
shutil.rmtree("build")
|
||||
|
||||
# Run pyinstaller for Gui
|
||||
subprocess.run(" ".join([f"pyinstaller {SPEC_FILE} ",
|
||||
upx_string,
|
||||
"-y ",
|
||||
"--onefile ",
|
||||
f"--distpath {DEST_DIRECTORY} ",
|
||||
]),
|
||||
shell=True)
|
||||
Reference in New Issue
Block a user