tools/snippets is now tools/pcommand

This commit is contained in:
Eric Froemling 2020-07-03 16:31:39 -07:00
parent 7c508dcfe6
commit ec2eceb0d5
16 changed files with 2641 additions and 2637 deletions

View File

@ -4135,16 +4135,16 @@
"assets/build/windows/x64/vc_redist.x64.exe": "https://files.ballistica.net/cache/ba1/ea/19/8b8787d81abcdce158ba608cd24f",
"assets/build/windows/x64/vcruntime140_1d.dll": "https://files.ballistica.net/cache/ba1/11/d8/ff6344b429b00c24d9a1930d4338",
"assets/build/windows/x64/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/20/33/0825e11e6518f87ece3009309933",
"build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/85/af/d70d326fe40d4ec40672c5d062ea",
"build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/2b/3c/d5c499426cf31f0bc75e56ba3294",
"build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/d3/f5/d97f3590bac4f4aa811d1de04222",
"build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/c4/35/f83dc6901dfb3d398fda301eb6b5",
"build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e7/39/a79bf14a5a823e81dcfaaa846df5",
"build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/1a/39/cf3412e69777805f53f3d65a0cf1",
"build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/e7/b7/02b5a461b12f6f0ecae09e6efb45",
"build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/d5/00/77b425a357d8ea186e71611e20fa",
"build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/36/75/f1214d30fc1e28d342fc35071098",
"build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/fc/d1/37903806d79ea619531731232aef",
"build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/97/79/5a38fba6af60053de588c02b79c3",
"build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/89/ab/4301d0fda22038089dab5c804bad"
"build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f2/e4/3f66ba2b14096ab164364705b8a3",
"build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/99/be/1f982df77f11cafb2d1e881b80ab",
"build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/3b/9f/f12a5696a599bffb5c7711235328",
"build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/c3/ee/8e71bc4ad318d4099a03c096d541",
"build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/6c/95/62eac97133aab925282cb97ab7e6",
"build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3d/05/0d7b02cea3b7d26bea4b036f825a",
"build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/fe/87/faa3ba3c5d6613727aeb4072f78b",
"build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/54/70/6bdb7d6ce26d636b66265bacf195",
"build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/3b/77/805cd6d6898e33e9fc8679664e87",
"build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/65/33/8a7dcbe289fcb682e0997bf8f024",
"build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/86/3c/eae5a2cae586dc732a909eebfea0",
"build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/ff/46/63b0a2c3969a0785aa109867b0f9"
}

View File

@ -1402,6 +1402,7 @@
<w>pbxproj</w>
<w>pcall</w>
<w>pchild</w>
<w>pcommand</w>
<w>pcstr</w>
<w>pedit</w>
<w>peditui</w>

View File

@ -1,3 +1,6 @@
### 1.5.18 (20106)
- A bit of project cleanup; tools/snippets is now tools/pcommand, etc.
### 1.5.17 (20102)
- More cleanup to logging and crash reporting system.
- Various other minor bug fixes..

190
Makefile
View File

