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

5
.gitignore vendored
View file

@ -14,6 +14,11 @@ compile_commands.json
# Ignore addons files (copied from submodules), except uid created on import
/project/addons/godot-xr-tools/**
!/project/addons/godot-xr-tools/**/*.uid
/project/addons/gdcef/**
!/project/addons/gdcef/**/*.uid
# Chrome Embedded Framework binaries
/project/cef_artifacts
# Created by https://www.toptal.com/developers/gitignore/api/c++,godot,scons,python
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,godot,scons,python

View file

@ -32,6 +32,7 @@ godot --dump-extension-api # after updating Godot
python update_mavlink.py # after updating MAVLink dialect
python update_addons.py # after changing any addon submodules
scons compile_commands # after modifying SConstruct
cd project/addons/gdcef; python build.py
```
### Windows setup

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)