Skip to content

Commit

Permalink
Deprecate --resources-dir option. (#3696)
Browse files Browse the repository at this point in the history
* Deprecate --resources-dir option.

* Add an entry to the changelog.
  • Loading branch information
kallentu authored Feb 29, 2024
1 parent 40fef4c commit cec45fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 8.0.7-wip

* Deprecate the `--nodoc` option. (#3690)
* Deprecate the `--resources-dir` option. (#3696)

## 8.0.6

Expand Down
6 changes: 4 additions & 2 deletions lib/src/dartdoc_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1679,9 +1679,11 @@ List<DartdocOption> createDartdocOptions(
help:
'A list of package names to place first when grouping libraries in '
'packages. Unmentioned packages are placed after these.'),
// TODO(srawlins): Deprecate this option.
// Deprecated. Use of this option is reported.
// TODO(kallentu): Remove this option.
DartdocOptionArgOnly<String?>('resourcesDir', null, resourceProvider,
help: "An absolute path to dartdoc's resources directory.", hide: true),
help: "(deprecated) An absolute path to dartdoc's resources directory.",
hide: true),
DartdocOptionArgOnly<bool>('sdkDocs', false, resourceProvider,
help: 'Generate ONLY the docs for the Dart SDK.'),
DartdocOptionArgSynth<String?>('sdkDir',
Expand Down
7 changes: 7 additions & 0 deletions lib/src/generator/generator_frontend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ class GeneratorFrontEnd implements Generator {
'longer be supported.',
);
}
if (_generatorBackend.options.resourcesDir != null) {
packageGraph?.defaultPackage.warn(
PackageWarning.deprecated,
message: "The '--resources-dir' option is deprecated, and will soon be "
'removed.',
);
}

var indexElements = packageGraph == null
? const <Indexable>[]
Expand Down

0 comments on commit cec45fb

Please sign in to comment.