diff --git a/bat/build.bat b/bat/build.bat new file mode 100644 index 00000000..7760b7ee --- /dev/null +++ b/bat/build.bat @@ -0,0 +1,2 @@ +call .venv/Scripts/activate +pyinstaller spec/backend.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR \ No newline at end of file diff --git a/bat/build_cuda.bat b/bat/build_cuda.bat new file mode 100644 index 00000000..0c86f70d --- /dev/null +++ b/bat/build_cuda.bat @@ -0,0 +1,2 @@ +call .venv_cuda/Scripts/activate +pyinstaller spec/backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR \ No newline at end of file diff --git a/install.bat b/bat/install.bat similarity index 100% rename from install.bat rename to bat/install.bat diff --git a/build.bat b/build.bat deleted file mode 100644 index 3c08629c..00000000 --- a/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -call .venv/Scripts/activate -pyinstaller backend.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR \ No newline at end of file diff --git a/build_cuda.bat b/build_cuda.bat deleted file mode 100644 index 308b9174..00000000 --- a/build_cuda.bat +++ /dev/null @@ -1,2 +0,0 @@ -call .venv_cuda/Scripts/activate -pyinstaller backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR \ No newline at end of file diff --git a/clean.py b/clean.py deleted file mode 100644 index 93084e62..00000000 --- a/clean.py +++ /dev/null @@ -1,6 +0,0 @@ -import shutil - -shutil.rmtree('build', ignore_errors=True) -shutil.rmtree('dist', ignore_errors=True) -shutil.rmtree('src-tauri\\bin', ignore_errors=True) -shutil.rmtree('src-tauri\\target', ignore_errors=True) \ No newline at end of file diff --git a/package.json b/package.json index 1c66c4f5..69bb278d 100644 --- a/package.json +++ b/package.json @@ -4,24 +4,24 @@ "version": "3.3.2", "type": "module", "scripts": { - "setup-python": "install.bat", - "build-python": "build.bat", - "build-python-cuda": "build_cuda.bat", + "setup-python": "bat\\install.bat", + "build-python": "bat\\build.bat", + "build-python-cuda": "bat\\build_cuda.bat", "vite": "vite", "vite-build": "vite build", "vite-preview": "vite preview", "tauri": "tauri", "tauri-dev": "tauri dev", - "task-kill": "python task_kill.py", - "clean": "python clean.py", - "update-version": "python update_version.py", + "task-kill": "python utils\\task_kill.py", + "clean": "python utils\\clean.py", + "update-version": "python utils\\update_version.py", "dev": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run dev-ui", "dev-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run dev-ui", "dev-ui": "npm run task-kill && npm-run-all --parallel vite tauri-dev", "build": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run vite-build && npm run tauri build", "build-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run vite-build && npm run tauri build", - "release": "npm run update-version && npm run build && python zip.py --zip_name VRCT.zip", - "release-cuda": "npm run update-version && npm run build-cuda && python zip.py --zip_name VRCT_cuda.zip", + "release": "npm run update-version && npm run build && python utils\\zip.py --zip_name VRCT.zip", + "release-cuda": "npm run update-version && npm run build-cuda && python utils\\zip.py --zip_name VRCT_cuda.zip", "release-all": "npm run update-version && npm run release && npm run release-cuda" }, "dependencies": { diff --git a/backend_cuda.spec b/spec/backend.spec similarity index 62% rename from backend_cuda.spec rename to spec/backend.spec index 8d80b6ec..57d72f6f 100644 --- a/backend_cuda.spec +++ b/spec/backend.spec @@ -2,17 +2,17 @@ a = Analysis( - ['src-python\\mainloop.py'], + ['..\\src-python\\mainloop.py'], pathex=[], binaries=[], datas=[ - ('./src-python/models/overlay/fonts', 'fonts/'), - ('./src-python/models/translation/prompt', 'prompt/'), - ('./src-python/models/translation/languages', 'languages/'), - ('.venv_cuda/Lib/site-packages/zeroconf', 'zeroconf/'), - ('.venv_cuda/Lib/site-packages/openvr', 'openvr/'), - ('.venv_cuda/Lib/site-packages/faster_whisper', 'faster_whisper/'), - ('.venv/Lib/site-packages/hf_xet', 'hf_xet/') + ('./../src-python/models/overlay/fonts', 'fonts/'), + ('./../src-python/models/translation/prompt', 'prompt/'), + ('./../src-python/models/translation/languages', 'languages/'), + ('./../.venv/Lib/site-packages/zeroconf', 'zeroconf/'), + ('./../.venv/Lib/site-packages/openvr', 'openvr/'), + ('./../.venv/Lib/site-packages/faster_whisper', 'faster_whisper/'), + ('./../.venv/Lib/site-packages/hf_xet', 'hf_xet/') ], hiddenimports=[], hookspath=[], diff --git a/backend.spec b/spec/backend_cuda.spec similarity index 61% rename from backend.spec rename to spec/backend_cuda.spec index 605c82fb..3d665926 100644 --- a/backend.spec +++ b/spec/backend_cuda.spec @@ -2,17 +2,17 @@ a = Analysis( - ['src-python\\mainloop.py'], + ['..\\src-python\\mainloop.py'], pathex=[], binaries=[], datas=[ - ('./src-python/models/overlay/fonts', 'fonts/'), - ('./src-python/models/translation/prompt', 'prompt/'), - ('./src-python/models/translation/languages', 'languages/'), - ('.venv/Lib/site-packages/zeroconf', 'zeroconf/'), - ('.venv/Lib/site-packages/openvr', 'openvr/'), - ('.venv/Lib/site-packages/faster_whisper', 'faster_whisper/'), - ('.venv/Lib/site-packages/hf_xet', 'hf_xet/') + ('./../src-python/models/overlay/fonts', 'fonts/'), + ('./../src-python/models/translation/prompt', 'prompt/'), + ('./../src-python/models/translation/languages', 'languages/'), + ('./../.venv_cuda/Lib/site-packages/zeroconf', 'zeroconf/'), + ('./../.venv_cuda/Lib/site-packages/openvr', 'openvr/'), + ('./../.venv_cuda/Lib/site-packages/faster_whisper', 'faster_whisper/'), + ('./../.venv/Lib/site-packages/hf_xet', 'hf_xet/') ], hiddenimports=[], hookspath=[], diff --git a/src-python/config.py b/src-python/config.py index cc53ab16..1b47d961 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -736,7 +736,7 @@ class Config: def init_config(self): # Read Only - self._VERSION = "0.0.0" + self._VERSION = "3.3.2" if getattr(sys, 'frozen', False): self._PATH_LOCAL = os_path.dirname(sys.executable) else: diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0bbba778..d7695cf9 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "VRCT", - "version": "0.0.0", + "version": "3.3.2", "identifier": "com.vrct.app", "build": { "beforeDevCommand": "", diff --git a/utils/clean.py b/utils/clean.py new file mode 100644 index 00000000..c97ffd0c --- /dev/null +++ b/utils/clean.py @@ -0,0 +1,8 @@ +import os +import shutil + +root = os.path.dirname(os.path.dirname(__file__)) +shutil.rmtree(os.path.join(root, 'build'), ignore_errors=True) +shutil.rmtree(os.path.join(root, 'dist'), ignore_errors=True) +shutil.rmtree(os.path.join(root, 'src-tauri', 'bin'), ignore_errors=True) +shutil.rmtree(os.path.join(root, 'src-tauri', 'target'), ignore_errors=True) \ No newline at end of file diff --git a/task_kill.py b/utils/task_kill.py similarity index 100% rename from task_kill.py rename to utils/task_kill.py diff --git a/update_version.py b/utils/update_version.py similarity index 76% rename from update_version.py rename to utils/update_version.py index 38b11a1a..fac75c76 100644 --- a/update_version.py +++ b/utils/update_version.py @@ -1,16 +1,16 @@ +import os import json -from pathlib import Path def update_versions(): - root = Path(__file__).parent + root = os.path.join(os.path.dirname(os.path.dirname(__file__))) # package.jsonからバージョンを読み取る - with open(root / "package.json", "r", encoding="utf-8") as f: + with open(os.path.join(root, "package.json"), "r", encoding="utf-8") as f: package_json = json.load(f) version = package_json["version"] # tauri.conf.jsonを更新 - tauri_conf_path = root / "src-tauri" / "tauri.conf.json" + tauri_conf_path = os.path.join(root, "src-tauri", "tauri.conf.json") with open(tauri_conf_path, "r", encoding="utf-8") as f: tauri_conf = json.load(f) @@ -20,7 +20,7 @@ def update_versions(): json.dump(tauri_conf, f, indent=4, ensure_ascii=False) # config.pyを更新 - config_path = root / "src-python" / "config.py" + config_path = os.path.join(root, "src-python", "config.py") with open(config_path, "r", encoding="utf-8") as f: content = f.read() diff --git a/zip.py b/utils/zip.py similarity index 100% rename from zip.py rename to utils/zip.py