[Update] Build scripts and configuration: Added new build and install scripts, updated versioning in config files, and improved project structure.

This commit is contained in:
misyaguziya
2025-11-25 12:20:55 +09:00
parent 54ec5ba45d
commit ff6ac43fee
15 changed files with 43 additions and 41 deletions

2
bat/build.bat Normal file
View File

@@ -0,0 +1,2 @@
call .venv/Scripts/activate
pyinstaller spec/backend.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR

2
bat/build_cuda.bat Normal file
View File

@@ -0,0 +1,2 @@
call .venv_cuda/Scripts/activate
pyinstaller spec/backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR

View File

@@ -1,2 +0,0 @@
call .venv/Scripts/activate
pyinstaller backend.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR

View File

@@ -1,2 +0,0 @@
call .venv_cuda/Scripts/activate
pyinstaller backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR

View File

@@ -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)

View File

@@ -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": {

View File

@@ -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=[],

View File

@@ -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=[],

View File

@@ -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:

View File

@@ -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": "",

8
utils/clean.py Normal file
View File

@@ -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)

View File

@@ -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()