Added S++ bootstrap script that downloads SCons++ to a local folder.

This commit is contained in:
2025-07-13 13:10:39 +02:00
parent 4f7f516015
commit 9abb3ba39f
3 changed files with 82 additions and 35 deletions

View File

@@ -28,36 +28,6 @@ def verify_tools() -> None:
if not success:
raise RuntimeError('one or more required tools could not be found')
def download_spp() -> None:
_logger.debug('Checking if Scons++ is checked out...')
output = exec_get_output(['git', 'submodule', 'status', 'external/scons-plus-plus'])
if output[0] in ('+', ' '):
return
assert output[0] == '-'
_logger.info('SCons++ not checkout out yet, doing it now.')
exec_checked(['git', 'submodule', 'init'])
exec_checked(['git', 'submodule', 'update', 'external/scons-plus-plus'])
def update_spp() -> None:
_logger.debug('Updating SCons++ submodule...')
os.chdir(_root / 'external/scons-plus-plus')
try:
exec_checked(['git', 'fetch', 'origin', 'master'])
exec_checked(['git', 'checkout', 'master'])
exec_checked(['git', 'pull'])
finally:
os.chdir(_root)
output = exec_get_output(['git', 'status', '--porcelain'])
if output.strip() == '':
return
_logger.info('Changes in SCons++ detected, creating commit.')
exec_checked(['git', 'commit', '-m', 'Updated Scons++', 'external/scons-plus-plus'])
def verify_unchanged() -> None:
output = exec_get_output(['git', 'status', '--porcelain'])
if output != '':
raise RuntimeError('There are uncommitted changes. Commit, stash or revert them before running this script.')
def setup_project() -> None:
project_name = ''
while project_name == '':
@@ -111,9 +81,6 @@ def script_main():
global _root
_root = get_root()
verify_tools()
download_spp()
update_spp()
verify_unchanged()
setup_project()
setup_git_remote()