Skip to content

Commit 396db1f

Browse files
authored
Fix sdk version constraint to no longer be pre-release (dart-archive/platform#34)
Fixed the Dart SDK constraint to no longer be a pre-release constraint (i.e. 2.12.0 instead of 2.12.0-0). Also, added a pre-commit publish check.
1 parent 768a096 commit 396db1f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

pkgs/platform/dev/travis.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,34 @@
55

66
# Make sure dartfmt is run on everything
77
echo "Checking dart format..."
8-
needs_dartfmt="$(dart format --set-exit-if-changed --output=none lib test dev)"
8+
needs_dart_format="$(dart format --set-exit-if-changed --output=none lib test dev 2>&1)"
99
if [[ $? != 0 ]]; then
1010
echo "FAILED"
11-
echo "$needs_dartfmt"
11+
echo "$needs_dart_format"
1212
exit 1
1313
fi
1414
echo "PASSED"
1515

1616
# Make sure we pass the analyzer
1717
echo "Checking dartanalyzer..."
18-
fails_analyzer="$(find lib test dev -name "*.dart" | xargs dartanalyzer --options analysis_options.yaml)"
18+
fails_analyzer="$(find lib test dev -name "*.dart" --print0 | xargs -0 dartanalyzer --options analysis_options.yaml 2>&1)"
1919
if [[ "$fails_analyzer" == *"[error]"* ]]; then
2020
echo "FAILED"
2121
echo "$fails_analyzer"
2222
exit 1
2323
fi
2424
echo "PASSED"
2525

26+
# Make sure we could publish if we wanted to.
27+
echo "Checking publishing..."
28+
fails_publish="$(pub publish --dry-run 2>&1)"
29+
if [[ $? != 0 ]]; then
30+
echo "FAILED"
31+
echo "$fails_publish"
32+
exit 1
33+
fi
34+
echo "PASSED"
35+
2636
# Fast fail the script on failures.
2737
set -e
2838

pkgs/platform/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A pluggable, mockable platform abstraction for Dart.
44
homepage: https://github.com/google/platform.dart
55

66
environment:
7-
sdk: '>=2.12.0-0 <3.0.0'
7+
sdk: '>=2.12.0 <3.0.0'
88

99
dev_dependencies:
1010
test: ^1.16.8

0 commit comments

Comments
 (0)