Files
sdk/tools/bots/flutter/analyze_flutter_packages.sh
T
Jason Simmons 7533d042bf Specify the base branch when running "flutter_plugin_tools analyze"
flutter_plugin_tools is now querying FETCH_HEAD by default after the changes in https://github.com/flutter/packages/commit/8c287e99d62396402f9a8eb89d9704a5ba6cb8c0

This causes issues for the analyze_flutter_packages.sh script, which creates a clone of the flutter/packages repository that does not have a FETCH_HEAD.

With the --base-branch flag flutter_plugin_tools will instead query the head of the main branch.

Change-Id: I5aa69b80789fdf85497974cf29d25a66166ddc3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418200
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-03-27 02:12:21 -07:00

46 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2021, 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.
# Analyze Dart code in the flutter/packages repo.
set -e
checkout=$(pwd)
export PATH=$checkout/out/ReleaseX64/dart-sdk/bin:$PATH
dart=$checkout/out/ReleaseX64/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"
# install flutter
git clone --single-branch -vv https://github.com/flutter/flutter
export PATH="$PATH":"$tmpdir/flutter/bin"
flutter --version
# get the flutter/packages repo
git clone --single-branch -vv https://github.com/flutter/packages
cd packages
# validate the tool's source
(cd script/tool; dart pub --suppress-analytics get)
(cd script/tool; dart analyze --suppress-analytics --fatal-infos)
# Invoke the repo's analysis script.
# Use --downgrade to avoid potential breakage from transitive
# dependency publishing. See
# https://github.com/flutter/flutter/issues/129633
dart run script/tool/bin/flutter_plugin_tools.dart analyze \
--downgrade \
--analysis-sdk $sdk \
--custom-analysis=script/configs/custom_analysis.yaml \
--base-branch=main