From 737a733aff2d5991fdd234844fe709f0a42602b5 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Tue, 29 May 2018 09:32:08 -0700 Subject: [PATCH 1/8] Test-pin to a bleeding edge SDK to verify fix for relative path resolution --- .travis.yml | 2 +- appveyor.yml | 2 +- tool/grind.dart | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 794905e56d..48b7ffedaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: dart sudo: false dart: - - "dev/raw/latest" + - "be/raw/hash/6bc7288e708f6efd48cae83ac7413188dd741de2" env: - DARTDOC_BOT=main # TODO(devoncarew): add angulardart support diff --git a/appveyor.yml b/appveyor.yml index d4bd319f99..55be58f7e8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. install: - - ps: wget https://storage.googleapis.com/dart-archive/channels/dev/raw/latest/sdk/dartsdk-windows-x64-release.zip -OutFile dart-sdk.zip + - ps: wget https://storage.googleapis.com/dart-archive/channels/be/raw/hash/6bc7288e708f6efd48cae83ac7413188dd741de2/sdk/dartsdk-windows-x64-release.zip -OutFile dart-sdk.zip - cmd: echo "Unzipping dart-sdk..." - cmd: 7z x dart-sdk.zip -o"C:\tools" -y > nul - set PATH=%PATH%;C:\tools\dart-sdk\bin diff --git a/tool/grind.dart b/tool/grind.dart index e700b4a583..811993076a 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -731,17 +731,14 @@ List get testFiles => new Directory('test') testPreviewDart2() async { List parameters = ['--preview-dart-2', '--enable-asserts']; - // sdk#32901 is really bad on Windows. - for (File dartFile in testFiles.where((f) => - !f.path.endsWith('html_generator_test.dart') && !Platform.isWindows)) { - // absolute path to work around dart-lang/sdk#32901 + for (File dartFile in testFiles) { await testFutures.addFuture(new SubprocessLauncher( - 'dart2-${pathLib.basename(dartFile.absolute.path)}') + 'dart2-${pathLib.basename(dartFile.path)}') .runStreamed( Platform.resolvedExecutable, [] ..addAll(parameters) - ..add(dartFile.absolute.path))); + ..add(dartFile.path))); } } From e7989410cfda1c3a9f99a190bf9342d8196d4a4e Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Tue, 29 May 2018 09:41:27 -0700 Subject: [PATCH 2/8] fix test to allow edge --- pubspec.lock | 2 +- test/dartdoc_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index b64a98880b..5d7d323df4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -394,4 +394,4 @@ packages: source: hosted version: "2.1.13" sdks: - dart: ">=2.0.0-dev.54.0 <=2.0.0-dev.58.0" + dart: ">=2.0.0-dev.54.0 <=2.0.0-edge.6bc7288e708f6efd48cae83ac7413188dd741de2" diff --git a/test/dartdoc_test.dart b/test/dartdoc_test.dart index 7bf6b1b3fe..b2ac35279d 100644 --- a/test/dartdoc_test.dart +++ b/test/dartdoc_test.dart @@ -66,7 +66,7 @@ void main() { startsWith( 'Tuple2')); RegExp stringLink = new RegExp( - 'https://api.dartlang.org/(dev|stable|be)/${Platform.version.split(' ').first}/dart-core/String-class.html">String'); + 'https://api.dartlang.org/(dev|stable|edge|be)/${Platform.version.split(' ').first}/dart-core/String-class.html">String'); expect(useSomethingInAnotherPackage.modelType.linkedName, contains(stringLink)); }); From eefc46ba7b1cfff02aa424bee3cd02d24c21d09d Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Tue, 29 May 2018 10:22:15 -0700 Subject: [PATCH 3/8] args version needs revision for dart 2 --- pubspec.lock | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 5d7d323df4..3629359b4a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.3" async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5f698fe161..d348e49907 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.0.0-dev.54.0 <3.0.0' dependencies: analyzer: 0.32.0 - args: '>=0.13.0 <2.0.0' + args: '>=1.4.3 <2.0.0' collection: ^1.2.0 front_end: ^0.1.0 html: '>=0.12.1 <0.14.0' From 0687e329a7d3a4e4838e199cea0c9d1219888e0e Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Tue, 29 May 2018 11:23:59 -0700 Subject: [PATCH 4/8] dartfmt, fix bug with hide --- lib/src/dartdoc_options.dart | 5 ++-- lib/src/model.dart | 11 ++++--- pubspec.yaml | 2 +- test/model_test.dart | 9 ++---- tool/grind.dart | 57 ++++++++++++++++++++++++++---------- 5 files changed, 56 insertions(+), 28 deletions(-) diff --git a/lib/src/dartdoc_options.dart b/lib/src/dartdoc_options.dart index 8ee26a6745..eba737d638 100644 --- a/lib/src/dartdoc_options.dart +++ b/lib/src/dartdoc_options.dart @@ -357,6 +357,7 @@ class DartdocOptionArgSynth extends DartdocOption {String abbr, bool mustExist = false, String help = '', + bool hide = false, bool isDir = false, bool isFile = false, bool negatable, @@ -487,7 +488,7 @@ class DartdocOptionArgOnly extends DartdocOption {String abbr, bool mustExist = false, String help = '', - bool hide, + bool hide = false, bool isDir = false, bool isFile = false, bool negatable, @@ -522,7 +523,7 @@ class DartdocOptionArgFile extends DartdocOption {String abbr, bool mustExist = false, String help: '', - bool hide, + bool hide = false, bool isDir = false, bool isFile = false, bool negatable, diff --git a/lib/src/model.dart b/lib/src/model.dart index 5d3750b1ec..62284bdc17 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -3597,7 +3597,8 @@ abstract class ModelElement extends Canonicalization width = int.parse(match[2]); } on FormatException { warn(PackageWarning.invalidParameter, - message: 'An animation has an invalid width ($name): ${match[2]}. The ' + message: + 'An animation has an invalid width ($name): ${match[2]}. The ' 'width must be an integer.'); return ''; } @@ -3606,7 +3607,8 @@ abstract class ModelElement extends Canonicalization height = int.parse(match[3]); } on FormatException { warn(PackageWarning.invalidParameter, - message: 'An animation has an invalid height ($name): ${match[3]}. The ' + message: + 'An animation has an invalid height ($name): ${match[3]}. The ' 'height must be an integer.'); return ''; } @@ -3615,7 +3617,8 @@ abstract class ModelElement extends Canonicalization movieUrl = Uri.parse(match[4]); } on FormatException catch (e) { warn(PackageWarning.invalidParameter, - message: 'An animation URL could not be parsed ($name): ${match[4]}\n$e'); + message: + 'An animation URL could not be parsed ($name): ${match[4]}\n$e'); return ''; } final String overlayName = '${name}_play_button_'; @@ -3655,7 +3658,7 @@ abstract class ModelElement extends Canonicalization -'''; // String must end at beginning of line, or following inline text will be +'''; // String must end at beginning of line, or following inline text will be // indented. }); } diff --git a/pubspec.yaml b/pubspec.yaml index d348e49907..2f2e513789 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.0.0-dev.54.0 <3.0.0' dependencies: analyzer: 0.32.0 - args: '>=1.4.3 <2.0.0' + args: '>=1.4.1 <2.0.0' collection: ^1.2.0 front_end: ^0.1.0 html: '>=0.12.1 <0.14.0' diff --git a/test/model_test.dart b/test/model_test.dart index 97cd678770..6158b50040 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -565,14 +565,11 @@ void main() { isTrue); }); test("Doesn't place animations in one line doc", () { - expect( - withAnimationInline.oneLineDoc, isNot(contains(' get binFiles => new Directory('bin') + .listSync(recursive: true) + .where((e) => e is File && e.path.endsWith('.dart')) + .cast() + ..toList(); + List get testFiles => new Directory('test') .listSync(recursive: true) .where((e) => e is File && e.path.endsWith('test.dart')) @@ -732,27 +738,48 @@ testPreviewDart2() async { List parameters = ['--preview-dart-2', '--enable-asserts']; for (File dartFile in testFiles) { - await testFutures.addFuture(new SubprocessLauncher( - 'dart2-${pathLib.basename(dartFile.path)}') - .runStreamed( - Platform.resolvedExecutable, - [] - ..addAll(parameters) - ..add(dartFile.path))); + await testFutures.addFuture( + new SubprocessLauncher('dart2-${pathLib.basename(dartFile.path)}') + .runStreamed( + Platform.resolvedExecutable, + [] + ..addAll(parameters) + ..add(dartFile.path))); + } + + for (File dartFile in binFiles) { + await testFutures.addFuture( + new SubprocessLauncher('dart2-${pathLib.basename(dartFile.path)}') + .runStreamed( + Platform.resolvedExecutable, + [] + ..addAll(parameters) + ..add(dartFile.path) + ..add('--help'))); } } testDart1() async { List parameters = ['--checked']; for (File dartFile in testFiles) { - // absolute path to work around dart-lang/sdk#32901 - await testFutures.addFuture(new SubprocessLauncher( - 'dart1-${pathLib.basename(dartFile.absolute.path)}') - .runStreamed( - Platform.resolvedExecutable, - [] - ..addAll(parameters) - ..add(dartFile.absolute.path))); + await testFutures.addFuture( + new SubprocessLauncher('dart1-${pathLib.basename(dartFile.path)}') + .runStreamed( + Platform.resolvedExecutable, + [] + ..addAll(parameters) + ..add(dartFile.path))); + } + + for (File dartFile in binFiles) { + await testFutures.addFuture( + new SubprocessLauncher('dart1-${pathLib.basename(dartFile.path)}') + .runStreamed( + Platform.resolvedExecutable, + [] + ..addAll(parameters) + ..add(dartFile.path) + ..add('--help'))); } } From 943f652fe3176b1922ffe99c1086f52300a1a4a6 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 30 May 2018 08:14:08 -0700 Subject: [PATCH 5/8] Require .59 for Dart 2. --- .travis.yml | 2 +- CHANGELOG.md | 7 +++++++ README.md | 12 ++++++++++++ appveyor.yml | 2 +- pubspec.lock | 10 +++++----- pubspec.yaml | 8 ++++---- tool/grind.dart | 4 ++-- 7 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 48b7ffedaf..794905e56d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: dart sudo: false dart: - - "be/raw/hash/6bc7288e708f6efd48cae83ac7413188dd741de2" + - "dev/raw/latest" env: - DARTDOC_BOT=main # TODO(devoncarew): add angulardart support diff --git a/CHANGELOG.md b/CHANGELOG.md index 86ffc1bdb1..41bf243c0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.20.0 +* include and exclude are now available in dartdoc_options.yaml as supported options + (#1700, #1674) +* Support a new `{@animation}` directive in documentation comments to display + videos in a simple player. +* Fix Dart 2.0 support (#1668) and expand test coverage to include --help. + ## 0.19.1 * Update `package:markdown` to `2.0.0`, which includes many improvements – especially to the parsing of links. diff --git a/README.md b/README.md index a62be49aa0..82e39b4b45 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,18 @@ and Library pages. library my_library; ``` +### Animations + +You can specify links to videos inline that will be handled with a simple HTML5 player: + +```dart +/// This widget is a dancing Linux penguin. +/// +/// {@animation name 100 200 http://host.com/path/to/video.mp4} +``` + +'name' is user defined, and the numbers are the width and height of the animation in pixels. + ### Macros You can specify "macros", i.e. reusable pieces of documentation. For that, first specify a template diff --git a/appveyor.yml b/appveyor.yml index 55be58f7e8..d4bd319f99 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. install: - - ps: wget https://storage.googleapis.com/dart-archive/channels/be/raw/hash/6bc7288e708f6efd48cae83ac7413188dd741de2/sdk/dartsdk-windows-x64-release.zip -OutFile dart-sdk.zip + - ps: wget https://storage.googleapis.com/dart-archive/channels/dev/raw/latest/sdk/dartsdk-windows-x64-release.zip -OutFile dart-sdk.zip - cmd: echo "Unzipping dart-sdk..." - cmd: 7z x dart-sdk.zip -o"C:\tools" -y > nul - set PATH=%PATH%;C:\tools\dart-sdk\bin diff --git a/pubspec.lock b/pubspec.lock index 3629359b4a..086eef50e4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.32.0" + version: "0.32.1" args: dependency: "direct main" description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.3" + version: "1.4.1" async: dependency: transitive description: @@ -84,7 +84,7 @@ packages: name: front_end url: "https://pub.dartlang.org" source: hosted - version: "0.1.0" + version: "0.1.1" glob: dependency: transitive description: @@ -147,7 +147,7 @@ packages: name: kernel url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.3.1" logging: dependency: "direct main" description: @@ -394,4 +394,4 @@ packages: source: hosted version: "2.1.13" sdks: - dart: ">=2.0.0-dev.54.0 <=2.0.0-edge.6bc7288e708f6efd48cae83ac7413188dd741de2" + dart: ">=2.0.0-dev.59.0 <=2.0.0-dev.59.0.flutter-ff815d05a5" diff --git a/pubspec.yaml b/pubspec.yaml index 2f2e513789..b8f610c045 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,16 +1,16 @@ name: dartdoc # Also update the `version` field in lib/dartdoc.dart. -version: 0.19.1 +version: 0.20.0 author: Dart Team description: A documentation generator for Dart. homepage: https://github.com/dart-lang/dartdoc environment: - sdk: '>=2.0.0-dev.54.0 <3.0.0' + sdk: '>=2.0.0-dev.59.0 <3.0.0' dependencies: - analyzer: 0.32.0 + analyzer: 0.32.1 args: '>=1.4.1 <2.0.0' collection: ^1.2.0 - front_end: ^0.1.0 + front_end: ^0.1.1 html: '>=0.12.1 <0.14.0' # We don't use http_parser directly; this dep exists to ensure that we get at # least version 3.0.3 to work around an issue with 3.0.2. diff --git a/tool/grind.dart b/tool/grind.dart index 02c116371e..264ed94317 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -749,7 +749,7 @@ testPreviewDart2() async { for (File dartFile in binFiles) { await testFutures.addFuture( - new SubprocessLauncher('dart2-${pathLib.basename(dartFile.path)}') + new SubprocessLauncher('dart2-bin-${pathLib.basename(dartFile.path)}-help') .runStreamed( Platform.resolvedExecutable, [] @@ -773,7 +773,7 @@ testDart1() async { for (File dartFile in binFiles) { await testFutures.addFuture( - new SubprocessLauncher('dart1-${pathLib.basename(dartFile.path)}') + new SubprocessLauncher('dart1-bin-${pathLib.basename(dartFile.path)}-help') .runStreamed( Platform.resolvedExecutable, [] From b76ba23cd75eb37a0357549d4ec6c913f5d352a9 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 30 May 2018 08:14:28 -0700 Subject: [PATCH 6/8] dartfmt --- tool/grind.dart | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tool/grind.dart b/tool/grind.dart index 264ed94317..2b943f25e4 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -748,14 +748,14 @@ testPreviewDart2() async { } for (File dartFile in binFiles) { - await testFutures.addFuture( - new SubprocessLauncher('dart2-bin-${pathLib.basename(dartFile.path)}-help') - .runStreamed( - Platform.resolvedExecutable, - [] - ..addAll(parameters) - ..add(dartFile.path) - ..add('--help'))); + await testFutures.addFuture(new SubprocessLauncher( + 'dart2-bin-${pathLib.basename(dartFile.path)}-help') + .runStreamed( + Platform.resolvedExecutable, + [] + ..addAll(parameters) + ..add(dartFile.path) + ..add('--help'))); } } @@ -772,14 +772,14 @@ testDart1() async { } for (File dartFile in binFiles) { - await testFutures.addFuture( - new SubprocessLauncher('dart1-bin-${pathLib.basename(dartFile.path)}-help') - .runStreamed( - Platform.resolvedExecutable, - [] - ..addAll(parameters) - ..add(dartFile.path) - ..add('--help'))); + await testFutures.addFuture(new SubprocessLauncher( + 'dart1-bin-${pathLib.basename(dartFile.path)}-help') + .runStreamed( + Platform.resolvedExecutable, + [] + ..addAll(parameters) + ..add(dartFile.path) + ..add('--help'))); } } From 559a38c41fd8a36042ee100d61832aba3a46473d Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 30 May 2018 08:20:34 -0700 Subject: [PATCH 7/8] pubspec fix --- pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.lock b/pubspec.lock index 086eef50e4..d2d89f04f7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -394,4 +394,4 @@ packages: source: hosted version: "2.1.13" sdks: - dart: ">=2.0.0-dev.59.0 <=2.0.0-dev.59.0.flutter-ff815d05a5" + dart: "2.0.0-dev.59.0" From 0d3cdf59186aaa807809ad596f4f9237d8b2ffb0 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 30 May 2018 08:47:47 -0700 Subject: [PATCH 8/8] Version number bump and regen docs --- lib/dartdoc.dart | 2 +- testing/test_package_docs/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dartdoc.dart b/lib/dartdoc.dart index 1861e48ae7..a337cb2e80 100644 --- a/lib/dartdoc.dart +++ b/lib/dartdoc.dart @@ -37,7 +37,7 @@ export 'package:dartdoc/src/package_meta.dart'; const String name = 'dartdoc'; // Update when pubspec version changes. -const String dartdocVersion = '0.19.1'; +const String dartdocVersion = '0.20.0'; /// Helper class to initialize the default generators since they require /// GeneratorContext. diff --git a/testing/test_package_docs/index.html b/testing/test_package_docs/index.html index 3dea99d47b..214ec7b902 100644 --- a/testing/test_package_docs/index.html +++ b/testing/test_package_docs/index.html @@ -4,7 +4,7 @@ - + test_package - Dart API docs