From 019319893d507d0a199da1c2c63ce7ade426edd9 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Mon, 16 Aug 2021 16:05:56 -0700 Subject: [PATCH] Fix sdk version constraint to no longer be pre-release, add travis check for publishing --- dev/travis.sh | 16 +++++++++++++--- pubspec.yaml | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dev/travis.sh b/dev/travis.sh index a805dbd..03d489c 100755 --- a/dev/travis.sh +++ b/dev/travis.sh @@ -5,17 +5,17 @@ # Make sure dartfmt is run on everything echo "Checking dart format..." -needs_dartfmt="$(dart format --set-exit-if-changed --output=none lib test dev)" +needs_dart_format="$(dart format --set-exit-if-changed --output=none lib test dev 2>&1)" if [[ $? != 0 ]]; then echo "FAILED" - echo "$needs_dartfmt" + echo "$needs_dart_format" exit 1 fi echo "PASSED" # Make sure we pass the analyzer echo "Checking dartanalyzer..." -fails_analyzer="$(find lib test dev -name "*.dart" | xargs dartanalyzer --options analysis_options.yaml)" +fails_analyzer="$(find lib test dev -name "*.dart" --print0 | xargs -0 dartanalyzer --options analysis_options.yaml 2>&1)" if [[ "$fails_analyzer" == *"[error]"* ]]; then echo "FAILED" echo "$fails_analyzer" @@ -23,6 +23,16 @@ if [[ "$fails_analyzer" == *"[error]"* ]]; then fi echo "PASSED" +# Make sure we could publish if we wanted to. +echo "Checking publishing..." +fails_publish="$(pub publish --dry-run 2>&1)" +if [[ $? != 0 ]]; then + echo "FAILED" + echo "$fails_publish" + exit 1 +fi +echo "PASSED" + # Fast fail the script on failures. set -e diff --git a/pubspec.yaml b/pubspec.yaml index de10923..efe79e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ description: A pluggable, mockable platform abstraction for Dart. homepage: https://github.com/google/platform.dart environment: - sdk: '>=2.12.0-0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dev_dependencies: test: ^1.16.8