From 76fa675a3081c39e013fe41a2b5470876469110f Mon Sep 17 00:00:00 2001 From: Mengyi Wang Date: Tue, 12 Dec 2023 15:45:05 +0100 Subject: [PATCH] Add comments for Matter SDK building related commands --- snapcraft/parts/plugins/matter_plugin.py | 20 +++++++++++++++----- snapcraft/parts/plugins/register.py | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/snapcraft/parts/plugins/matter_plugin.py b/snapcraft/parts/plugins/matter_plugin.py index 78cb79c202..52513c7392 100644 --- a/snapcraft/parts/plugins/matter_plugin.py +++ b/snapcraft/parts/plugins/matter_plugin.py @@ -124,14 +124,24 @@ def get_build_commands(self) -> List[str]: ] ) + """Clone Matter repository if not present""" + commands.extend( + [ + f"if [ ! -d matter ]; then git clone --depth 1 -b v1.2.0.1 {MATTER_REPO} matter && cd matter; " + f"else cd matter || echo 'skip clone'; fi" + ] + ) + + """Checkout submodules for Linux platform""" + commands.extend(["scripts/checkout_submodules.py --shallow --platform linux"]) + + """Bootstrapping script for building Matter SDK and setting up the environment""" + commands.extend(["set +u && source setup/bootstrap.sh && set -u"]) + commands.extend( [ - f"if [ ! -d matter ]; then git clone --depth 1 -b v1.2.0.1 {MATTER_REPO} matter; fi", - "cd matter || echo 'skip clone'", - f"scripts/checkout_submodules.py --shallow --platform linux", - f"set +u && source scripts/activate.sh && set -u", "cp -vr ./* $CRAFT_PART_INSTALL/", - "echo 'Cloned Matter repository and activated submodules'", + "echo 'Cloned Matter repository and built Matter SDK'", ] ) diff --git a/snapcraft/parts/plugins/register.py b/snapcraft/parts/plugins/register.py index f1385330ac..f94a873595 100644 --- a/snapcraft/parts/plugins/register.py +++ b/snapcraft/parts/plugins/register.py @@ -30,6 +30,7 @@ def register() -> None: """Register Snapcraft plugins.""" craft_parts.plugins.register({"colcon": ColconPlugin}) craft_parts.plugins.register({"conda": CondaPlugin}) - craft_parts.plugins.register({"matter": MatterPlugin}) + craft_parts.plugins.register({"flutter": FlutterPlugin}) craft_parts.plugins.register({"python": PythonPlugin}) craft_parts.plugins.register({"kernel": KernelPlugin}) + craft_parts.plugins.register({"matter": MatterPlugin})