Class: FastlaneCore::BuildWatcher

Inherits:
Object
  • Object
show all
Defined in:
fastlane_core/lib/fastlane_core/build_watcher.rb

Class Method Summary collapse

Class Method Details

.wait_for_build_processing_to_be_complete(app_id: nil, platform: nil, train_version: nil, build_version: nil, poll_interval: 10, strict_build_watch: false) ⇒ Object

Returns The build we waited for. This method will always return a build.

Returns:

  • The build we waited for. This method will always return a build



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'fastlane_core/lib/fastlane_core/build_watcher.rb', line 9

def wait_for_build_processing_to_be_complete(app_id: nil, platform: nil, train_version: nil, build_version: nil, poll_interval: 10, strict_build_watch: false)
  unless strict_build_watch
    # First, find the train and build version we want to watch for
    watched_build = watching_build(app_id: app_id, platform: platform)
    UI.crash!("Could not find a build for app: #{app_id} on platform: #{platform}") if watched_build.nil?

    unless watched_build.train_version == train_version && watched_build.build_version == build_version
      UI.important("Started watching build #{watched_build.train_version} - #{watched_build.build_version} but expected #{train_version} - #{build_version}")
    end
    train_version = watched_build.train_version
    build_version = watched_build.build_version
  end

  loop do
    matched_build = matching_build(watched_train_version: train_version, watched_build_version: build_version, app_id: app_id, platform: platform)

    report_status(build: matched_build)

    if matched_build && matched_build.processed?
      return matched_build
    end

    sleep(poll_interval)
  end
end