mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 23:59:18 +08:00
Moved the update_project script into the batools package
This commit is contained in:
parent
057717598d
commit
9e8b739282
@ -4145,6 +4145,6 @@
|
|||||||
"build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/b9/c6/ac98c7aad5847fea5a37087d5aa0",
|
"build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/b9/c6/ac98c7aad5847fea5a37087d5aa0",
|
||||||
"build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/4e/59/c8cbb6d6909ab853bfa61a5160ce",
|
"build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/4e/59/c8cbb6d6909ab853bfa61a5160ce",
|
||||||
"build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/26/cd/737e2615e116d110aac319a3e293",
|
"build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/26/cd/737e2615e116d110aac319a3e293",
|
||||||
"build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/45/28/ff409cd1913fc71bf9b677b87df0",
|
"build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/94/c1/efd04026c6a251c288511ce3b037",
|
||||||
"build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/a4/15/f823745542ea46f679552669b131"
|
"build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/b4/50/b5fe4c0946537354fdc80aec5bb9"
|
||||||
}
|
}
|
||||||
4
Makefile
4
Makefile
@ -464,11 +464,11 @@ prefab-clean:
|
|||||||
|
|
||||||
# Update any project files that need it (does NOT build projects).
|
# Update any project files that need it (does NOT build projects).
|
||||||
update: prereqs
|
update: prereqs
|
||||||
@tools/update_project
|
@tools/pcommand update_project
|
||||||
|
|
||||||
# Don't update but fail if anything needs it.
|
# Don't update but fail if anything needs it.
|
||||||
update-check: prereqs
|
update-check: prereqs
|
||||||
@tools/update_project --check
|
@tools/pcommand update_project --check
|
||||||
|
|
||||||
# Tell make which of these targets don't represent files.
|
# Tell make which of these targets don't represent files.
|
||||||
.PHONY: update update-check
|
.PHONY: update update-check
|
||||||
|
|||||||
@ -710,3 +710,12 @@ def update_assets_makefile() -> None:
|
|||||||
from batools.assetsmakefile import update_assets_makefile as uam
|
from batools.assetsmakefile import update_assets_makefile as uam
|
||||||
check = ('--check' in sys.argv)
|
check = ('--check' in sys.argv)
|
||||||
uam(projroot=str(PROJROOT), check=check)
|
uam(projroot=str(PROJROOT), check=check)
|
||||||
|
|
||||||
|
|
||||||
|
def update_project() -> None:
|
||||||
|
"""Update project files."""
|
||||||
|
from batools.updateproject import Updater
|
||||||
|
check = '--check' in sys.argv
|
||||||
|
fix = '--fix' in sys.argv
|
||||||
|
|
||||||
|
Updater(check=check, fix=fix).run()
|
||||||
|
|||||||
@ -63,14 +63,14 @@ class LineChange:
|
|||||||
can_auto_update: bool
|
can_auto_update: bool
|
||||||
|
|
||||||
|
|
||||||
class App:
|
class Updater:
|
||||||
"""Context for an app run."""
|
"""Context for an app run."""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self, check: bool, fix: bool) -> None:
|
||||||
from efrotools import getconfig, getlocalconfig
|
from efrotools import getconfig, getlocalconfig
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
self._check = ('--check' in sys.argv)
|
self._check = check
|
||||||
self._fix = ('--fix' in sys.argv)
|
self._fix = fix
|
||||||
self._checkarg = ' --check' if self._check else ''
|
self._checkarg = ' --check' if self._check else ''
|
||||||
|
|
||||||
# We behave differently in the public repo
|
# We behave differently in the public repo
|
||||||
@ -239,10 +239,9 @@ class App:
|
|||||||
lines = infile.read().splitlines()
|
lines = infile.read().splitlines()
|
||||||
line = lines[change[1].line_number]
|
line = lines[change[1].line_number]
|
||||||
print(f'{Clr.RED} Found "{line}"{Clr.RST}')
|
print(f'{Clr.RED} Found "{line}"{Clr.RST}')
|
||||||
print(Clr.RED +
|
print(f'{Clr.RED}All {len(auto_changes)} errors are'
|
||||||
f'All {len(auto_changes)} errors are auto-fixable;'
|
f' auto-fixable; run tools/pcommand update_project'
|
||||||
' run tools/update_project --fix to apply corrections.' +
|
f' --fix to apply corrections. {Clr.RST}')
|
||||||
Clr.RST)
|
|
||||||
sys.exit(255)
|
sys.exit(255)
|
||||||
else:
|
else:
|
||||||
for i, change in enumerate(auto_changes):
|
for i, change in enumerate(auto_changes):
|
||||||
@ -665,5 +664,5 @@ class App:
|
|||||||
sys.exit(255)
|
sys.exit(255)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
# if __name__ == '__main__':
|
||||||
App().run()
|
# App().run()
|
||||||
@ -55,7 +55,7 @@ from batools.pcommand import (
|
|||||||
get_modern_make, warm_start_asset_build, update_docs_md, list_pip_reqs,
|
get_modern_make, warm_start_asset_build, update_docs_md, list_pip_reqs,
|
||||||
install_pip_reqs, checkenv, ensure_prefab_platform, prefab_run_var,
|
install_pip_reqs, checkenv, ensure_prefab_platform, prefab_run_var,
|
||||||
make_prefab, update_makebob, lazybuild, android_archive_unstripped_libs,
|
make_prefab, update_makebob, lazybuild, android_archive_unstripped_libs,
|
||||||
efro_gradle, stage_assets, update_assets_makefile)
|
efro_gradle, stage_assets, update_assets_makefile, update_project)
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user