@ -37,7 +37,7 @@ DOCPREFIX = "ballisticacore_"
# List targets in this Makefile and basic descriptions for them.
help:
@tools/snippets makefile_target_list Makefile
@tools/pcommand makefile_target_list Makefile
PREREQS = .cache/checkenv .dir-locals.el \
.mypy.ini .pycheckers .pylintrc .style.yapf .clang-format \
@ -115,42 +115,42 @@ clean-list:
# Assemble & run a debug build for this platform.
prefab-debug: prefab-debug-build
${${shell tools/snippets prefab_run_var debug}}
${${shell tools/pcommand prefab_run_var debug}}
# Assemble & run a release build for this platform.
prefab-release: prefab-release-build
${${shell tools/snippets prefab_run_var release}}
${${shell tools/pcommand prefab_run_var release}}
# Assemble a debug build for this platform.
prefab-debug-build:
@tools/snippets make_prefab debug
@tools/pcommand make_prefab debug
# Assemble a release build for this platform.
prefab-release-build:
@tools/snippets make_prefab release
@tools/pcommand make_prefab release
# Assemble & run a server debug build for this platform.
prefab-server-debug: prefab-server-debug-build
${${shell tools/snippets prefab_run_var server-debug}}
${${shell tools/pcommand prefab_run_var server-debug}}
# Assemble & run a server release build for this platform.
prefab-server-release: prefab-server-release-build
${${shell tools/snippets prefab_run_var server-release}}
${${shell tools/pcommand prefab_run_var server-release}}
# Assemble a server debug build for this platform.
prefab-server-debug-build:
@tools/snippets make_prefab server-debug
@tools/pcommand make_prefab server-debug
# Assemble a server release build for this platform.
prefab-server-release-build:
@tools/snippets make_prefab server-release
@tools/pcommand make_prefab server-release
# Specific platform prefab targets:
RUN_PREFAB_MAC_DEBUG = cd build/prefab/mac/debug && ./ballisticacore
prefab-mac-debug: prefab-mac-debug-build
@tools/snippets ensure_prefab_platform mac
@tools/pcommand ensure_prefab_platform mac
@${RUN_PREFAB_MAC_DEBUG}
prefab-mac-debug-build: prereqs assets-cmake \
@ -158,12 +158,12 @@ prefab-mac-debug-build: prereqs assets-cmake \
@${STAGE_ASSETS} -cmake build/prefab/mac/debug
build/prefab/mac/debug/ballisticacore: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_MAC_RELEASE = cd build/prefab/mac/release && ./ballisticacore
prefab-mac-release: prefab-mac-release-build
@tools/snippets ensure_prefab_platform mac
@tools/pcommand ensure_prefab_platform mac
@${RUN_PREFAB_MAC_RELEASE}
prefab-mac-release-build: prereqs assets-cmake \
@ -171,13 +171,13 @@ prefab-mac-release-build: prereqs assets-cmake \
@${STAGE_ASSETS} -cmake build/prefab/mac/release
build/prefab/mac/release/ballisticacore: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_MAC_SERVER_DEBUG = cd build/prefab/mac-server/debug \
&& ./ballisticacore_server
prefab-mac-server-debug: prefab-mac-server-debug-build
@tools/snippets ensure_prefab_platform mac
@tools/pcommand ensure_prefab_platform mac
@${RUN_PREFAB_MAC_SERVER_DEBUG}
prefab-mac-server-debug-build: prereqs assets-cmake \
@ -188,28 +188,28 @@ prefab-mac-server-debug-build: prereqs assets-cmake \
@${STAGE_ASSETS} -cmakeserver build/prefab/mac-server/debug/dist
build/prefab/mac-server/debug/ballisticacore_server: \
assets/src/server/ballisticacore_server.py tools/batools/snippets.py
@tools/snippets stage_server_file debug $< $@
assets/src/server/ballisticacore_server.py tools/batools/pcommand.py
@tools/pcommand stage_server_file debug $< $@
build/prefab/mac-server/debug/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/batools/snippets.py \
tools/batools/pcommand.py \
tools/bacommon/servermanager.py
@tools/snippets stage_server_file debug $< $@
@tools/pcommand stage_server_file debug $< $@
build/prefab/mac-server/debug/README.txt: \
assets/src/server/README.txt
@cp $< $@
build/prefab/mac-server/debug/dist/ballisticacore_headless: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_MAC_SERVER_RELEASE = cd build/prefab/mac-server/release \
&& ./ballisticacore_server
prefab-mac-server-release: prefab-mac-server-release-build
@tools/snippets ensure_prefab_platform mac
@tools/pcommand ensure_prefab_platform mac
@${RUN_PREFAB_MAC_SERVER_RELEASE}
prefab-mac-server-release-build: prereqs assets-cmake \
@ -220,27 +220,27 @@ prefab-mac-server-release-build: prereqs assets-cmake \
@${STAGE_ASSETS} -cmakeserver build/prefab/mac-server/release/dist
build/prefab/mac-server/release/ballisticacore_server: \
assets/src/server/ballisticacore_server.py tools/batools/snippets.py
@tools/snippets stage_server_file release $< $@
assets/src/server/ballisticacore_server.py tools/batools/pcommand.py
@tools/pcommand stage_server_file release $< $@
build/prefab/mac-server/release/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/batools/snippets.py \
tools/batools/pcommand.py \
tools/bacommon/servermanager.py
@tools/snippets stage_server_file release $< $@
@tools/pcommand stage_server_file release $< $@
build/prefab/mac-server/release/README.txt: \
assets/src/server/README.txt
@cp $< $@
build/prefab/mac-server/release/dist/ballisticacore_headless: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_LINUX_DEBUG = cd build/prefab/linux/debug && ./ballisticacore
prefab-linux-debug: prefab-linux-debug-build
@tools/snippets ensure_prefab_platform linux
@tools/pcommand ensure_prefab_platform linux
@${RUN_PREFAB_LINUX_DEBUG}
prefab-linux-debug-build: prereqs assets-cmake \
@ -248,12 +248,12 @@ prefab-linux-debug-build: prereqs assets-cmake \
@${STAGE_ASSETS} -cmake build/prefab/linux/debug
build/prefab/linux/debug/ballisticacore: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_LINUX_RELEASE = cd build/prefab/linux/release && ./ballisticacore
prefab-linux-release: prefab-linux-release-build
@tools/snippets ensure_prefab_platform linux
@tools/pcommand ensure_prefab_platform linux
@${RUN_PREFAB_LINUX_RELEASE}
prefab-linux-release-build: prereqs assets-cmake \
@ -261,13 +261,13 @@ prefab-linux-release-build: prereqs assets-cmake \
@${STAGE_ASSETS} -cmake build/prefab/linux/release
build/prefab/linux/release/ballisticacore: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_LINUX_SERVER_DEBUG = cd build/prefab/linux-server/debug \
&& ./ballisticacore_server
prefab-linux-server-debug: prefab-linux-server-debug-build
@tools/snippets ensure_prefab_platform linux
@tools/pcommand ensure_prefab_platform linux
@${RUN_PREFAB_LINUX_SERVER_DEBUG}
prefab-linux-server-debug-build: prereqs assets-cmake \
@ -278,28 +278,28 @@ prefab-linux-server-debug-build: prereqs assets-cmake \
@${STAGE_ASSETS} -cmakeserver build/prefab/linux-server/debug/dist
build/prefab/linux-server/debug/ballisticacore_server: \
assets/src/server/ballisticacore_server.py tools/batools/snippets.py
@tools/snippets stage_server_file debug $< $@
assets/src/server/ballisticacore_server.py tools/batools/pcommand.py
@tools/pcommand stage_server_file debug $< $@
build/prefab/linux-server/debug/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/batools/snippets.py \
tools/batools/pcommand.py \
tools/bacommon/servermanager.py
@tools/snippets stage_server_file debug $< $@
@tools/pcommand stage_server_file debug $< $@
build/prefab/linux-server/debug/README.txt: \
assets/src/server/README.txt
@cp $< $@
build/prefab/linux-server/debug/dist/ballisticacore_headless: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_LINUX_SERVER_RELEASE = cd build/prefab/linux-server/release \
&& ./ballisticacore_server
prefab-linux-server-release: prefab-linux-server-release-build
@tools/snippets ensure_prefab_platform linux
@tools/pcommand ensure_prefab_platform linux
@${RUN_PREFAB_LINUX_SERVER_RELEASE}
prefab-linux-server-release-build: prereqs assets-cmake \
@ -310,29 +310,29 @@ prefab-linux-server-release-build: prereqs assets-cmake \
@${STAGE_ASSETS} -cmakeserver build/prefab/linux-server/release/dist
build/prefab/linux-server/release/ballisticacore_server: \
assets/src/server/ballisticacore_server.py tools/batools/snippets.py
@tools/snippets stage_server_file release $< $@
assets/src/server/ballisticacore_server.py tools/batools/pcommand.py
@tools/pcommand stage_server_file release $< $@
build/prefab/linux-server/release/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/batools/snippets.py \
tools/batools/pcommand.py \
tools/bacommon/servermanager.py
@tools/snippets stage_server_file release $< $@
@tools/pcommand stage_server_file release $< $@
build/prefab/linux-server/release/README.txt: \
assets/src/server/README.txt
@cp $< $@
build/prefab/linux-server/release/dist/ballisticacore_headless: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
PREFAB_WINDOWS_PLATFORM = Win32
RUN_PREFAB_WINDOWS_DEBUG = cd build/prefab/windows/debug && ./BallisticaCore.exe
prefab-windows-debug: prefab-windows-debug-build
@tools/snippets ensure_prefab_platform windows
@tools/pcommand ensure_prefab_platform windows
@{RUN_PREFAB_WINDOWS_DEBUG}
prefab-windows-debug-build: prereqs assets-windows-${PREFAB_WINDOWS_PLATFORM} \
@ -341,13 +341,13 @@ prefab-windows-debug-build: prereqs assets-windows-${PREFAB_WINDOWS_PLATFORM} \
build/prefab/windows/debug
build/prefab/windows/debug/BallisticaCore.exe: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_WINDOWS_RELEASE = cd build/prefab/windows/release \
&& ./BallisticaCore.exe
prefab-windows-release: prefab-windows-release-build
@tools/snippets ensure_prefab_platform windows
@tools/pcommand ensure_prefab_platform windows
@{RUN_PREFAB_WINDOWS_RELEASE}
prefab-windows-release-build: prereqs \
@ -357,13 +357,13 @@ prefab-windows-release-build: prereqs \
build/prefab/windows/release
build/prefab/windows/release/BallisticaCore.exe: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
RUN_PREFAB_WINDOWS_SERVER_DEBUG = cd build/prefab/windows-server/debug \
&& dist/python.exe ballisticacore_server.py
prefab-windows-server-debug: prefab-windows-server-debug-build
@tools/snippets ensure_prefab_platform windows
@tools/pcommand ensure_prefab_platform windows
@{RUN_PREFAB_WINDOWS_SERVER_DEBUG}
prefab-windows-server-debug-build: prereqs \
@ -377,22 +377,22 @@ prefab-windows-server-debug-build: prereqs \
build/prefab/windows-server/debug/dist
build/prefab/windows-server/debug/dist/ballisticacore_headless.exe: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
build/prefab/windows-server/debug/ballisticacore_server.py: \
assets/src/server/ballisticacore_server.py tools/batools/snippets.py
@tools/snippets stage_server_file debug $< $@
assets/src/server/ballisticacore_server.py tools/batools/pcommand.py
@tools/pcommand stage_server_file debug $< $@
build/prefab/windows-server/debug/launch_ballisticacore_server.bat: \
assets/src/server/launch_ballisticacore_server.bat tools/batools/snippets.py
@tools/snippets stage_server_file debug $< $@
assets/src/server/launch_ballisticacore_server.bat tools/batools/pcommand.py
@tools/pcommand stage_server_file debug $< $@
build/prefab/windows-server/debug/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/batools/snippets.py \
tools/batools/pcommand.py \
tools/bacommon/servermanager.py
@tools/snippets stage_server_file debug $< $@
@tools/pcommand stage_server_file debug $< $@
build/prefab/windows-server/debug/README.txt: \
assets/src/server/README.txt
@ -402,7 +402,7 @@ RUN_PREFAB_WINDOWS_SERVER_RELEASE = cd build/prefab/windows-server/release \
&& dist/python.exe -O ballisticacore_server.py
prefab-windows-server-release: prefab-windows-server-release-build
@tools/snippets ensure_prefab_platform windows
@tools/pcommand ensure_prefab_platform windows
@{RUN_PREFAB_WINDOWS_SERVER_RELEASE}
prefab-windows-server-release-build: prereqs \
@ -416,22 +416,22 @@ prefab-windows-server-release-build: prereqs \
build/prefab/windows-server/release/dist
build/prefab/windows-server/release/dist/ballisticacore_headless.exe: .efrocachemap
@tools/snippets efrocache_get $@
@tools/pcommand efrocache_get $@
build/prefab/windows-server/release/ballisticacore_server.py: \
assets/src/server/ballisticacore_server.py tools/batools/snippets.py
@tools/snippets stage_server_file release $< $@
assets/src/server/ballisticacore_server.py tools/batools/pcommand.py
@tools/pcommand stage_server_file release $< $@
build/prefab/windows-server/release/launch_ballisticacore_server.bat: \
assets/src/server/launch_ballisticacore_server.bat tools/batools/snippets.py
@tools/snippets stage_server_file release $< $@
assets/src/server/launch_ballisticacore_server.bat tools/batools/pcommand.py
@tools/pcommand stage_server_file release $< $@
build/prefab/windows-server/release/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/batools/snippets.py \
tools/batools/pcommand.py \
tools/bacommon/servermanager.py
@tools/snippets stage_server_file release $< $@
@tools/pcommand stage_server_file release $< $@
build/prefab/windows-server/release/README.txt: \
assets/src/server/README.txt
@ -483,32 +483,32 @@ update-check: prereqs
# Run formatting on all files in the project considered 'dirty'.
format:
@${MAKE} -j3 format-code format-scripts format-makefile
@tools/snippets echo GRN Formatting complete!
@tools/pcommand echo GRN Formatting complete!
# Same but always formats; ignores dirty state.
format-full:
@${MAKE} -j3 format-code-full format-scripts-full format-makefile
@tools/snippets echo GRN Formatting complete!
@tools/pcommand echo GRN Formatting complete!
# Run formatting for compiled code sources (.cc, .h, etc.).
format-code: prereqs
@tools/snippets formatcode
@tools/pcommand formatcode
# Same but always formats; ignores dirty state.
format-code-full: prereqs
@tools/snippets formatcode -full
@tools/pcommand formatcode -full
# Runs formatting for scripts (.py, etc).
format-scripts: prereqs
@tools/snippets formatscripts
@tools/pcommand formatscripts
# Same but always formats; ignores dirty state.
format-scripts-full: prereqs
@tools/snippets formatscripts -full
@tools/pcommand formatscripts -full
# Runs formatting on the project Makefile.
format-makefile: prereqs
@tools/snippets formatmakefile
@tools/pcommand formatmakefile
.PHONY: format format-full format-code format-code-full format-scripts \
format-scripts-full
@ -523,62 +523,62 @@ format-makefile: prereqs
# Run all project checks. (static analysis)
check: update-check
@${MAKE} -j3 cpplint pylint mypy
@tools/snippets echo GRN ALL CHECKS PASSED!
@tools/pcommand echo GRN ALL CHECKS PASSED!
# Same as check but no caching (all files are checked).
check-full: update-check
@${MAKE} -j3 cpplint-full pylint-full mypy-full
@tools/snippets echo GRN ALL CHECKS PASSED!
@tools/pcommand echo GRN ALL CHECKS PASSED!
# Same as 'check' plus optional/slow extra checks.
check2: update-check
@${MAKE} -j4 cpplint pylint mypy pycharm
@tools/snippets echo GRN ALL CHECKS PASSED!
@tools/pcommand echo GRN ALL CHECKS PASSED!
# Same as check2 but no caching (all files are checked).
check2-full: update-check
@${MAKE} -j4 cpplint-full pylint-full mypy-full pycharm-full
@tools/snippets echo GRN ALL CHECKS PASSED!
@tools/pcommand echo GRN ALL CHECKS PASSED!
# Run Cpplint checks on all C/C++ code.
cpplint: prereqs
@tools/snippets cpplint
@tools/pcommand cpplint
# Run Cpplint checks without caching (all files are checked).
cpplint-full: prereqs
@tools/snippets cpplint -full
@tools/pcommand cpplint -full
# Run Pylint checks on all Python Code.
pylint: prereqs
@tools/snippets pylint
@tools/pcommand pylint
# Run Pylint checks without caching (all files are checked).
pylint-full: prereqs
@tools/snippets pylint -full
@tools/pcommand pylint -full
# Run Mypy checks on all Python code.
mypy: prereqs
@tools/snippets mypy
@tools/pcommand mypy
# Run Mypy checks without caching (all files are checked).
mypy-full: prereqs
@tools/snippets mypy -full
@tools/pcommand mypy -full
# Run Mypy checks on all Python code using daemon mode.
dmypy: prereqs
@tools/snippets dmypy
@tools/pcommand dmypy
# Stop the mypy daemon
dmypy-stop: prereqs
@tools/snippets dmypy -stop
@tools/pcommand dmypy -stop
# Run PyCharm checks on all Python code.
pycharm: prereqs
@tools/snippets pycharm
@tools/pcommand pycharm
# Run PyCharm checks without caching (all files are checked).
pycharm-full: prereqs
@tools/snippets pycharm -full
@tools/pcommand pycharm -full
# Tell make which of these targets don't represent files.
.PHONY: check check-full check2 check2-full \
@ -594,19 +594,19 @@ pycharm-full: prereqs
# Run all tests. (live execution verification)
test: prereqs
@tools/snippets echo BLU Running all tests...
@tools/snippets pytest -v tests
@tools/pcommand echo BLU Running all tests...
@tools/pcommand pytest -v tests
# Run tests with any caching disabled.
test-full: test
# Iterate on individual tests with extra debug output enabled.
test-assetmanager:
@tools/snippets pytest -o log_cli=true -o log_cli_level=debug -s -v \
@tools/pcommand pytest -o log_cli=true -o log_cli_level=debug -s -v \
tests/test_ba/test_assetmanager.py::test_assetmanager
test-dataclasses:
@tools/snippets pytest -o log_cli=true -o log_cli_level=debug -s -v \
@tools/pcommand pytest -o log_cli=true -o log_cli_level=debug -s -v \
tests/test_efro/test_dataclasses.py
# Tell make which of these targets don't represent files.
@ -624,28 +624,28 @@ preflight:
@${MAKE} format
@${MAKE} update
@${MAKE} -j4 cpplint pylint mypy test
@tools/snippets echo SGRN BLD PREFLIGHT SUCCESSFUL!
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Same as 'preflight' without caching (all files are visited).
preflight-full:
@${MAKE} format-full
@${MAKE} update
@${MAKE} -j4 cpplint-full pylint-full mypy-full test-full
@tools/snippets echo SGRN BLD PREFLIGHT SUCCESSFUL!
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Same as 'preflight' plus optional/slow extra checks.
preflight2:
@${MAKE} format
@${MAKE} update
@${MAKE} -j5 cpplint pylint mypy pycharm test
@tools/snippets echo SGRN BLD PREFLIGHT SUCCESSFUL!
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Same as 'preflight2' but without caching (all files visited).
preflight2-full:
@${MAKE} format-full
@${MAKE} update
@${MAKE} -j5 cpplint-full pylint-full mypy-full pycharm-full test-full
@tools/snippets echo SGRN BLD PREFLIGHT SUCCESSFUL!
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Tell make which of these targets don't represent files.
.PHONY: preflight preflight-full preflight2 preflight2-full
@ -672,16 +672,16 @@ ROOT_CLEAN_IGNORES = --exclude=assets/src_master \
--exclude=config/localconfig.json \
--exclude=.spinoffdata
CHECK_CLEAN_SAFETY = ${PROJ_DIR}/tools/snippets check_clean_safety
CHECK_CLEAN_SAFETY = ${PROJ_DIR}/tools/pcommand check_clean_safety
# Some tool configs that need filtering (mainly injecting projroot path).
TOOL_CFG_INST = tools/snippets tool_config_install
TOOL_CFG_INST = tools/pcommand tool_config_install
# Anything that affects tool-config generation.
TOOL_CFG_SRC = tools/efrotools/snippets.py config/config.json
TOOL_CFG_SRC = tools/efrotools/pcommand.py config/config.json
# Anything that should trigger an environment-check when changed.
ENV_SRC = tools/snippets tools/batools/build.py
ENV_SRC = tools/pcommand tools/batools/build.py
.clang-format: config/toolconfigsrc/clang-format ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
@ -709,7 +709,7 @@ ENV_SRC = tools/snippets tools/batools/build.py
# Include anything as sources here that should require
.cache/checkenv: ${ENV_SRC}
@tools/snippets checkenv
@tools/pcommand checkenv
@mkdir -p .cache
@touch .cache/checkenv

File diff suppressed because it is too large Load Diff

View File

@ -461,7 +461,7 @@ class TournamentEntryWindow(popup.PopupWindow):
# This is not ideal since players will have to rejoin, etc.,
# but it works for now.
except Exception:
print('Error restarting tournament activity.')
ba.print_exception('Error restarting tournament activity.')
# If we had no existing activity (or were unable to restart it)
# launch a new session.

View File

@ -2,4 +2,4 @@
checkers= pylint, mypy3
mypy_config_file=.mypy.ini
mypy_use_daemon=true
mypy_daemon_files_command=tools/snippets scriptfiles -lines
mypy_daemon_files_command=tools/pcommand scriptfiles -lines

View File

@ -1,5 +1,5 @@
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
<h4><em>last updated on 2020-07-03 for Ballistica version 1.5.17 build 20102</em></h4>
<h4><em>last updated on 2020-07-03 for Ballistica version 1.5.17 build 20104</em></h4>
<p>This page documents the Python classes and functions in the 'ba' module,
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>
<hr>

View File

@ -201,7 +201,7 @@ def lazybuild(target: str, category: SourceCategory, command: str) -> None:
# Everything possibly affecting resource builds.
elif category is SourceCategory.RESOURCES:
paths = [
'Makefile', 'tools/snippets', 'resources/src', 'resources/Makefile'
'Makefile', 'tools/pcommand', 'resources/src', 'resources/Makefile'
]
else:
raise ValueError(f'Invalid source category: {category}')
@ -284,22 +284,22 @@ def gen_fulltest_buildfile_android() -> None:
extras = [e for e in extras if e.startswith('android.')]
for extra in extras:
if extra == 'android.pylibs.arm':
lines.append('tools/snippets python_build_android arm')
lines.append('tools/pcommand python_build_android arm')
elif extra == 'android.pylibs.arm.debug':
lines.append('tools/snippets python_build_android_debug arm')
lines.append('tools/pcommand python_build_android_debug arm')
elif extra == 'android.pylibs.arm64':
lines.append('tools/snippets python_build_android arm64')
lines.append('tools/pcommand python_build_android arm64')
elif extra == 'android.pylibs.arm64.debug':
lines.append('tools/snippets python_build_android_debug arm64')
lines.append('tools/pcommand python_build_android_debug arm64')
elif extra == 'android.pylibs.x86':
lines.append('tools/snippets python_build_android x86')
lines.append('tools/pcommand python_build_android x86')
elif extra == 'android.pylibs.x86.debug':
lines.append('tools/snippets python_build_android_debug x86')
lines.append('tools/pcommand python_build_android_debug x86')
elif extra == 'android.pylibs.x86_64':
lines.append('tools/snippets python_build_android x86_64')
lines.append('tools/pcommand python_build_android x86_64')
elif extra == 'android.pylibs.x86_64.debug':
lines.append(
'tools/snippets python_build_android_debug x86_64')
'tools/pcommand python_build_android_debug x86_64')
elif extra == 'android.package':
lines.append('make android-package')
else:
@ -375,9 +375,9 @@ def gen_fulltest_buildfile_apple() -> None:
extras = [e for e in extras if e.startswith('ios.')]
for extra in extras:
if extra == 'ios.pylibs':
lines.append('tools/snippets python_build_apple ios')
lines.append('tools/pcommand python_build_apple ios')
elif extra == 'ios.pylibs.debug':
lines.append('tools/snippets python_build_apple_debug ios')
lines.append('tools/pcommand python_build_apple_debug ios')
else:
raise RuntimeError(f'Unknown extra: {extra}')
@ -388,9 +388,9 @@ def gen_fulltest_buildfile_apple() -> None:
extras = [e for e in extras if e.startswith('tvos.')]
for extra in extras:
if extra == 'tvos.pylibs':
lines.append('tools/snippets python_build_apple tvos')
lines.append('tools/pcommand python_build_apple tvos')
elif extra == 'tvos.pylibs.debug':
lines.append('tools/snippets python_build_apple_debug tvos')
lines.append('tools/pcommand python_build_apple_debug tvos')
else:
raise RuntimeError(f'Unknown extra: {extra}')
@ -410,9 +410,9 @@ def gen_fulltest_buildfile_apple() -> None:
elif extra == 'mac.package.server':
lines.append('make mac-server-package')
elif extra == 'mac.pylibs':
lines.append('tools/snippets python_build_apple mac')
lines.append('tools/pcommand python_build_apple mac')
elif extra == 'mac.pylibs.debug':
lines.append('tools/snippets python_build_apple_debug mac')
lines.append('tools/pcommand python_build_apple_debug mac')
else:
raise RuntimeError(f'Unknown extra: {extra}')
@ -540,7 +540,7 @@ def checkenv() -> None:
f' found {_vstr(vnums)}.\n'
f'To upgrade it, try: "{PYTHON_BIN}'
f' -m pip install --upgrade {packagename}".\n'
'Alternately, "tools/snippets install_pip_reqs"'
'Alternately, "tools/pcommand install_pip_reqs"'
' will update all pip requirements.')
print(f'{Clr.BLD}Environment ok.{Clr.RST}', flush=True)

View File

@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# -----------------------------------------------------------------------------
"""Standard snippets that can be pulled into project snippets scripts.
"""Standard snippets that can be pulled into project pcommand scripts.
A snippet is a mini-program that directly takes input from stdin and does
some focused task. This module consists of ballistica-specific ones.
@ -30,7 +30,7 @@ from __future__ import annotations
import sys
from typing import TYPE_CHECKING
from efrotools.snippets import PROJROOT
from efrotools.pcommand import PROJROOT
if TYPE_CHECKING:
from typing import Optional, List, Set
@ -171,7 +171,7 @@ def check_mac_ssh() -> None:
if ('UsePAM yes' in lines or '#PasswordAuthentication yes' in lines
or '#ChallengeResponseAuthentication yes' in lines):
print('ERROR: ssh config is allowing password access.\n'
'To fix: sudo tools/snippets fix_mac_ssh')
'To fix: sudo tools/pcommand fix_mac_ssh')
sys.exit(255)
print('password ssh auth seems disabled; hooray!')
@ -204,7 +204,7 @@ def check_clean_safety() -> None:
adding something.
"""
import os
from efrotools.snippets import check_clean_safety as std_snippet
from efrotools.pcommand import check_clean_safety as std_snippet
# First do standard checks.
std_snippet()
@ -304,7 +304,7 @@ def androidaddr() -> None:
from efro.error import CleanError
if len(sys.argv) != 5:
raise CleanError(f'ERROR: expected 3 args; got {len(sys.argv) - 2}\n'
f'Usage: "tools/snippets android_addr'
f'Usage: "tools/pcommand android_addr'
f' <ARCHIVE-PATH> <ARCH> <ADDR>"')
archive_dir = sys.argv[2]
arch = sys.argv[3]

View File

@ -158,7 +158,7 @@ def filter_makefile(makefile_dir: str, contents: str) -> str:
cachemap = os.path.join(to_proj_root, CACHE_MAP_NAME)
lines = contents.splitlines()
snippets = 'tools/snippets'
pcommand = 'tools/pcommand'
# Strip out parts they don't want.
while STRIP_BEGIN_TAG in lines:
@ -184,7 +184,7 @@ def filter_makefile(makefile_dir: str, contents: str) -> str:
lines.insert(index, tname + ': ' + cachemap)
target = (makefile_dir + '/' + '$@') if makefile_dir else '$@'
pre = f'cd {to_proj_root} && ' if makefile_dir else ''
lines.insert(index + 1, f'\t@{pre}{snippets} efrocache_get {target}')
lines.insert(index + 1, f'\t@{pre}{pcommand} efrocache_get {target}')
return '\n'.join(lines) + '\n'

View File

@ -18,11 +18,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# -----------------------------------------------------------------------------
"""Standard snippets that can be pulled into project snippets scripts.
"""Standard snippets that can be pulled into project pcommand scripts.
A snippet is a mini-program that directly takes input from stdin and does
some focused task. This module is a repository of common snippets that can
be imported into projects' snippets script for easy reuse.
be imported into projects' pcommand script for easy reuse.
"""
from __future__ import annotations
@ -39,8 +39,8 @@ if TYPE_CHECKING:
PROJROOT = Path(__file__).resolve().parents[2]
def snippets_main(globs: Dict[str, Any]) -> None:
"""Run a snippet contained in the snippets script.
def pcommand_main(globs: Dict[str, Any]) -> None:
"""Run a snippet contained in the pcommand script.
We simply look for all public functions and call
the one corresponding to the first passed arg.
@ -49,7 +49,7 @@ def snippets_main(globs: Dict[str, Any]) -> None:
from efro.error import CleanError
from efro.terminal import Clr
funcs = dict(((name, obj) for name, obj in globs.items()
if not name.startswith('_') and name != 'snippets_main'
if not name.startswith('_') and name != 'pcommand_main'
and isinstance(obj, types.FunctionType)))
show_help = False
retval = 0
@ -67,7 +67,7 @@ def snippets_main(globs: Dict[str, Any]) -> None:
else:
docs = _trim_docstring(
getattr(funcs[sys.argv[2]], '__doc__', '<no docs>'))
print(f'\n{Clr.MAG}{Clr.BLD}snippets {sys.argv[2]}:{Clr.RST}\n'
print(f'\n{Clr.MAG}{Clr.BLD}pcommand {sys.argv[2]}:{Clr.RST}\n'
f'{Clr.MAG}{docs}{Clr.RST}\n')
elif sys.argv[1] in funcs:
try:
@ -80,14 +80,14 @@ def snippets_main(globs: Dict[str, Any]) -> None:
sys.exit(1)
else:
print(
f'{Clr.RED}Unknown snippets command: "{sys.argv[1]}"{Clr.RST}',
f'{Clr.RED}Unknown pcommand command: "{sys.argv[1]}"{Clr.RST}',
file=sys.stderr)
retval = 255
if show_help:
print('Snippets contains project related commands too small'
print('Pcommand contains project related commands too small'
' to warrant full scripts.')
print(f"Run {Clr.MAG}'snippets help {Clr.BLD}<COMMAND>'"
print(f"Run {Clr.MAG}'pcommand help {Clr.BLD}<COMMAND>'"
f'{Clr.RST} for full command documentation.')
print('Available commands:')
for func, obj in sorted(funcs.items()):

View File

@ -291,7 +291,7 @@ def build_android(rootdir: str, arch: str, debug: bool = False) -> None:
ftxt, ' def build(self):',
' def build(self):\n import os\n'
' if os.system(\'"' + rootdir +
'/tools/snippets" python_android_patch "' + os.getcwd() +
'/tools/pcommand" python_android_patch "' + os.getcwd() +
'"\') != 0: raise Exception("patch apply failed")')
efrotools.writefile('pybuild/packages/python.py', ftxt)

View File

@ -37,13 +37,13 @@ from typing import TYPE_CHECKING
# Pull in the snippets we want to expose. Its more efficient to define them in
# modules rather than inline here because we'll be able to load them via pyc.
# pylint: disable=unused-import
from efrotools.snippets import (
PROJROOT, snippets_main, formatcode, formatscripts, formatmakefile,
from efrotools.pcommand import (
PROJROOT, pcommand_main, formatcode, formatscripts, formatmakefile,
cpplint, pylint, runpylint, mypy, runmypy, dmypy, tool_config_install,
sync, sync_all, scriptfiles, pycharm, clioncode, androidstudiocode,
makefile_target_list, spelling, spelling_all, pytest, echo,
compile_python_files)
from batools.snippets import (
from batools.pcommand import (
stage_server_file, py_examine, fix_mac_ssh, check_mac_ssh, resize_image,
check_clean_safety, clean_orphaned_assets, archive_old_builds,
lazy_increment_build, get_master_asset_src_dir, androidaddr, push_ipa,
@ -62,4 +62,4 @@ if TYPE_CHECKING:
pass
if __name__ == '__main__':
snippets_main(globals())
pcommand_main(globals())

View File

@ -187,7 +187,7 @@ def _get_py_targets_subset(all_targets: Set[str], subset: str,
# For now setting PYTHONHASHSEED=1 is a workaround.
out += ('\n' + target + ': \\\n ' + py_targets[i] +
'\n\t@echo Compiling script: $^\n'
'\t@rm -rf $@ && PYTHONHASHSEED=1 $(TOOLS_DIR)/snippets'
'\t@rm -rf $@ && PYTHONHASHSEED=1 $(TOOLS_DIR)/pcommand'
' compile_python_files $^'
' && chmod 444 $@\n')

View File

@ -155,7 +155,7 @@ class App:
# been updated.
# (only do this if gendocs is available)
if os.path.exists('tools/gendocs.py'):
if os.system('tools/snippets update_docs_md' +
if os.system('tools/pcommand update_docs_md' +
self._checkarg) != 0:
print(f'{Clr.RED}Error checking/updating'
f' docs markdown.{Clr.RST}')
@ -628,7 +628,7 @@ class App:
def _check_sync_states(self) -> None:
# Make sure none of our sync targets have been mucked with since
# their last sync.
if os.system('tools/snippets sync check') != 0:
if os.system('tools/pcommand sync check') != 0:
print(Clr.RED + 'Sync check failed; you may need to run "sync".' +
Clr.RST)
sys.exit(255)