Skip to content

Commit

Permalink
use a separate directory for each of the samples
Browse files Browse the repository at this point in the history
  • Loading branch information
wsipak committed Oct 30, 2023
1 parent cc8ada2 commit 806ff37
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def build_copy_sample(platform: str, sample_name: str, sample_path: str, args: s
tuple: A tuple containing the return code (0 for success, 1 for failure)
and the output of the 'west build' command
"""
project_sample_name = f"{platform}-{sample_name}"
project_sample_name = f"{platform}/{sample_name}"
return_code = 1

# Create the build directory if it doesn't exist
Expand All @@ -70,7 +70,7 @@ def build_copy_sample(platform: str, sample_name: str, sample_path: str, args: s
if os.path.isdir(build_path):
shutil.rmtree(build_path)

log_path = f"../../build/{project_sample_name}/{project_sample_name}-zephyr.log"
log_path = f"../../build/{project_sample_name}/{sample_name}-zephyr.log"

# Build sample and collect SPDX data
run_west_cmd(f"west spdx --init -d {build_path}", log_path)
Expand Down Expand Up @@ -179,7 +179,7 @@ def main(board_name: str, sample_name: str) -> None:
"""

sample_path = get_sample_path(sample_name)
os.makedirs(f"build/{board_name}-{sample_name}", exist_ok=True)
os.makedirs(f"build/{board_name}/{sample_name}", exist_ok=True)

config_path = f"configs/{sample_name}.conf"
if os.path.exists(config_path):
Expand Down
24 changes: 12 additions & 12 deletions zephyr.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
project_path: "zephyrproject/zephyr"

artifact_prefix: "build/{board_name}-{sample_name}/"
artifact_prefix: "build/{board_name}/{sample_name}/"
artifact_names:
build-log: "{board_name}-{sample_name}-zephyr.log"
config: "{board_name}-{sample_name}-config"
dts: "{board_name}-{sample_name}.dts"
elf: "{board_name}-zephyr-{sample_name}.elf"
elf-md5: "{board_name}-zephyr-{sample_name}.elf.md5"
sbom-app: "{board_name}-{sample_name}-app.spdx"
sbom-build: "{board_name}-{sample_name}-build.spdx"
sbom-zephyr: "{board_name}-{sample_name}-zephyr.spdx"
zip-sbom: "{board_name}-{sample_name}-sbom.zip"
zip-all: "{board_name}-{sample_name}-all.zip"
result: "{board_name}-{sample_name}-result.json"
build-log: "{sample_name}-zephyr.log"
config: "{sample_name}-config"
dts: "{sample_name}.dts"
elf: "zephyr-{sample_name}.elf"
elf-md5: "zephyr-{sample_name}.elf.md5"
sbom-app: "{sample_name}-app.spdx"
sbom-build: "{sample_name}-build.spdx"
sbom-zephyr: "{sample_name}-zephyr.spdx"
zip-sbom: "{sample_name}-sbom.zip"
zip-all: "{sample_name}-all.zip"
result: "{sample_name}-result.json"

# The path is relative to `zephyr/samples`
samples:
Expand Down

0 comments on commit 806ff37

Please sign in to comment.