App architecture modifications.
Now GUI and the app itself is divided into two different binaries. The app also provides system tray icon. Whereas the GUI can be used to configure the app.
This commit is contained in:
parent
ea489d5719
commit
1323505b0a
232 changed files with 5059 additions and 8081 deletions
63
app/post_build.py
Normal file
63
app/post_build.py
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# Simple python script used to
|
||||
# copy some libraries to the "target" directory
|
||||
# after Rust build
|
||||
|
||||
# Note that Rust build should be run via "cargo make <cmd>" command
|
||||
# in order to automate all the compile process
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
|
||||
# some config vars
|
||||
SOURCE = (
|
||||
"commands/",
|
||||
"vosk/",
|
||||
"lib/",
|
||||
"keywords/",
|
||||
"libgcc_s_seh-1.dll",
|
||||
"libstdc++-6.dll",
|
||||
"libvosk.dll",
|
||||
"libvosk.lib",
|
||||
"libwinpthread-1.dll"
|
||||
)
|
||||
|
||||
TARGET_DIRS = (
|
||||
"target/debug",
|
||||
"target/release"
|
||||
)
|
||||
|
||||
ABS_PATH = os.getcwd() + "/"
|
||||
|
||||
for tdir in TARGET_DIRS:
|
||||
tdir = ABS_PATH + tdir
|
||||
|
||||
if not Path(tdir).is_dir():
|
||||
print("Skipping target, not a directory: ", tdir)
|
||||
continue
|
||||
|
||||
# copy lib files
|
||||
for src in SOURCE:
|
||||
if os.path.isdir(ABS_PATH + src):
|
||||
# copy the whole directory
|
||||
full_target_dir_path = os.path.join(tdir, src)
|
||||
|
||||
if os.path.isdir(full_target_dir_path):
|
||||
print("[-] Directory already exists, skipping: ", src)
|
||||
else:
|
||||
shutil.copytree(ABS_PATH + src, os.path.join(tdir, src))
|
||||
|
||||
print("[+] Directory copied: ", src)
|
||||
elif os.path.isfile(ABS_PATH + src):
|
||||
# copy file
|
||||
full_target_file_path = os.path.join(tdir, src)
|
||||
if os.path.isfile(full_target_file_path):
|
||||
print("[-] File already exists, skipping: ", src)
|
||||
else:
|
||||
shutil.copy(ABS_PATH + src, tdir)
|
||||
print("[+] File copied: ", src)
|
||||
else:
|
||||
print("[?] Unknown entity to copy: ", src)
|
||||
|
||||
|
||||
print("Post compile build done.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue