Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion packages/pigeon/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
# exit when any command fails
set -ex

JAVA_LINTER=checkstyle-8.41-all.jar

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just extract the version rather than the file name? The version is still hardcoded in the url path below

JAVA_FORMATTER=google-java-format-1.3-all-deps.jar
GOOGLE_CHECKS=google_checks.xml

# TODO(blasten): Enable on stable when possible.
# https://github.com/flutter/flutter/issues/75187
if [[ "$CHANNEL" == "stable" ]]; then
Expand Down Expand Up @@ -76,6 +80,9 @@ test_pigeon_android() {
exit 1
fi

java -jar $JAVA_FORMATTER $temp_dir/Pigeon.java > $temp_dir/Pigeon.java
java -jar $JAVA_LINTER -c $GOOGLE_CHECKS $temp_dir/Pigeon.java

dartfmt -w $temp_dir/pigeon.dart
dartanalyzer $temp_dir/pigeon.dart --fatal-infos --fatal-warnings --packages ./e2e_tests/test_objc/.packages

Expand All @@ -98,11 +105,25 @@ test_null_safe_dart() {
rm -rf $temp_dir
}

###############################################################################
# Get java linter / formatter
###############################################################################
if [ ! -f "$JAVA_LINTER" ]; then
curl -L https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.41/$JAVA_LINTER > $JAVA_LINTER
fi
if [ ! -f "$JAVA_FORMATTER" ]; then
curl -L https://github.com/google/google-java-format/releases/download/google-java-format-1.3/$JAVA_FORMATTER > $JAVA_FORMATTER
fi
if [ ! -f "$GOOGLE_CHECKS" ]; then
curl -L https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/$GOOGLE_CHECKS > $GOOGLE_CHECKS
fi

###############################################################################
# Dart analysis and unit tests
###############################################################################
pub get
dartanalyzer bin lib
dart analyze bin
dart analyze lib
pub run test test/

###############################################################################
Expand Down