mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-25 00:13:27 +08:00
work on spinoff_test pcommand
This commit is contained in:
parent
de42e13de1
commit
ab59265db8
@ -4080,18 +4080,18 @@
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/2a/aa/c369bdf43bf67629eb5761fae81a",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/ab/64/9d0c2baa399fe6bf2a661f3d183e",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/65/ac/6cec563654d4808a4c6c7f8309db",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/84/70/fc82d8a8143db34b706c0a26cf50",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/48/9e/fbd0e623e78dde2d959473b7f5d3",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/eb/10/3d67fc054cb7a0f20452aa91a851",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/27/9a/23c908f8993efcfbee2e68584b9a",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e8/a8/054b58fbf37dac2e4b2130537a7f",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/c4/7c/c4a0410a869395d686a72304a4a6",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/11/ef/f95d0e2f72a5ce7f9b6de2e0e136",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/0f/b5/7e240251975be5764770f883289b",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/78/1b/ae4c1d35d46ce77e5492024a9d8e",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/1f/4b/681be43b59d29c525df9fbfcc876",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/ed/d3/c4b6cfdf979e57b652748e16ace1",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e7/4f/d9e0cab203d543fa70fc98c3f129",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/c6/e0/08feb96ad8b630049f9bb65886b3",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/77/70/0b2cbc19e8d299fd434a29fdf3b4",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/72/e1/b950d43da83ac1b38e8415f4733a",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/1d/f3/b748876c67f981a5284747c3c43a",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/60/47/5cbd8b00a2402e9cab06aa79bf76",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/77/31/5762a45185f1983c687c8e7b6d05",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/6e/56/fbd946df9d56c9798196382e9157",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/e1/d2/03df3e70b6c371e487683175b223",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d4/6a/dd303a200b98a56ba3b100277057",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/fc/2c/2996c558fb408a548fdd37398c9a",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ed/28/b7a72be7ae1bd2b58dda4b6902a0",
|
||||
@ -4108,14 +4108,14 @@
|
||||
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/71/f6/691482915ad58ea1e953cc23d74c",
|
||||
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b8/2b/6ec8c78980a62e3e0ee4b36ece04",
|
||||
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4e/56/a95c987b2a371759896b037fea86",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/28/42/227e378a08a5ce66ec371e5738f7",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/6b/e6/b74bc1e775a2a6f409b0a6c23fbb",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/00/6c/4976a2183606fbba6b7487db9784",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/e7/8f/30cffa1f32e3792a3361f3a4d3c1",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/f5/cc/989cbcfc05483de29d1f02db94b9",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/6a/07/298ad9d7a20d971537eccc787329",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/2d/f5/6aeac78c62b794ae0957c28364b8",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/9e/98/6a9a4b820be943067c240ee43cb1",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/7c/05/307d4385504fe7d1cbd4ea7fadaf",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/a4/39/d8344c6f33f339de1efb99e0fdd1",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/e8/e5/63869a517a0e4dcbda2c1c3aacf4",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/57/e1/19eaebff357311115ddfb58fa8fb",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/92/64/95b869c5e858349f3c19f2327ae5",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/da/b0/e2572de1f166416912c5988bdb33",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/6e/2d/ed6f93f761764807f82c391a918b",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/0b/1d/c507949a217c9f0f9f9858390eff",
|
||||
"src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa",
|
||||
"src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1",
|
||||
"src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/b4/3d/e352190a0e5673d101c0f3ee3ad2",
|
||||
|
||||
9
Makefile
9
Makefile
@ -1020,7 +1020,7 @@ cmake-binary: meta
|
||||
@tools/pcommand cmake_prep_dir build/cmake/$(CM_BT_LC)
|
||||
@cd build/cmake/$(CM_BT_LC) && test -f Makefile \
|
||||
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
|
||||
$(PWD)/ballisticakit-cmake
|
||||
$(shell pwd)/ballisticakit-cmake
|
||||
@tools/pcommand update_cmake_prefab_lib standard $(CM_BT_LC) build/cmake/$(CM_BT_LC)
|
||||
@cd build/cmake/$(CM_BT_LC) && $(MAKE) -j$(CPUS) ballisticakit
|
||||
|
||||
@ -1041,7 +1041,7 @@ cmake-server-binary: meta
|
||||
@tools/pcommand cmake_prep_dir build/cmake/server-$(CM_BT_LC)/dist
|
||||
@cd build/cmake/server-$(CM_BT_LC)/dist && test -f Makefile \
|
||||
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -DHEADLESS=true \
|
||||
$(PWD)/ballisticakit-cmake
|
||||
$(shell pwd)/ballisticakit-cmake
|
||||
@tools/pcommand update_cmake_prefab_lib server $(CM_BT_LC) build/cmake/server-$(CM_BT_LC)/dist
|
||||
@cd build/cmake/server-$(CM_BT_LC)/dist && $(MAKE) -j$(CPUS)
|
||||
|
||||
@ -1163,7 +1163,8 @@ _cmake-simple-ci-server-build:
|
||||
tools/pcommand update_cmake_prefab_lib \
|
||||
server debug build/cmake_simple_ci_server_build
|
||||
cd build/cmake_simple_ci_server_build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DHEADLESS=true $(PWD)/ballisticakit-cmake
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DHEADLESS=true \
|
||||
$(shell pwd)/ballisticakit-cmake
|
||||
cd build/cmake_simple_ci_server_build && $(MAKE) -j$(CPUS)
|
||||
|
||||
# Irony in emacs requires us to use cmake to generate a full
|
||||
@ -1175,7 +1176,7 @@ _cmake-simple-ci-server-build:
|
||||
@mkdir -p .cache/irony
|
||||
@cd .cache/irony \
|
||||
&& cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug \
|
||||
$(PWD)/ballisticakit-cmake
|
||||
$(shell pwd)/ballisticakit-cmake
|
||||
@mv .cache/irony/compile_commands.json . \
|
||||
&& rm -rf .cache/irony \
|
||||
&& mkdir .cache/irony \
|
||||
|
||||
@ -130,35 +130,29 @@ def _main() -> None:
|
||||
|
||||
|
||||
def _do_create(src_root: str | None, dst_root: str) -> None:
|
||||
from efrotools import extract_arg, extract_flag
|
||||
from efrotools.code import format_python_str
|
||||
|
||||
if src_root is not None:
|
||||
raise CleanError('This only works on src projects.')
|
||||
|
||||
args = sys.argv[2:]
|
||||
args2: list[str] = []
|
||||
i = 0
|
||||
|
||||
featuresets: set[str] | None = None
|
||||
|
||||
while i < len(args):
|
||||
if args[i] == '--featuresets':
|
||||
if i >= len(args) - 1:
|
||||
raise CleanError('--featuresets must be followed by an arg.')
|
||||
fsarg = args[i + 1]
|
||||
if fsarg in {'', 'none'}:
|
||||
featuresets = set()
|
||||
else:
|
||||
featuresets = set(fsarg.split(','))
|
||||
i += 2
|
||||
fsarg = extract_arg(args, '--featuresets')
|
||||
if fsarg is not None:
|
||||
if fsarg in {'', 'none'}:
|
||||
featuresets = set()
|
||||
else:
|
||||
args2.append(args[i])
|
||||
i += 1
|
||||
featuresets = set(fsarg.split(','))
|
||||
|
||||
if len(args2) != 2:
|
||||
raise CleanError(f'Expected a name and path arg; got {args2}.')
|
||||
noninteractive = extract_flag(args, '--noninteractive')
|
||||
|
||||
name, path = args2 # pylint: disable=unbalanced-tuple-unpacking
|
||||
if len(args) != 2:
|
||||
raise CleanError(f'Expected a name and path arg; got {args}.')
|
||||
|
||||
name, path = args # pylint: disable=unbalanced-tuple-unpacking
|
||||
|
||||
if not name:
|
||||
raise CleanError('Name cannot be an empty string.')
|
||||
@ -214,19 +208,19 @@ def _do_create(src_root: str | None, dst_root: str) -> None:
|
||||
|
||||
# Create an empty git repo. Some of our project functionality depends
|
||||
# on git so its best to always do this.
|
||||
subprocess.run(['git', 'init'], cwd=path, check=True)
|
||||
print('DID', dst_root)
|
||||
subprocess.run(['git', 'init'], cwd=path, check=True, capture_output=True)
|
||||
|
||||
print(
|
||||
f'{Clr.GRN}{Clr.BLD}Spinoff dst project created at'
|
||||
f' {Clr.RST}{Clr.BLD}{path}{Clr.RST}{Clr.GRN}.{Clr.RST}\n\n'
|
||||
'Next, from dst project root, do:\n'
|
||||
f' {Clr.BLD}{Clr.MAG}./tools/spinoff update{Clr.RST} '
|
||||
'- Syncs src project into dst.\n'
|
||||
f' {Clr.BLD}{Clr.MAG}make update-check{Clr.RST} '
|
||||
'- Makes sure the project is looking correct.\n\n'
|
||||
'At that point you should have a functional dst project.\n'
|
||||
)
|
||||
if not noninteractive:
|
||||
print(
|
||||
f'{Clr.GRN}{Clr.BLD}Spinoff dst project created at'
|
||||
f' {Clr.RST}{Clr.BLD}{path}{Clr.RST}{Clr.GRN}.{Clr.RST}\n\n'
|
||||
'Next, from dst project root, do:\n'
|
||||
f' {Clr.BLD}{Clr.MAG}./tools/spinoff update{Clr.RST} '
|
||||
'- Syncs src project into dst.\n'
|
||||
f' {Clr.BLD}{Clr.MAG}make update-check{Clr.RST} '
|
||||
'- Makes sure the project is looking correct.\n\n'
|
||||
'At that point you should have a functional dst project.\n'
|
||||
)
|
||||
|
||||
|
||||
def _do_featuresets(dst_root: str) -> None:
|
||||
@ -338,7 +332,9 @@ def _print_available_commands() -> None:
|
||||
" Pass 'none' or an empty string for no"
|
||||
' featuresets.\n'
|
||||
' If unspecified, all src feature-sets will be'
|
||||
' included.'
|
||||
' included.\n'
|
||||
' Pass --noninteractive to suppress help'
|
||||
' messages.\n'
|
||||
),
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
@ -83,7 +83,7 @@ def _get_dummy_module_target(projroot: str) -> str:
|
||||
' them change.\n'
|
||||
f'{dmstatepath}: \\\n'
|
||||
)
|
||||
assert targets
|
||||
# assert targets
|
||||
out += ' \\\n'.join(f' {target}' for target in targets)
|
||||
|
||||
assert ' ' not in dmstatedir
|
||||
|
||||
@ -73,6 +73,22 @@ def setconfig(projroot: Path, config: dict[str, Any]) -> None:
|
||||
outfile.write(json.dumps(config, indent=2))
|
||||
|
||||
|
||||
def extract_flag(args: list[str], name: str) -> bool:
|
||||
"""Given a list of args and a flag name, returns whether it is present.
|
||||
|
||||
The arg flag, if present, is removed from the arg list.
|
||||
"""
|
||||
from efro.error import CleanError
|
||||
|
||||
count = args.count(name)
|
||||
if count > 1:
|
||||
raise CleanError(f'Flag {name} passed multiple times.')
|
||||
if not count:
|
||||
return False
|
||||
args.remove(name)
|
||||
return True
|
||||
|
||||
|
||||
@overload
|
||||
def extract_arg(
|
||||
args: list[str], name: str, required: Literal[False] = False
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user