Skip to content

[WIP] Classifies names according to case, uses for filename generation. #1759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion lib/src/dartdoc_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ Future<List<DartdocOption>> createDartdocOptions() async {
new DartdocOptionArgFile<List<String>>('includeExternal', null,
isFile: true,
help:
'Additional (external) dart files to include; use "dir/fileName", '
'Additional (external) dart files to include; use "dir/filename", '
'as in lib/material.dart.',
mustExist: true,
splitCommas: true),
Expand Down
17 changes: 14 additions & 3 deletions lib/src/html/html_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,20 @@ class HtmlGenerator extends Generator {
if (!enabled) {
throw new StateError('`write` was called after `generate` completed.');
}
// If you see this assert, we're probably being called to build non-canonical
// docs somehow. Check data.self.isCanonical and callers for bugs.
assert(allowOverwrite || !writtenFiles.contains(filePath));

assert(
!writtenFiles
.map((String file) => file.toLowerCase())
.contains(filePath.toLowerCase()),
'Filename case metamer found. Output would not be correct on a '
'case-insensitive filesystem (like macOS). Metamer found was '
'"$filePath", which collides with '
'"${writtenFiles.where((String name) => name.toLowerCase() == filePath.toLowerCase()).join('" and "')}"');

assert(
allowOverwrite || !writtenFiles.contains(filePath),
'Being called to build non-canonical docs somehow. Check '
'data.self.isCanonical and callers for bugs.');

var file = new File(pathLib.join(outputDirectoryPath, filePath));
var parent = file.parent;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/html/html_generator_instance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class HtmlGeneratorInstance {
}
TemplateData data = new LibraryTemplateData(_options, packageGraph, lib);

_build(pathLib.join(lib.dirName, '${lib.fileName}'),
_build(pathLib.join(lib.dirName, '${lib.filename}'),
_templates.libraryTemplate, data);
}

Expand Down
Loading