From a5d49d4db5e168e406a8fd34fde68b29d0767a8d Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Fri, 14 Feb 2020 12:24:11 +0500 Subject: [PATCH] tools: fix double builds with idf.py --- tools/idf_py_actions/serial_ext.py | 19 +++++++------------ tools/test_idf_py/test_idf_py.py | 4 ++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tools/idf_py_actions/serial_ext.py b/tools/idf_py_actions/serial_ext.py index a73e05f95e..cea3112068 100644 --- a/tools/idf_py_actions/serial_ext.py +++ b/tools/idf_py_actions/serial_ext.py @@ -111,6 +111,7 @@ def action_extensions(base_actions, project_path): run_tool("idf_monitor", monitor_args, args.project_dir) def flash(action, ctx, args): + ensure_build_directory(args, ctx.info_name) """ Run esptool to flash the entire project, from an argfile generated by the build system """ @@ -147,8 +148,7 @@ def action_extensions(base_actions, project_path): "callback": flash, "help": "Flash the project.", "options": global_options + [baud_rate, port], - "dependencies": ["all"], - "order_dependencies": ["erase_flash"], + "order_dependencies": ["all", "erase_flash"], }, "erase_flash": { "callback": erase_flash, @@ -197,34 +197,29 @@ def action_extensions(base_actions, project_path): "callback": flash, "help": "Flash partition table only.", "options": [baud_rate, port], - "dependencies": ["partition_table"], - "order_dependencies": ["erase_flash"], + "order_dependencies": ["partition_table", "erase_flash"], }, "bootloader-flash": { "callback": flash, "help": "Flash bootloader only.", "options": [baud_rate, port], - "dependencies": ["bootloader"], - "order_dependencies": ["erase_flash"], + "order_dependencies": ["bootloader", "erase_flash"], }, "app-flash": { "callback": flash, "help": "Flash the app only.", "options": [baud_rate, port], - "dependencies": ["app"], - "order_dependencies": ["erase_flash"], + "order_dependencies": ["app", "erase_flash"], }, "encrypted-app-flash": { "callback": flash, "help": "Flash the encrypted app only.", - "dependencies": ["app"], - "order_dependencies": ["erase_flash"], + "order_dependencies": ["app", "erase_flash"], }, "encrypted-flash": { "callback": flash, "help": "Flash the encrypted project.", - "dependencies": ["all"], - "order_dependencies": ["erase_flash"], + "order_dependencies": ["all", "erase_flash"], }, }, } diff --git a/tools/test_idf_py/test_idf_py.py b/tools/test_idf_py/test_idf_py.py index 5b9216a994..c027b54f8c 100755 --- a/tools/test_idf_py/test_idf_py.py +++ b/tools/test_idf_py/test_idf_py.py @@ -84,7 +84,7 @@ class TestDependencyManagement(unittest.TestCase): args=['--dry-run', 'flash'], standalone_mode=False, ) - self.assertEqual(['all', 'flash'], list(result.keys())) + self.assertEqual(['flash'], list(result.keys())) def test_order_only_dependencies(self): result = idf.init_cli()( @@ -105,7 +105,7 @@ class TestDependencyManagement(unittest.TestCase): args=['--dry-run', 'clean', 'monitor', 'clean', 'fullclean', 'flash'], standalone_mode=False, ) - self.assertEqual(['fullclean', 'clean', 'all', 'flash', 'monitor'], list(result.keys())) + self.assertEqual(['fullclean', 'clean', 'flash', 'monitor'], list(result.keys())) def test_dupplicated_commands_warning(self): capturedOutput = StringIO()