[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:
2
bat/build.bat
Normal file
2
bat/build.bat
Normal 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
2
bat/build_cuda.bat
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
call .venv_cuda/Scripts/activate
|
||||||
|
pyinstaller spec/backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
call .venv/Scripts/activate
|
|
||||||
pyinstaller backend.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
call .venv_cuda/Scripts/activate
|
|
||||||
pyinstaller backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR
|
|
||||||
6
clean.py
6
clean.py
@@ -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)
|
|
||||||
16
package.json
16
package.json
@@ -4,24 +4,24 @@
|
|||||||
"version": "3.3.2",
|
"version": "3.3.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"setup-python": "install.bat",
|
"setup-python": "bat\\install.bat",
|
||||||
"build-python": "build.bat",
|
"build-python": "bat\\build.bat",
|
||||||
"build-python-cuda": "build_cuda.bat",
|
"build-python-cuda": "bat\\build_cuda.bat",
|
||||||
"vite": "vite",
|
"vite": "vite",
|
||||||
"vite-build": "vite build",
|
"vite-build": "vite build",
|
||||||
"vite-preview": "vite preview",
|
"vite-preview": "vite preview",
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"tauri-dev": "tauri dev",
|
"tauri-dev": "tauri dev",
|
||||||
"task-kill": "python task_kill.py",
|
"task-kill": "python utils\\task_kill.py",
|
||||||
"clean": "python clean.py",
|
"clean": "python utils\\clean.py",
|
||||||
"update-version": "python update_version.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": "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-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",
|
"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": "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",
|
"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": "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 zip.py --zip_name VRCT_cuda.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"
|
"release-all": "npm run update-version && npm run release && npm run release-cuda"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
|
|
||||||
a = Analysis(
|
a = Analysis(
|
||||||
['src-python\\mainloop.py'],
|
['..\\src-python\\mainloop.py'],
|
||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[
|
datas=[
|
||||||
('./src-python/models/overlay/fonts', 'fonts/'),
|
('./../src-python/models/overlay/fonts', 'fonts/'),
|
||||||
('./src-python/models/translation/prompt', 'prompt/'),
|
('./../src-python/models/translation/prompt', 'prompt/'),
|
||||||
('./src-python/models/translation/languages', 'languages/'),
|
('./../src-python/models/translation/languages', 'languages/'),
|
||||||
('.venv_cuda/Lib/site-packages/zeroconf', 'zeroconf/'),
|
('./../.venv/Lib/site-packages/zeroconf', 'zeroconf/'),
|
||||||
('.venv_cuda/Lib/site-packages/openvr', 'openvr/'),
|
('./../.venv/Lib/site-packages/openvr', 'openvr/'),
|
||||||
('.venv_cuda/Lib/site-packages/faster_whisper', 'faster_whisper/'),
|
('./../.venv/Lib/site-packages/faster_whisper', 'faster_whisper/'),
|
||||||
('.venv/Lib/site-packages/hf_xet', 'hf_xet/')
|
('./../.venv/Lib/site-packages/hf_xet', 'hf_xet/')
|
||||||
],
|
],
|
||||||
hiddenimports=[],
|
hiddenimports=[],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
@@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
|
|
||||||
a = Analysis(
|
a = Analysis(
|
||||||
['src-python\\mainloop.py'],
|
['..\\src-python\\mainloop.py'],
|
||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[
|
datas=[
|
||||||
('./src-python/models/overlay/fonts', 'fonts/'),
|
('./../src-python/models/overlay/fonts', 'fonts/'),
|
||||||
('./src-python/models/translation/prompt', 'prompt/'),
|
('./../src-python/models/translation/prompt', 'prompt/'),
|
||||||
('./src-python/models/translation/languages', 'languages/'),
|
('./../src-python/models/translation/languages', 'languages/'),
|
||||||
('.venv/Lib/site-packages/zeroconf', 'zeroconf/'),
|
('./../.venv_cuda/Lib/site-packages/zeroconf', 'zeroconf/'),
|
||||||
('.venv/Lib/site-packages/openvr', 'openvr/'),
|
('./../.venv_cuda/Lib/site-packages/openvr', 'openvr/'),
|
||||||
('.venv/Lib/site-packages/faster_whisper', 'faster_whisper/'),
|
('./../.venv_cuda/Lib/site-packages/faster_whisper', 'faster_whisper/'),
|
||||||
('.venv/Lib/site-packages/hf_xet', 'hf_xet/')
|
('./../.venv/Lib/site-packages/hf_xet', 'hf_xet/')
|
||||||
],
|
],
|
||||||
hiddenimports=[],
|
hiddenimports=[],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
@@ -736,7 +736,7 @@ class Config:
|
|||||||
|
|
||||||
def init_config(self):
|
def init_config(self):
|
||||||
# Read Only
|
# Read Only
|
||||||
self._VERSION = "0.0.0"
|
self._VERSION = "3.3.2"
|
||||||
if getattr(sys, 'frozen', False):
|
if getattr(sys, 'frozen', False):
|
||||||
self._PATH_LOCAL = os_path.dirname(sys.executable)
|
self._PATH_LOCAL = os_path.dirname(sys.executable)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "VRCT",
|
"productName": "VRCT",
|
||||||
"version": "0.0.0",
|
"version": "3.3.2",
|
||||||
"identifier": "com.vrct.app",
|
"identifier": "com.vrct.app",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "",
|
"beforeDevCommand": "",
|
||||||
|
|||||||
8
utils/clean.py
Normal file
8
utils/clean.py
Normal 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)
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
|
import os
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
def update_versions():
|
def update_versions():
|
||||||
root = Path(__file__).parent
|
root = os.path.join(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
# package.jsonからバージョンを読み取る
|
# 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)
|
package_json = json.load(f)
|
||||||
version = package_json["version"]
|
version = package_json["version"]
|
||||||
|
|
||||||
# tauri.conf.jsonを更新
|
# 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:
|
with open(tauri_conf_path, "r", encoding="utf-8") as f:
|
||||||
tauri_conf = json.load(f)
|
tauri_conf = json.load(f)
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ def update_versions():
|
|||||||
json.dump(tauri_conf, f, indent=4, ensure_ascii=False)
|
json.dump(tauri_conf, f, indent=4, ensure_ascii=False)
|
||||||
|
|
||||||
# config.pyを更新
|
# 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:
|
with open(config_path, "r", encoding="utf-8") as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
|
|
||||||
Reference in New Issue
Block a user