Skip to content

Commit

Permalink
Stage plugin env script
Browse files Browse the repository at this point in the history
  • Loading branch information
MonicaisHer committed Mar 7, 2024
1 parent f1c69bb commit b7b4663
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions snapcraft/parts/plugins/matter_sdk_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ def get_build_commands(self) -> List[str]:
]
)

# Prepend the Matter SDK related PATH to the beginning of the PATH environment variable
# and save it to the matter-sdk-env.sh file
# Prepend the Matter SDK related PATH to the beginning of the PATH environment variable,
# and save it to the staging area as matter-sdk-env.sh file.
commands.extend(
[
'echo "export PATH=$MATTER_SDK_PATHS\\$PATH" >> matter-sdk-env.sh',
'echo "export PATH=$MATTER_SDK_PATHS\\$PATH" >> $CRAFT_STAGE/matter-sdk-env.sh',
]
)

Expand Down
2 changes: 1 addition & 1 deletion tests/spread/plugins/craft-parts/matter-sdk/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ parts:
after: [matter-sdk]
override-build: |
# Source the Matter SDK environment variables
source ../../matter-sdk/build/matter-sdk-env.sh
source $CRAFT_STAGE/matter-sdk-env.sh
# Build the lighting app for snapcraft spread testing purposes
cd ../../matter-sdk/build/examples/lighting-app/linux
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/parts/plugins/test_matter_sdk_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_get_build_commands(part_info):
"set +u && source scripts/setup/bootstrap.sh --platform build && set -u",
"echo 'Built Matter SDK'",
'MATTER_SDK_PATHS="${PATH%$OLD_PATH}"',
'echo "export PATH=$MATTER_SDK_PATHS\\$PATH" >> matter-sdk-env.sh',
'echo "export PATH=$MATTER_SDK_PATHS\\$PATH" >> $CRAFT_STAGE/matter-sdk-env.sh',
]

assert plugin.get_build_commands() == expected_commands

0 comments on commit b7b4663

Please sign in to comment.