From cf284e475536455430fe313d2218e7933b8f3bf8 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Wed, 13 Mar 2024 21:42:23 -0700 Subject: [PATCH] work towards getting dummy-module generation working under WSL --- tools/batools/apprun.py | 15 ++++++++------- tools/batools/pcommands.py | 20 +++++++++++++++----- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/tools/batools/apprun.py b/tools/batools/apprun.py index e3e3640a..14771bfe 100755 --- a/tools/batools/apprun.py +++ b/tools/batools/apprun.py @@ -1,6 +1,6 @@ # Released under the MIT License. See LICENSE for details. # -"""Utils for wrangling runs of the app. +"""Utils for wrangling running the app as part of a build. Manages constructing or downloading it as well as running it. """ @@ -141,14 +141,15 @@ def acquire_binary(assets: bool, purpose: str) -> str: binary_build_command = ['make', 'cmake-binary'] binary_path = 'build/cmake/debug/staged/ballisticakit' else: - # Ok; going with prefab headless stuff. + # Ok; going with a downloaded prefab headless build. - # Let the user know how to use their own binaries instead. + # Let the user know how to use their own built binaries instead + # if they prefer. note = '\n' + textwrap.fill( - 'NOTE: You can set env-var BA_APP_RUN_ENABLE_BUILDS=1' - f' to use locally-built binaries for {purpose}' - ' instead of prefab ones. This will properly reflect any changes' - ' you\'ve made to the C/C++ layer.', + f'NOTE: You can set env-var BA_APP_RUN_ENABLE_BUILDS=1' + f' to use locally-built binaries for {purpose} instead' + f' of prefab ones. This will properly reflect any changes' + f' you\'ve made to the C/C++ layer.', 80, ) if assets: diff --git a/tools/batools/pcommands.py b/tools/batools/pcommands.py index eb2be2cb..c6579cc2 100644 --- a/tools/batools/pcommands.py +++ b/tools/batools/pcommands.py @@ -652,12 +652,22 @@ def prefab_binary_path() -> None: raise RuntimeError('Expected 1 arg.') buildtype, buildmode = sys.argv[2].split('-') platform = batools.build.get_current_prefab_platform() - if buildtype == 'gui': - binpath = 'ballisticakit' - elif buildtype == 'server': - binpath = 'dist/ballisticakit_headless' + + if platform.startswith('windows_'): + if buildtype == 'gui': + binpath = 'BallisticaKit.exe' + elif buildtype == 'server': + binpath = 'dist/BallisticaKitHeadless.exe' + else: + raise ValueError(f"Invalid buildtype '{buildtype}'.") else: - raise ValueError(f"Invalid buildtype '{buildtype}'.") + if buildtype == 'gui': + binpath = 'ballisticakit' + elif buildtype == 'server': + binpath = 'dist/ballisticakit_headless' + else: + raise ValueError(f"Invalid buildtype '{buildtype}'.") + print( f'build/prefab/full/{platform}_{buildtype}/{buildmode}/{binpath}', end='',