From 101b9ebb762b106a677da5ceefe6f04eb6f24a90 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Thu, 3 Jun 2021 11:20:16 -0500 Subject: [PATCH] Tidying prefab stuff --- CHANGELOG.md | 3 ++- Makefile | 6 ------ tools/batools/build.py | 5 +++-- tools/batools/pcommand.py | 10 +++++----- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 248db81e..73e24174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -### 1.6.4 (20367) +### 1.6.4 (20371) - Some cleanups in the Favorites tab of the gather window. +- Reorganized prefab target names; some targets such as `prefab-debug` are now `prefab-gui-debug` (more consistent with the existing `prefab-server-debug` targets). ### 1.6.3 (20366) - Telnet access works again for gui builds without requiring a password (access must still be granted via the gui). diff --git a/Makefile b/Makefile index 501add16..bb4ff7d8 100644 --- a/Makefile +++ b/Makefile @@ -124,12 +124,6 @@ clean-list: # Prebuilt binaries for various platforms. -# Shortcut for run prefab-gui-debug. -prefab-debug: prefab-gui-debug - -# Shortcut for prefab-gui-release. -prefab-release: prefab-gui-release - # Assemble & run a gui debug build for this platform. prefab-gui-debug: prefab-gui-debug-build ${${shell tools/pcommand prefab_run_var gui-debug}} diff --git a/tools/batools/build.py b/tools/batools/build.py index 12493ed8..cc618440 100644 --- a/tools/batools/build.py +++ b/tools/batools/build.py @@ -460,14 +460,15 @@ def gen_fulltest_buildfile_linux() -> None: outfile.write('\n'.join(lines)) -def get_current_prefab_platform(wsl_gives_windows: bool = True) -> str: - """Get the name of the running platform. +def get_current_build_platform(wsl_gives_windows: bool = True) -> str: + """Get an identifier for the platform running this build. Throws a RuntimeError on unsupported platforms. """ import platform system = platform.system() machine = platform.machine() + if system == 'Darwin': if machine == 'x86_64': return 'mac_x86_64' diff --git a/tools/batools/pcommand.py b/tools/batools/pcommand.py index 8c06de9c..ade57da0 100644 --- a/tools/batools/pcommand.py +++ b/tools/batools/pcommand.py @@ -475,13 +475,13 @@ def checkenv() -> None: def ensure_build_platform() -> None: - """Ensure we are running on a particular prefab platform.""" + """Ensure we are building on a particular platform.""" import batools.build from efro.error import CleanError if len(sys.argv) != 3: raise CleanError('Expected 1 platform name arg.') needed = sys.argv[2] - current = batools.build.get_current_prefab_platform() + current = batools.build.get_current_build_platform() if current != needed: raise CleanError( f'Incorrect platform: we are {current}, this requires {needed}.') @@ -493,7 +493,7 @@ def prefab_run_var() -> None: if len(sys.argv) != 3: raise RuntimeError('Expected 1 arg.') base = sys.argv[2].replace('-', '_').upper() - platform = batools.build.get_current_prefab_platform().upper() + platform = batools.build.get_current_build_platform().upper() print(f'RUN_PREFAB_{platform}_{base}', end='') @@ -504,7 +504,7 @@ def make_prefab() -> None: if len(sys.argv) != 3: raise RuntimeError('Expected one argument') target = batools.build.PrefabTarget(sys.argv[2]) - platform = batools.build.get_current_prefab_platform() + platform = batools.build.get_current_build_platform() # We use dashes instead of underscores in target names. platform = platform.replace('_', '-') @@ -663,7 +663,7 @@ def update_cmake_prefab_lib() -> None: raise CleanError(f'Invalid buildtype: {buildtype}') if mode not in {'debug', 'release'}: raise CleanError(f'Invalid mode: {mode}') - platform = batools.build.get_current_prefab_platform( + platform = batools.build.get_current_build_platform( wsl_gives_windows=False) suffix = '_server' if buildtype == 'server' else '_gui' target = (f'build/prefab/lib/{platform}{suffix}/{mode}/'