From 8ab229f89c24d6dd0207029185a9573aa808cefe Mon Sep 17 00:00:00 2001 From: Hixie Date: Thu, 12 Nov 2015 14:24:40 -0800 Subject: [PATCH] Make the analyzer actually work. Turns out that ignoring all error lines that match the empty string is a poor way to go. Also, we have to update all the example packages now too, since we analyze them. So just have travis use our update script. Also, remove flutter_tools' old travis stuff. It's now part of a bigger repo. Also, make travis use the dev Dart SDK, since we need the new analyzer. Stable is way too out of date, e.g. it still complains about libraries not having names and mixins using 'super', and the strong mode hints are even more aggressive than on dev. --- .travis.yml | 2 +- .../lib/src/commands/analyze.dart | 7 +++---- packages/flutter_tools/tool/travis.sh | 18 ------------------ packages/unit/test/widget/widget_tester.dart | 2 +- travis/setup.sh | 11 +---------- 5 files changed, 6 insertions(+), 34 deletions(-) delete mode 100755 packages/flutter_tools/tool/travis.sh diff --git a/.travis.yml b/.travis.yml index 6d38aa0d41f..d96fb9fd7b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: dart sudo: false dart: - - stable + - dev addons: apt: sources: diff --git a/packages/flutter_tools/lib/src/commands/analyze.dart b/packages/flutter_tools/lib/src/commands/analyze.dart index af4b7f40375..519216c1c53 100644 --- a/packages/flutter_tools/lib/src/commands/analyze.dart +++ b/packages/flutter_tools/lib/src/commands/analyze.dart @@ -140,9 +140,8 @@ class AnalyzeCommand extends FlutterCommand { // prepare a Dart file that references all the above Dart files StringBuffer mainBody = new StringBuffer(); - for (int index = 0; index < dartFiles.length; index += 1) { + for (int index = 0; index < dartFiles.length; index += 1) mainBody.writeln('import \'${path.normalize(path.absolute(dartFiles[index]))}\' as file$index;'); - } mainBody.writeln('void main() { }'); // prepare a union of all the .packages files @@ -243,8 +242,8 @@ class AnalyzeCommand extends FlutterCommand { new RegExp('^\\[error\\] Target of URI does not exist: \'dart:ui_internals\''), // https://github.com/flutter/flutter/issues/83 new RegExp(r'\[lint\] Prefer using lowerCamelCase for constant names.'), // sometimes we have no choice (e.g. when matching other platforms) new RegExp(r'\[lint\] Avoid defining a one-member abstract class when a simple function will do.'), // too many false-positives; code review should catch real instances - new RegExp(r'\[0-9]+ (error|warning|hint|lint).+found\.'), - '', + new RegExp(r'[0-9]+ (error|warning|hint|lint).+found\.'), + new RegExp(r'^$'), ]; RegExp generalPattern = new RegExp(r'^\[(error|warning|hint|lint)\] (.+) \(([^(),]+), line ([0-9]+), col ([0-9]+)\)$'); diff --git a/packages/flutter_tools/tool/travis.sh b/packages/flutter_tools/tool/travis.sh deleted file mode 100755 index ed16ec2999e..00000000000 --- a/packages/flutter_tools/tool/travis.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Chromium Authors. 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 - -# Fetch all our dependencies -pub get - -# Verify that the libraries are error free. -pub global activate tuneup -pub global run tuneup check - -# And run our tests. -pub run test -j1 diff --git a/packages/unit/test/widget/widget_tester.dart b/packages/unit/test/widget/widget_tester.dart index 02f714deae4..43e9bb23fa7 100644 --- a/packages/unit/test/widget/widget_tester.dart +++ b/packages/unit/test/widget/widget_tester.dart @@ -144,7 +144,7 @@ class WidgetTester { _dispatchEvent(p.up(), result); } - void fling(Element element, Offset offset, velocity, { int pointer: 1 }) { + void fling(Element element, Offset offset, double velocity, { int pointer: 1 }) { flingFrom(getCenter(element), offset, velocity, pointer: pointer); } diff --git a/travis/setup.sh b/travis/setup.sh index ffee1b8518f..97c3458ba9b 100755 --- a/travis/setup.sh +++ b/travis/setup.sh @@ -1,15 +1,6 @@ #!/bin/bash set -ex -pub global activate tuneup - -(cd packages/cassowary; pub get) -(cd packages/flutter_sprites; pub get) -(cd packages/flutter_tools; pub get) -(cd packages/flx; pub get) -(cd packages/newton; pub get) -(cd packages/playfair; pub get) -(cd packages/unit; pub get) -(cd packages/updater; pub get) +dart dev/update_packages.dart ./travis/download_tester.py packages/unit/packages/sky_engine/REVISION bin/cache/travis/out/Debug