diff options
author | xengineering <me@xengineering.eu> | 2025-07-26 11:17:30 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2025-07-26 19:01:25 +0200 |
commit | f936bfd7176c23e71183317b4f8844d92b9e746e (patch) | |
tree | 5d8f6a9afc47936f82bce79c210721c1f8d5441f | |
parent | 834dacb9ffaead63b626489d22aab2f8263e9f16 (diff) | |
download | iot-contact-f936bfd7176c23e71183317b4f8844d92b9e746e.tar iot-contact-f936bfd7176c23e71183317b4f8844d92b9e746e.tar.zst iot-contact-f936bfd7176c23e71183317b4f8844d92b9e746e.zip |
Provide tar archive as main build result
This generates `build/iot-contact.tar.zst` as primary build artifact. It
contains all artifacts which should be deployed. Providing this as file
archive makes further handling more easy.
-rw-r--r-- | meson.build | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/meson.build b/meson.build index dcc0fe2..8e2d91c 100644 --- a/meson.build +++ b/meson.build @@ -1,10 +1,10 @@ project('iot-contact') -cp = find_program('cp', required : true) +tar = find_program('tar', required : true) fs = import('fs') -fs.copyfile(meson.current_source_dir() / 'simple.css' / 'simple.css') +css = fs.copyfile(meson.current_source_dir() / 'simple.css' / 'simple.css') subdir('tools') subdir('fw') @@ -13,6 +13,7 @@ subdir('web') artifacts = [ index_html, + css, schematic, bom, simulation, @@ -21,15 +22,20 @@ artifacts = [ kicad_pcb, ] -foreach artifact : artifacts - custom_target( - output: [fs.name(artifact.full_path())], - command: [ - cp, - artifact.full_path(), - meson.current_build_dir(), - ], - depends: artifact, - build_by_default: true, - ) -endforeach +custom_target( + output: meson.project_name() + '.tar.zst', + command: [ + tar, + '--zstd', + '--transform=s|^fw/app/||', + '--transform=s|^fw/sim/||', + '--transform=s|^fw/||', + '--transform=s|^pcb/||', + '--transform=s|^web/||', + '--transform=s|^|' + meson.project_name() + '/|', + '-cf', '@OUTPUT@', + artifacts, + ], + depends: artifacts, + build_by_default: true, +) |