Setup gdcef addon

This commit is contained in:
Marek S. Łukasiewicz 2025-02-20 10:54:05 +01:00
parent e21e7aadbc
commit 6d93630e50
3 changed files with 26 additions and 2 deletions

View file

@ -1,11 +1,29 @@
from os import path
from shutil import copytree
# add repository root path
# Add repository root path
root_path = path.abspath(path.dirname(__file__))
# Copy the addon folder from each module
copytree(
path.join(root_path, 'modules', 'godot-xr-tools', 'addons'),
path.join(root_path, 'modules', 'gdcef', 'addons'),
path.join(root_path, 'project', 'addons'),
dirs_exist_ok=True,
)
# Configure gdcef version for precompiled binaries
gdcef_build = path.join(root_path, 'project', 'addons', 'gdcef', 'build.py')
gdcef_lines = []
with open(gdcef_build, 'r', encoding='utf-8') as file:
gdcef_lines = file.readlines()
for i, line in enumerate(gdcef_lines):
if not line.startswith('GITHUB_GDCEF_RELEASE'):
continue
gdcef_lines[i] = 'GITHUB_GDCEF_RELEASE = "0.16.1"\n'
break
with open(gdcef_build, 'w', encoding='utf-8') as file:
file.writelines(gdcef_lines)