#!/usr/bin/env bash
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

# Runs flutter's analyzer related tests with a locally built SDK.
set -e

dart=$(pwd)/tools/sdks/dart-sdk/bin/dart
sdk=$(pwd)/out/ReleaseX64/dart-sdk
tmpdir=$(mktemp -d)
cleanup() {
  rm -rf "$tmpdir"
}
trap cleanup EXIT HUP INT QUIT TERM PIPE
cd "$tmpdir"

git clone -vv https://chromium.googlesource.com/external/github.com/flutter/flutter

cd flutter

bin/flutter config --no-analytics
bin/flutter update-packages

$dart dev/bots/analyze.dart --dart-sdk $sdk

#!/usr/bin/env bash
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

# Runs flutter's analyzer related tests with a locally built SDK.
set -e

checkout=$(pwd)
dart=$checkout/tools/sdks/dart-sdk/bin/dart
sdk=$checkout/out/ReleaseX64/dart-sdk
tmpdir=$(mktemp -d)
cleanup() {
  rm -rf "$tmpdir"
}
trap cleanup EXIT HUP INT QUIT TERM PIPE
cd "$tmpdir"

git clone -vv https://chromium.googlesource.com/external/github.com/flutter/flutter

cd flutter

bin/flutter config --no-analytics

pinned_dart_sdk=$(cat bin/cache/dart-sdk/revision)
patch=$checkout/tools/patches/flutter-engine/${pinned_dart_sdk}.flutter.patch
if [ -e "$patch" ]; then
  git apply $patch
fi

bin/flutter update-packages

$dart dev/bots/analyze.dart --dart-sdk $sdk

Apply flutter patches in flutter-analyze builds as well
[infra] Apply flutter patches in flutter-analyze builds as well

Change-Id: Ibc4b4f1267ee533040cf81d940395af1985a3b76
Reviewed-on: https://dart-review.googlesource.com/c/85386
Reviewed-by: Paul Berry <72d414e3a99fb120308437779d51667bcc0984eb@google.com>
