-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild_backend.py
More file actions
51 lines (41 loc) · 1.41 KB
/
build_backend.py
File metadata and controls
51 lines (41 loc) · 1.41 KB
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
# Copyright (C) 2026 StableLlama
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
"""Defines the build backend unit so this responsibility stays isolated, testable, and easy to evolve."""
import os
import sys
import subprocess
def main():
sep = os.pathsep
# Determine if we are building onefile or onedir
mode = "--onefile"
name = "AugmentedQuill"
if len(sys.argv) > 1 and sys.argv[1] == "onedir":
mode = "--onedir"
name = "run_app"
# We need an entry point that calls main()
# In the original it was run_app.py, but we can use a wrapper or -m
# Let's create a minimal run_app.py as well or use --entry-point if pyinstaller supports it via hook
# We will create run_app.py to be the entry point for PyInstaller
cmd = [
"pyinstaller",
"--name",
name,
mode,
"--add-data",
f"static/dist{sep}static/dist",
"--add-data",
f"static/images{sep}static/images",
"--add-data",
f"resources{sep}resources",
"--collect-all",
"augmentedquill",
"run_app.py",
]
print(f"Running: {' '.join(cmd)}")
subprocess.check_call(cmd)
if __name__ == "__main__":
main()