Compare commits

...

2 Commits

Author SHA1 Message Date
ed5ee5dad1 [>] icon to metadata 2025-03-24 02:19:32 +03:00
176805ec41 [+] build_args 2025-03-24 02:18:27 +03:00
4 changed files with 16 additions and 8 deletions

View File

@@ -101,9 +101,9 @@ def cleanup():
os.makedirs(build_dir, exist_ok=True)
def build():
global product_name
global product_name, icon
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...")
# subprocess.run(['auto-py-to-exe', '--config', build_json_path], shell=True)
subprocess.run(get_pyinstaller_cmd())

View File

@@ -13,11 +13,9 @@ build_json_path = './win/build.json'
# Настройки сборки
main = 'src/main.py'
icon = "./src/resources/ico/icon_dark.ico"
data = [
"./src/resources;resources/", # Папка с ресурсами для UI и т.д.
"./.venv/Lib/site-packages/customtkinter;customtkinter/", # Папка с библиотекой customtkinter
]
product_name = "None" # Читается из metadata
icon = "" # Читается из metadata
data = []
path_fix = os.path.abspath(os.path.dirname(__file__)) + "/../../"

View File

@@ -13,6 +13,7 @@ def patch_metadata(major, minor, patch, build_i):
metadata = yaml.load(file)
logger.info(" - metadata loaded")
product_name = metadata['ProductName']
icon = metadata['Icon']
old_data = metadata['Version']
logger.info(f" - current version: {old_data}")
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")
subprocess.run(['create-version-file', metadata_path, '--outfile', metadata_path_txt])
logger.info("Ready")
return old_data, product_name
return old_data, product_name, icon

View File

@@ -1,12 +1,21 @@
import sys
from dist_scripts import config
from dist_scripts import build
from dist_scripts import patchers
mode = "build"
build_args = ""
args = sys.argv
if len(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 mode == "build":