fix(tools/idf.py): Add implicit dependencies to flash targets

This commit is contained in:
Peter Dragun
2025-12-01 16:11:58 +01:00
parent 1a17be64a9
commit 3f0fde84e1
2 changed files with 14 additions and 8 deletions
+12 -6
View File
@@ -641,7 +641,8 @@ def action_extensions(base_actions: dict, project_path: str) -> dict:
'callback': flash,
'help': 'Flash the project.',
'options': global_options + flash_options,
'order_dependencies': ['all', 'erase-flash'],
'order_dependencies': ['erase-flash'],
'dependencies': ['all'],
},
'erase-flash': {
'callback': erase_flash,
@@ -1178,31 +1179,36 @@ def action_extensions(base_actions: dict, project_path: str) -> dict:
'callback': flash,
'help': 'Flash partition table only.',
'options': flash_options,
'order_dependencies': ['partition-table', 'erase-flash'],
'order_dependencies': ['erase-flash'],
'dependencies': ['partition-table'],
},
'bootloader-flash': {
'callback': flash,
'help': 'Flash bootloader only.',
'options': flash_options,
'order_dependencies': ['bootloader', 'erase-flash'],
'order_dependencies': ['erase-flash'],
'dependencies': ['bootloader'],
},
'app-flash': {
'callback': flash,
'help': 'Flash the app only.',
'options': flash_options,
'order_dependencies': ['app', 'erase-flash'],
'order_dependencies': ['erase-flash'],
'dependencies': ['app'],
},
'encrypted-app-flash': {
'callback': flash,
'help': 'Flash the encrypted app only.',
'options': flash_options,
'order_dependencies': ['app', 'erase-flash'],
'order_dependencies': ['erase-flash'],
'dependencies': ['app'],
},
'encrypted-flash': {
'callback': flash,
'help': 'Flash the encrypted project.',
'options': flash_options,
'order_dependencies': ['all', 'erase-flash'],
'order_dependencies': ['erase-flash'],
'dependencies': ['all'],
},
'erase-otadata': {
'callback': ota_targets,
+2 -2
View File
@@ -99,7 +99,7 @@ class TestDependencyManagement(TestWithoutExtensions):
args=['--dry-run', 'flash'],
standalone_mode=False,
)
self.assertEqual(['flash'], list(result.keys()))
self.assertEqual(['all', 'flash'], list(result.keys()))
def test_order_only_dependencies(self):
result = idf.init_cli()(
@@ -120,7 +120,7 @@ class TestDependencyManagement(TestWithoutExtensions):
args=['--dry-run', 'clean', 'monitor', 'clean', 'fullclean', 'flash'],
standalone_mode=False,
)
self.assertEqual(['fullclean', 'clean', 'flash', 'monitor'], list(result.keys()))
self.assertEqual(['fullclean', 'clean', 'all', 'flash', 'monitor'], list(result.keys()))
def test_dupplicated_commands_warning(self):
capturedOutput = StringIO()