diff --git a/.travis.yml b/.travis.yml index ed3a1ccfae..9e9e74595f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: dart sudo: false -dart: +dart: - dev - - stable +# - stable env: - GEN_SDK_DOCS=true - GEN_SDK_DOCS=false diff --git a/lib/dartdoc.dart b/lib/dartdoc.dart index 0171e0ab6d..0157f4a6b9 100644 --- a/lib/dartdoc.dart +++ b/lib/dartdoc.dart @@ -151,7 +151,7 @@ class DartDoc { if (name.startsWith(Platform.pathSeparator)) name = name.substring(1); } print('parsing ${name}...'); - Source source = new FileBasedSource.con1(new JavaFile(filePath)); + Source source = new FileBasedSource(new JavaFile(filePath)); sources.add(source); if (context.computeKindOf(source) == SourceKind.LIBRARY) { LibraryElement library = context.computeLibraryElement(source); diff --git a/lib/resource_loader.dart b/lib/resource_loader.dart index 74814875cf..345c03a51d 100644 --- a/lib/resource_loader.dart +++ b/lib/resource_loader.dart @@ -2,8 +2,6 @@ // 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. -// TODO: Consider making this a stand-alone package, if useful. - /// Make it possible to load resources, independent of how the Dart app is run. /// /// Future getTemplateFile(String templatePath) { @@ -14,7 +12,7 @@ library dartdoc.resource_loader; import 'dart:async' show Future; import 'dart:io' show Platform, File, Directory; -import 'dart:typed_data'; +import 'dart:typed_data' show Uint8List; import 'package:http/http.dart' as http; import 'package:path/path.dart' as p; @@ -24,20 +22,27 @@ import 'package:pub_cache/pub_cache.dart'; String packageRootPath; /// Loads a `package:` resource as a String. -Future loadAsString(String path) async { +Future loadAsString(String path) { if (!path.startsWith('package:')) { throw new ArgumentError('path must begin with package:'); } - Uint8List bytes = await _doLoad(path); - return new String.fromCharCodes(bytes); + return new Resource(path).readAsString().catchError((_) async { + // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed. + var bytes = await _doLoad(path); + return new String.fromCharCodes(bytes); + }); } -/// Loads a `package:` resource as an [Uint8List]. -Future loadAsBytes(String path) { +/// Loads a `package:` resource as an [List]. +Future> loadAsBytes(String path) { if (!path.startsWith('package:')) { throw new ArgumentError('path must begin with package:'); } - return _doLoad(path); + + return new Resource(path).readAsBytes().catchError((_) { + // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed. + return _doLoad(path); + }); } /// Determine how to do the load. HTTP? Snapshotted? From source? diff --git a/lib/src/model.dart b/lib/src/model.dart index c6a7b42b5e..687d3a94a1 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -11,7 +11,6 @@ import 'package:analyzer/src/generated/resolver.dart'; import 'package:analyzer/src/generated/utilities_dart.dart' show ParameterKind; import 'package:quiver/core.dart'; -import 'debug.dart'; import 'html_utils.dart'; import 'model_utils.dart'; import 'package_meta.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index febc1a7389..9d7bc13ae6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,9 +5,9 @@ author: Dart Team description: A documentation generator for Dart. homepage: https://github.com/dart-lang/dartdoc environment: - sdk: '>=1.9.0 <2.0.0' # when we go to 1.12, bump analyzer version + sdk: '>=1.12.0-dev.5.0 <2.0.0' dependencies: - analyzer: '>=0.25.0 <0.27.0' + analyzer: '>=0.26.0 <0.27.0' args: ^0.13.0 cli_util: ^0.0.1 html: ^0.12.1 diff --git a/test/test_utils.dart b/test/test_utils.dart index 2484a0f8b8..a8ed652448 100644 --- a/test/test_utils.dart +++ b/test/test_utils.dart @@ -65,7 +65,7 @@ class AnalyzerHelper { } Source addSource(String filePath) { - Source source = new FileBasedSource.con1(new JavaFile(filePath)); + Source source = new FileBasedSource(new JavaFile(filePath)); ChangeSet changeSet = new ChangeSet(); changeSet.addedSource(source); context.applyChanges(changeSet);