build.mjs 583 B

1234567891011121314151617181920212223
  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. await Promise.all(
  15. getProgramFolders().map(async (folder) => {
  16. const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
  17. await $`cargo-build-sbf --manifest-path ${manifestPath} ${buildArgs}`;
  18. })
  19. );