#!/bin/bash
# Be sure to set $NINJA and $GN env vars correctly before running this script.
CARGO_TEST="cargo test -vv --all"
# First we run cargo test, to make sure everything is built.
||
# If we run cargo test again, we should not rebuild.
| &&
| &&
# Rebuild if we touch an explicitly listed source file
| ||
# Rebuild If we touch the input to an action
| ||
# Rebuild if we touch a header file not directly listed in the BUILD.gn
| ||
# TODO(ry) Rebuild if we touch a BUILD.gn file.
# touch example/BUILD.gn
# $CARGO_TEST | grep "gen ." || exit 45