Let binary task generation optionally insert a build task and make
install/deploy depend on it. Cargo builds outside BitBake, so this ordering
ensures its artifacts exist before do_install and deploy-target run.

AI-Generated: Uses GitHub Copilot
Signed-off-by: Enguerrand de Ribaucourt 
<[email protected]>
---
 scripts/lib/devtool/ide_plugins/ide_code.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py 
b/scripts/lib/devtool/ide_plugins/ide_code.py
index b5ff344e8a..80314bfb89 100644
--- a/scripts/lib/devtool/ide_plugins/ide_code.py
+++ b/scripts/lib/devtool/ide_plugins/ide_code.py
@@ -674,7 +674,7 @@ class IdeVSCode(IdeBase):
         IdeBase.update_json_file(
             self.dot_code_dir(modified_recipe), launch_file, launch_dict)
 
-    def vscode_tasks_binary(self, args, image_recipe, modified_recipe):
+    def vscode_tasks_binary(self, args, image_recipe, modified_recipe, 
build_task=None):
         run_install_deploy = modified_recipe.gen_install_deploy_script(args, 
image_recipe.nfs_deploy_dir)
         install_task_name = "install && deploy-target %s" % 
modified_recipe.recipe_id_pretty
         deploy_args = ["--target", resolve_deploy_target(args, 
image_recipe.nfs_deploy_dir)]
@@ -689,9 +689,21 @@ class IdeVSCode(IdeBase):
             "args": deploy_args,
             "problemMatcher": []
         }
+        tasks = [build_task] if build_task else []
+        install_task = {
+            "label": install_task_name,
+            "type": "shell",
+            "command": run_install_deploy,
+            "args": deploy_args,
+            "problemMatcher": []
+        }
+        if build_task:
+            install_task["dependsOn"] = [build_task["label"]]
+            install_task["dependsOrder"] = "sequence"
+        tasks.append(install_task)
         tasks_dict = {
             "version": "2.0.0",
-            "tasks": [install_task]
+            "tasks": tasks
         }
         for cross_debug_config in self.cross_debug_configs:
             if cross_debug_config.modified_recipe is not modified_recipe:

-- 
2.53.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#248648): 
https://lists.openembedded.org/g/openembedded-core/message/248648
Mute This Topic: https://lists.openembedded.org/mt/121938791/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to