build.mjs 552 B

123456789101112131415161718192021
  1. #!/usr/bin/env zx
  2. import 'zx/globals';
  3. import {
  4. cliArguments,
  5. getProgramFolders,
  6. workingDirectory,
  7. } from '../utils.mjs';
  8. // Save external programs binaries to the output directory.
  9. import './dump.mjs';
  10. // Configure additional arguments here, e.g.:
  11. // ['--arg1', '--arg2', ...cliArguments()]
  12. const buildArgs = cliArguments();
  13. // Build the programs.
  14. for (const folder of getProgramFolders()) {
  15. const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
  16. await $`cargo-build-sbf --manifest-path ${manifestPath} ${buildArgs}`;
  17. }