Skip to content

Commit

Permalink
整理: engine_manifest_assets/ をリソースディレクトリへ移動 (#1247)
Browse files Browse the repository at this point in the history
refactor: `engine_manifest_assets/` をリソースディレクトリへ移動
  • Loading branch information
tarepan authored May 20, 2024
1 parent 9b2944e commit 0cfb336
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-engine-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ jobs:
# Build
- name: <Build> Generate licenses.json
run: |
OUTPUT_LICENSE_JSON_PATH=engine_manifest_assets/dependency_licenses.json \
OUTPUT_LICENSE_JSON_PATH=resources/engine_manifest_assets/dependency_licenses.json \
bash build_util/create_venv_and_generate_licenses.bash
# FIXME: VOICEVOX (editor) cannot build without licenses.json
cp engine_manifest_assets/dependency_licenses.json licenses.json
cp resources/engine_manifest_assets/dependency_licenses.json licenses.json
- name: <Build> Build VOICEVOX ENGINE run.py
run: |
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ ADD ./resources /opt/voicevox_engine/resources
ADD ./build_util/generate_licenses.py /opt/voicevox_engine/build_util/
ADD ./speaker_info /opt/voicevox_engine/speaker_info
ADD ./ui_template /opt/voicevox_engine/ui_template
ADD ./engine_manifest_assets /opt/voicevox_engine/engine_manifest_assets

# Replace version
ARG VOICEVOX_ENGINE_VERSION=latest
Expand All @@ -251,8 +250,8 @@ RUN <<EOF
export PATH="/home/user/.local/bin:${PATH:-}"

gosu user /opt/python/bin/pip3 install -r /tmp/requirements-license.txt
gosu user /opt/python/bin/python3 build_util/generate_licenses.py > /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json
cp /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json /opt/voicevox_engine/licenses.json
gosu user /opt/python/bin/python3 build_util/generate_licenses.py > /opt/voicevox_engine/resources/engine_manifest_assets/dependency_licenses.json
cp /opt/voicevox_engine/resources/engine_manifest_assets/dependency_licenses.json /opt/voicevox_engine/licenses.json
EOF

# Keep this layer separated to use layer cache on download failed in local build
Expand Down
6 changes: 3 additions & 3 deletions build_util/process_voicevox_resource.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ mv engine_manifest.json.tmp engine_manifest.json

# エンジンとリソースの更新情報を統合する
python build_util/merge_update_infos.py \
engine_manifest_assets/update_infos.json \
resources/engine_manifest_assets/update_infos.json \
"${DOWNLOAD_RESOURCE_PATH}/engine/engine_manifest_assets/update_infos.json" \
engine_manifest_assets/update_infos.json
resources/engine_manifest_assets/update_infos.json

# リソースのマニフェストアセットをエンジンのディレクトリへ複製する
for f in "${DOWNLOAD_RESOURCE_PATH}"/engine/engine_manifest_assets/*; do
if [ "$(basename "${f}")" != "update_infos.json" ]; then
cp "${f}" ./engine_manifest_assets/
cp "${f}" ./resources/engine_manifest_assets/
fi
done
8 changes: 4 additions & 4 deletions engine_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"url": "https://github.com/VOICEVOX/voicevox_engine",
"command": "run",
"port": 50021,
"icon": "engine_manifest_assets/icon.png",
"icon": "resources/engine_manifest_assets/icon.png",
"default_sampling_rate": 24000,
"frame_rate": 93.75,
"terms_of_service": "engine_manifest_assets/terms_of_service.md",
"update_infos": "engine_manifest_assets/update_infos.json",
"dependency_licenses": "engine_manifest_assets/dependency_licenses.json",
"terms_of_service": "resources/engine_manifest_assets/terms_of_service.md",
"update_infos": "resources/engine_manifest_assets/update_infos.json",
"dependency_licenses": "resources/engine_manifest_assets/dependency_licenses.json",
"supported_features": {
"adjust_mora_pitch": {
"type": "bool",
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion run.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import os

datas = [
('resources', 'resources'),
('engine_manifest_assets', 'engine_manifest_assets'),
('speaker_info', 'speaker_info'),
('engine_manifest.json', '.'),
('licenses.json', '.'),
Expand Down
4 changes: 2 additions & 2 deletions voicevox_engine/library_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ def downloadable_libraries(self) -> list[DownloadableLibraryInfo]:

# == ダウンロード情報をjsonファイルから取得する場合
# with open(
# self.root_dir / "engine_manifest_assets" / "downloadable_libraries.json",
# self.root_dir / "resources" / "engine_manifest_assets" / "downloadable_libraries.json", # noqa: B950
# encoding="utf-8",
# ) as f:
# return list(map(DownloadableLibrary.parse_obj, json.load(f)))

# ダミーとして、speaker_infoのアセットを読み込む
with open(
"./engine_manifest_assets/downloadable_libraries.json",
"./resources/engine_manifest_assets/downloadable_libraries.json",
encoding="utf-8",
) as f:
libraries = json.load(f)
Expand Down

0 comments on commit 0cfb336

Please sign in to comment.