Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .scripts/rebase_godot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ git push nikitalita $NEW_BRANCH_NAME --set-upstream

# change the branch name in .github/workflows/all_builds.yml and the README.md
sed_in_place "s/GODOT_MAIN_SYNC_REF: .*/GODOT_MAIN_SYNC_REF: $NEW_BRANCH_NAME/" "$GDRE_PATH/.github/workflows/all_builds.yml"
sed_in_place "s/GODOT_MAIN_SYNC_REF = .*/GODOT_MAIN_SYNC_REF = \"$NEW_BRANCH_NAME\"/" "$GDRE_PATH/SCsub"
sed_in_place "s/ @ branch \`.*\`/ @ branch \`$NEW_BRANCH_NAME\`/" "$GDRE_PATH/README.md"
22 changes: 22 additions & 0 deletions SCsub
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python

import subprocess
from SCons.Script.SConscript import SConsEnvironment
import os
import sys
from typing import TYPE_CHECKING

from build import gdre_icon_builder # pyright: ignore[reportImplicitRelativeImport]
Expand All @@ -21,6 +23,7 @@ if TYPE_CHECKING:
Import("env")
Import("env_modules")

GODOT_MAIN_SYNC_REF = "gdre-wb-f964fa714f5"
MODULE_DIR = get_module_dir(env)
BUILD_DIR = get_build_dir(env)

Expand All @@ -37,6 +40,25 @@ INCLUDE_DIRS = [
AXML_DEC_INCLUDE_DIR,
]

if not env["ignore_godot_branch_check"]:
ROOT_GODOT_DIR: str = str(env.Dir("#").abspath)
try:
godot_branch: str = subprocess.run(
f"git -C {ROOT_GODOT_DIR} rev-parse --abbrev-ref HEAD", shell=True, capture_output=True, text=True
).stdout.strip()
if godot_branch != GODOT_MAIN_SYNC_REF:
print(
f"""
**************************************************
Error: Godot repository is not on expected '{GODOT_MAIN_SYNC_REF}' branch, please checkout the correct branch and try again
(set Scons option 'ignore_godot_branch_check' to true to ignore this error and build anyway)
**************************************************
"""
)
sys.exit(1)
except Exception as e:
print(f"Error running git command: {e}")


env_gdsdecomp = env_modules.Clone()

Expand Down
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def get_opts(platform):
opts = [
BoolVariable("disable_godot_mono_decomp", "Disable Godot Mono Decompilation", False),
BoolVariable("disable_gifski", "Disable Gifski", False),
BoolVariable("ignore_godot_branch_check", "Ignore Godot branch check", False),
]
if not (platform == "android" or platform == "macos"):
opts.append(BoolVariable("use_static_godot_mono_decomp", "Build Godot Mono Decomp library as static", False))
Expand Down
Loading