blob: ef594a9d728407b230903e8fa089c9dc48fb96c2 [file] [log] [blame]
Ian Hickson449f4a62019-11-27 15:04:02 -08001#!/usr/bin/env bash
2# Copyright 2014 The Flutter Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
TL Leee2167b92018-09-06 17:16:22 -04005
6set -ex
7
8readonly SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9readonly ROOT_DIR="$SCRIPTS_DIR/.."
10
11function is_expected_failure() {
12 # A test target was specified with the 'build' command.
13 grep --quiet "is not configured for Running" "$1"
14}
15
16log_file="build_log_for_104_complete.txt"
17build_command="flutter build bundle"
18
19# Attempt to build 104-complete Shrine app from the Flutter codelabs
20git clone https://github.com/material-components/material-components-flutter-codelabs.git
21cd material-components-flutter-codelabs/mdc_100_series/
22git checkout 104-complete
23
24all_builds_ok=1
25echo "$build_command"
26$build_command 2>&1 | tee "$log_file"
27
28if [ ${PIPESTATUS[0]} -eq 0 ] || is_expected_failure "$log_file"; then
29 rm "$log_file"
30else
31 all_builds_ok=0
32 echo "View https://github.com/flutter/flutter/blob/master/dev/bots/README.md for steps to resolve this failed build test." >> ${log_file}
33 echo
34 echo "Log left in $log_file."
35 echo
36fi
37
38# If any build failed, exit with a failure exit status so continuous integration
39# tools can react appropriately.
40if [ "$all_builds_ok" -eq 1 ]; then
41 exit 0
42else
43 exit 1
44fi