Skip to content

Commit b28ee1f

Browse files
authored
Deprecate the --nodoc Option (#3690)
1 parent 7988d91 commit b28ee1f

File tree

6 files changed

+23
-15
lines changed

6 files changed

+23
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 8.0.7-wip
2+
3+
* Deprecate the `--nodoc` option. (#3690)
4+
15
## 8.0.6
26

37
* Add troubleshooting information when the sidebars failed to load. (#3643)

dartdoc_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dartdoc:
22
linkToSource:
33
root: '.'
4-
uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v8.0.6/%f%#L%l%'
4+
uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v8.0.7-wip/%f%#L%l%'

lib/src/dartdoc_options.dart

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,13 +1652,13 @@ List<DartdocOption> createDartdocOptions(
16521652
help: 'Allow links to be generated for packages outside this one.',
16531653
negatable: true),
16541654
]),
1655-
// TODO(srawlins): Deprecate; with the advent of the unnamed library, this
1656-
// should be applied in each file, on the `library;` directive.
1655+
// Deprecated. Use of this option is reported.
1656+
// TODO(srawlins): Remove.
16571657
DartdocOptionFileOnly<List<String>>('nodoc', [], resourceProvider,
16581658
optionIs: OptionKind.glob,
1659-
help: 'Dart symbols declared in these files will be treated as though '
1660-
'they have the @nodoc directive added to their documentation '
1661-
'comment.'),
1659+
help: '(deprecated) Dart symbols declared in these files will be '
1660+
'treated as though they have the @nodoc directive added to their '
1661+
'documentation comment.'),
16621662
DartdocOptionArgOnly<String>('output',
16631663
resourceProvider.pathContext.join('doc', 'api'), resourceProvider,
16641664
optionIs: OptionKind.dir, help: 'Path to the output directory.'),
@@ -1690,13 +1690,10 @@ List<DartdocOption> createDartdocOptions(
16901690
(option.root['topLevelPackageMeta'].valueAt(dir) as PackageMeta)
16911691
.requiresFlutter) {
16921692
String? flutterRoot = option.root['flutterRoot'].valueAt(dir);
1693-
if (flutterRoot == null) {
1694-
// For now, return null. An error is reported in
1695-
// [PackageBuilder.buildPackageGraph].
1696-
return null;
1697-
}
1698-
return resourceProvider.pathContext
1699-
.join(flutterRoot, 'bin', 'cache', 'dart-sdk');
1693+
return flutterRoot == null
1694+
? null
1695+
: resourceProvider.pathContext
1696+
.join(flutterRoot, 'bin', 'cache', 'dart-sdk');
17001697
}
17011698
return packageMetaProvider.defaultSdkDir.path;
17021699
}, packageMetaProvider.resourceProvider,

lib/src/model/package_graph.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,13 @@ class PackageGraph with CommentReferable, Nameable {
927927
// a context is again, slow.
928928
var globs = (config.optionSet['nodoc'].valueAt(file.parent) as List)
929929
.cast<String>();
930+
if (globs.isNotEmpty) {
931+
packageGraph.defaultPackage.warn(
932+
PackageWarning.deprecated,
933+
message:
934+
"The '--nodoc' option is deprecated, and will soon be removed.",
935+
);
936+
}
930937
return utils.matchGlobs(globs, fullName);
931938
});
932939
}

lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const packageVersion = '8.0.6';
1+
const packageVersion = '8.0.7-wip';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: dartdoc
2-
version: 8.0.6
2+
version: 8.0.7-wip
33
description: A non-interactive HTML documentation generator for Dart source code.
44
repository: https://github.com/dart-lang/dartdoc
55

0 commit comments

Comments
 (0)