Description
It would be useful for tooling to be able to invoke DDC in the context of the build output, using the user's configuration as well as any cached modules that may already exist. I'm imagining something as simple as: pub run build dartdevc $args
, where $args
are the same arguments that dartdevc
normally supports. This would behave like a normal dartdevc
invocation, except that:
-
package:
URLs are resolved using the same scheme as the package it's invoked in, regardless of where the entrypoint is. -
Any
package:
imports or imports from the entrypoint package use modules and summaries from the build cache rather than being recompiled from scratch.
This would make it easy for tools to integrate with build's infrastructure without requiring users to add build phases. The driving use case is test
, which needs to generate a small amount of wrapper code in order to load a test file properly. If it could pass this wrapper file to DDC while having the modules it imports come from build
, it would avoid doing unnecessary compilation while still being able to dynamically generate code as necessary.
This may not be possible until dart-lang/sdk#27262 is done.