awaitBuild method

Future<AppStoreBuild> awaitBuild(
  1. String buildNumber, {
  2. Duration timeout = const Duration(minutes: 45),
  3. Duration poll = const Duration(seconds: 30),
  4. void onProgress(
    1. BuildProcessingProgress progress
    )?,
})

Waits until Apple has finished processing buildNumber.

What cux_ship appstore wait does, without the printing: onProgress is called once per poll — including the poll that ends the wait — so a caller streaming to a log can write its own heartbeat rather than scraping one. Passing no onProgress waits silently.

Throws ProcessingTimeout when timeout runs out, and AscApiException when Apple reports FAILED or INVALID.

Implementation

Future<AppStoreBuild> awaitBuild(
  String buildNumber, {
  Duration timeout = const Duration(minutes: 45),
  Duration poll = const Duration(seconds: 30),
  void Function(BuildProcessingProgress progress)? onProgress,
}) async {
  final build = await _store.awaitProcessing(
    _app,
    buildNumber,
    timeout: timeout,
    poll: poll,
    onProgress: onProgress ?? (_) {},
  );
  return appStoreBuildFrom(build);
}