#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail

# Use the Bazel binary specified by the integration test. Otherwise, fall back
# to bazel.
bazel="${BIT_BAZEL_BINARY:-bazel}"

# Generate Swift external deps and update build files
"${bazel}" run //:tidy

# Ensure that it builds
"${bazel}" build //...

# Run the example binary to verify it works
"${bazel}" run //Sources/GRDBExample

# This example is run for MacOS and Linux. Run //:update_swift_packages to
# ensure that it works on both platforms.
"${bazel}" run //:update_swift_packages
