Tidying prefab stuff

This commit is contained in:
Eric Froemling 2021-06-03 11:20:16 -05:00
parent 33857179da
commit 101b9ebb76
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
4 changed files with 10 additions and 14 deletions

View File

@ -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).

View File

@ -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}}

View File

@ -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'

View File

@ -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}/'