From cec45fbedf85b938670314e5bcdac3fbdde94f99 Mon Sep 17 00:00:00 2001 From: Kallen Tu Date: Thu, 29 Feb 2024 11:02:08 -0800 Subject: [PATCH] Deprecate --resources-dir option. (#3696) * Deprecate --resources-dir option. * Add an entry to the changelog. --- CHANGELOG.md | 1 + lib/src/dartdoc_options.dart | 6 ++++-- lib/src/generator/generator_frontend.dart | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce6ac8f399..7970a04af9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 8.0.7-wip * Deprecate the `--nodoc` option. (#3690) +* Deprecate the `--resources-dir` option. (#3696) ## 8.0.6 diff --git a/lib/src/dartdoc_options.dart b/lib/src/dartdoc_options.dart index bd69f88d31..b73d2e3ca2 100644 --- a/lib/src/dartdoc_options.dart +++ b/lib/src/dartdoc_options.dart @@ -1679,9 +1679,11 @@ List 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('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('sdkDocs', false, resourceProvider, help: 'Generate ONLY the docs for the Dart SDK.'), DartdocOptionArgSynth('sdkDir', diff --git a/lib/src/generator/generator_frontend.dart b/lib/src/generator/generator_frontend.dart index 3f361eaa53..00035aaaef 100644 --- a/lib/src/generator/generator_frontend.dart +++ b/lib/src/generator/generator_frontend.dart @@ -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 []