Consider a static code check for the @GenerateMocks
annotation before resolving the library
#503
Labels
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
Related to #502 and dart-lang/build#3238. Currently, the mock builder is implemented in such a way that it fully resolves every Dart library. Given that this builder also currently runs on all
.dart
files by default, this results in a significant performance hit, especially for large projects, and especially considering that this builder won't generate any code for most of its inputs.Consumers can narrow down the inputs to this builder, but it would be nice to improve the performance of this builder by default. One option to do so would be to perform a check for the presence of a
@GenerateMocks
annotation in the source file's text before using the builder API/analyzer to resolve that library. Even if the check produced false-positives (for example, finding it in a comment), it would better than resolving every library.The text was updated successfully, but these errors were encountered: