Compare commits
2 Commits
f2d529b052
...
ed5ee5dad1
| Author | SHA1 | Date | |
|---|---|---|---|
| ed5ee5dad1 | |||
| 176805ec41 |
@@ -101,9 +101,9 @@ def cleanup():
|
|||||||
os.makedirs(build_dir, exist_ok=True)
|
os.makedirs(build_dir, exist_ok=True)
|
||||||
|
|
||||||
def build():
|
def build():
|
||||||
global product_name
|
global product_name, icon
|
||||||
new_ver = patch_core_build()
|
new_ver = patch_core_build()
|
||||||
old_ver, product_name = patch_metadata(*new_ver)
|
old_ver, product_name, icon = patch_metadata(*new_ver)
|
||||||
logger.info("Building...")
|
logger.info("Building...")
|
||||||
# subprocess.run(['auto-py-to-exe', '--config', build_json_path], shell=True)
|
# subprocess.run(['auto-py-to-exe', '--config', build_json_path], shell=True)
|
||||||
subprocess.run(get_pyinstaller_cmd())
|
subprocess.run(get_pyinstaller_cmd())
|
||||||
|
|||||||
@@ -13,11 +13,9 @@ build_json_path = './win/build.json'
|
|||||||
|
|
||||||
# Настройки сборки
|
# Настройки сборки
|
||||||
main = 'src/main.py'
|
main = 'src/main.py'
|
||||||
icon = "./src/resources/ico/icon_dark.ico"
|
product_name = "None" # Читается из metadata
|
||||||
data = [
|
icon = "" # Читается из metadata
|
||||||
"./src/resources;resources/", # Папка с ресурсами для UI и т.д.
|
data = []
|
||||||
"./.venv/Lib/site-packages/customtkinter;customtkinter/", # Папка с библиотекой customtkinter
|
|
||||||
]
|
|
||||||
|
|
||||||
path_fix = os.path.abspath(os.path.dirname(__file__)) + "/../../"
|
path_fix = os.path.abspath(os.path.dirname(__file__)) + "/../../"
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ def patch_metadata(major, minor, patch, build_i):
|
|||||||
metadata = yaml.load(file)
|
metadata = yaml.load(file)
|
||||||
logger.info(" - metadata loaded")
|
logger.info(" - metadata loaded")
|
||||||
product_name = metadata['ProductName']
|
product_name = metadata['ProductName']
|
||||||
|
icon = metadata['Icon']
|
||||||
old_data = metadata['Version']
|
old_data = metadata['Version']
|
||||||
logger.info(f" - current version: {old_data}")
|
logger.info(f" - current version: {old_data}")
|
||||||
logger.info(f" - patched version: {major}.{minor}.{patch}.{build_i}")
|
logger.info(f" - patched version: {major}.{minor}.{patch}.{build_i}")
|
||||||
@@ -23,4 +24,4 @@ def patch_metadata(major, minor, patch, build_i):
|
|||||||
logger.info(" - creating version file")
|
logger.info(" - creating version file")
|
||||||
subprocess.run(['create-version-file', metadata_path, '--outfile', metadata_path_txt])
|
subprocess.run(['create-version-file', metadata_path, '--outfile', metadata_path_txt])
|
||||||
logger.info("Ready")
|
logger.info("Ready")
|
||||||
return old_data, product_name
|
return old_data, product_name, icon
|
||||||
@@ -1,12 +1,21 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from dist_scripts import config
|
||||||
from dist_scripts import build
|
from dist_scripts import build
|
||||||
from dist_scripts import patchers
|
from dist_scripts import patchers
|
||||||
|
|
||||||
mode = "build"
|
mode = "build"
|
||||||
|
build_args = ""
|
||||||
args = sys.argv
|
args = sys.argv
|
||||||
if len(args) > 1:
|
if len(args) > 1:
|
||||||
mode = args[1]
|
mode = args[1]
|
||||||
|
if len(args) > 2:
|
||||||
|
build_args = args[2:]
|
||||||
|
|
||||||
|
if "ctk" in build_args:
|
||||||
|
config.data.append("./.venv/Lib/site-packages/customtkinter;customtkinter/") # Папка с библиотекой customtkinter
|
||||||
|
if "res" in build_args:
|
||||||
|
config.data.append("./src/resources;resources/") # Папка с ресурсами для UI и т.д.
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if mode == "build":
|
if mode == "build":
|
||||||
|
|||||||
Reference in New Issue
Block a user