DescriptionEnables globbing for entry points.
We have had a request for entry point abstraction for a while, and this
CL provides a very simple approach that enables the 'test_reflectable'
'pubspec.yaml' to be abbreviated substantially; it might be quite
helpful for others, too, even though it's so simple.
It introduces the ability for the transformer to glob the specified
entry points, i.e., it uses package 'glob' and the `Glob` method
`matches` to test whether a given `AssetId` is an entry point.
Consequently, clients of 'reflectable' (including 'test_reflectable')
can use a simple `entry_points: ["test/*_test.dart"]` rather than a
concrete list with dozens of test file names.
We do not support a seemingly even more convenient model: Dropping the
`entry_points:` specification entirely and relying on the provided
`Asset`s, just testing whether each of them has a `main` (directly or
imported). The problem with that is that we would then need to run
the analyzer during `declareOutputs`, which would completely undo the
response time improvements expected from a lazy transformer. So
programmers still have to take the responsibility to declare which
files are entry points, but they can now use a wildcard for it---they
cannot completely omit this information.
Btw, I think this update is awaited so eagerly that it makes sense to
go directly to a `pub publish` v0.5.3 when it has been landed.
R=sigurdm@google.com
Committed: https://github.com/dart-lang/reflectable/commit/8936f98be71cd4325928b8b249b906f83aa54034
Patch Set 1 #
Messages
Total messages: 5 (2 generated)
|