From f936bfd7176c23e71183317b4f8844d92b9e746e Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 26 Jul 2025 11:17:30 +0200 Subject: 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. --- meson.build | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'meson.build') 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, +) -- cgit v1.2.3-70-g09d2