Deprecate qmk generate-compilation-database. (#25237)

This commit is contained in:
Nick Brassel 2025-05-06 09:52:41 +10:00 committed by GitHub
parent 842c840145
commit ac991405d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 179 additions and 197 deletions

View file

@ -12,6 +12,7 @@ from qmk.keyboard import keyboard_folder
from qmk.info import keymap_json
from qmk.keymap import locate_keymap
from qmk.path import is_under_qmk_firmware, is_under_qmk_userspace, unix_style_path
from qmk.compilation_database import write_compilation_database
# These must be kept in the order in which they're applied to $(TARGET) in the makefiles in order to ensure consistency.
TARGET_FILENAME_MODIFIERS = ['FORCE_LAYOUT', 'CONVERT_TO']
@ -150,7 +151,6 @@ class BuildTarget:
def generate_compilation_database(self, build_target: str = None, skip_clean: bool = False, **env_vars) -> None:
self.prepare_build(build_target=build_target, **env_vars)
command = self.compile_command(build_target=build_target, dry_run=True, **env_vars)
from qmk.cli.generate.compilation_database import write_compilation_database # Lazy load due to circular references
output_path = QMK_FIRMWARE / 'compile_commands.json'
ret = write_compilation_database(command=command, output_path=output_path, skip_clean=skip_clean, **env_vars)
if ret and output_path.exists() and HAS_QMK_USERSPACE: