Support Dart 2, prepare to release 1.0.2 (#4)
Closes https://github.com/kseo/tuple/pull/3
diff --git a/.analysis_options b/.analysis_options
deleted file mode 100644
index a10d4c5..0000000
--- a/.analysis_options
+++ /dev/null
@@ -1,2 +0,0 @@
-analyzer:
- strong-mode: true
diff --git a/.gitignore b/.gitignore
index c944841..9093f83 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,28 +1,6 @@
-# https://www.dartlang.org/tools/private-files.html
-
-pubspec.lock
-
-build/
+# https://www.dartlang.org/guides/libraries/private-files
.packages
-packages
-
.pub
-doc
-
-.buildlog
-*.js_
-*.js.deps
-*.js.map
-*.dart.js
-
-# Eclipse
-.project
-
-# IntelliJ
-*.iml
-*.ipr
-*.iws
-.idea/
-
-# Mac
-.DS_Store
+.dart_tool
+packages
+pubspec.lock
diff --git a/.travis.yml b/.travis.yml
index a4a70c4..9c21886 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,24 @@
language: dart
-sudo: false
+
dart:
- stable
- dev
-script: ./tool/travis.sh
-env:
- - DARTANALYZER_FLAGS=--fatal-warnings
+ - 1.24.3
+
+dart_task:
+ - test:
+ - dartanalyzer
+
+matrix:
+ include:
+ # Only validate formatting using the dev release
+ - dart: dev
+ dart_task: dartfmt
+
+# Only building master means that we don't run two builds for each pull request.
+branches:
+ only: [master]
+
+cache:
+ directories:
+ - $HOME/.pub-cache
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 77d2a47..7945d6f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+#### 1.0.2
+ * Prepare for Dart 2 stable.
+
#### 1.0.1
* Fix all strong-mode warnings and errors.
diff --git a/README.md b/README.md
index 61c0db1..e5d8f1c 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,4 @@
-# Tuple data structure
-
-- [Tuple2], [Tuple3]...
-
-[![Build Status](https://travis-ci.org/kseo/tuple.svg)](https://travis-ci.org/kseo/tuple)
-[![Coverage Status](https://coveralls.io/repos/kseo/tuple/badge.svg?branch=master&service=github)](https://coveralls.io/github/kseo/tuple?branch=master)
+[![Build Status](https://travis-ci.org/dart-lang/tuple.svg)](https://travis-ci.org/dart-lang/tuple/)
## Usage example
diff --git a/lib/src/tuple.dart b/lib/src/tuple.dart
index 2dace3f..13c89d3 100644
--- a/lib/src/tuple.dart
+++ b/lib/src/tuple.dart
@@ -166,7 +166,8 @@
String toString() => '[$item1, $item2, $item3, $item4]';
@override
- bool operator ==(o) => o is Tuple4 &&
+ bool operator ==(o) =>
+ o is Tuple4 &&
o.item1 == item1 &&
o.item2 == item2 &&
o.item3 == item3 &&
@@ -243,7 +244,8 @@
String toString() => '[$item1, $item2, $item3, $item4, $item5]';
@override
- bool operator ==(o) => o is Tuple5 &&
+ bool operator ==(o) =>
+ o is Tuple5 &&
o.item1 == item1 &&
o.item2 == item2 &&
o.item3 == item3 &&
@@ -342,7 +344,8 @@
String toString() => '[$item1, $item2, $item3, $item4, $item5, $item6]';
@override
- bool operator ==(o) => o is Tuple6 &&
+ bool operator ==(o) =>
+ o is Tuple6 &&
o.item1 == item1 &&
o.item2 == item2 &&
o.item3 == item3 &&
@@ -459,7 +462,8 @@
'[$item1, $item2, $item3, $item4, $item5, $item6, $item7]';
@override
- bool operator ==(o) => o is Tuple7 &&
+ bool operator ==(o) =>
+ o is Tuple7 &&
o.item1 == item1 &&
o.item2 == item2 &&
o.item3 == item3 &&
diff --git a/pubspec.yaml b/pubspec.yaml
index d60177c..36ead8e 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,13 +1,17 @@
name: tuple
-version: 1.0.1
+version: 1.0.2
authors:
+- Dart Team <misc@dartlang.org>
- Boris Kaul <localvoid@gmail.com>
- Kwang Yul Seo <kwangyul.seo@gmail.com>
description: Tuple data structure
-homepage: https://github.com/kseo/tuple
+homepage: https://github.com/dart-lang/tuple
+
environment:
- sdk: '>=1.6.0'
+ sdk: '>=1.6.0 <3.0.0'
+
dependencies:
- quiver: '>=0.22.0 <0.23.0'
+ quiver: '>=0.22.0 <3.0.0'
+
dev_dependencies:
- test: any
+ test: '>=0.12.0 <2.0.0'
diff --git a/test/tuple_test.dart b/test/tuple_test.dart
index 4bbe0cf..18b251c 100644
--- a/test/tuple_test.dart
+++ b/test/tuple_test.dart
@@ -26,8 +26,10 @@
expect(t1.item1, equals(1));
expect(t1.item2, equals(true));
- expect(() => new Tuple2.fromList([1]), throwsA(new isInstanceOf<ArgumentError>()));
- expect(() => new Tuple2.fromList([1, true, 'a']), throwsA(new isInstanceOf<ArgumentError>()));
+ expect(() => new Tuple2.fromList([1]),
+ throwsA(new isInstanceOf<ArgumentError>()));
+ expect(() => new Tuple2.fromList([1, true, 'a']),
+ throwsA(new isInstanceOf<ArgumentError>()));
});
test('equality', () {
diff --git a/tool/travis.sh b/tool/travis.sh
deleted file mode 100755
index 61c101b..0000000
--- a/tool/travis.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) 2015, Google Inc. 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.
-
-# Fast fail the script on failures.
-set -e
-
-# Verify that the libraries are error and warning-free.
-echo "Running dartanalyzer..."
-libs=$(find lib -maxdepth 1 -type f -name '*.dart')
-dartanalyzer $DARTANALYZER_FLAGS $libs test/all_tests.dart
-
-# Run the tests.
-echo "Running tests..."
-pub run test:test
-
-# Gather and send coverage data.
-if [ "$REPO_TOKEN" ] && [ "$TRAVIS_DART_VERSION" = "stable" ]; then
- echo "Collecting coverage..."
- pub global activate dart_coveralls
- pub global run dart_coveralls report \
- --token $REPO_TOKEN \
- --retry 2 \
- --exclude-test-files \
- test/all_tests.dart
-fi