Fix sdk version constraint to no longer be pre-release (#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.
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 @@
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 @@
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