Description
Related to #6221. Is it possible at all to read another plugin's outputs from a target dependency? If so, what is the correct way to do so? The documentation seems to imply this is possible, and perhaps even a common scenario, because it describes a system where input and output tracking between plugins happens and is useful for build optimization:
Build commands are preferred over prebuild commands when the paths of all of the inputs and outputs are known before the command runs, since they allow the build system to more efficiently decide when they should be run. This is actually quite common. Examples include source translation tools that generate one output file (with a predictable name) for each input file, or other cases where the plugin can control the names of the outputs without having to first run the tool. In this case the build system can run the command only when some of the outputs are missing or when the inputs have changed since the last time the command ran.
SourceModule
targets expose a pluginGeneratedSources
property but this appears to be empty for at least buildCommand
targets. The docs for this property are unclear:
Paths of any sources generated by other plugins that have been applied to the given target before the plugin currently being executed.
Note: Plugins are applied in order of declaration in the package manifest. Generated files are vended to the target the current plugin is being applied to, but not necessarily to other targets in the package graph.
In this case, what does "not necessarily" mean? It seems to imply that under some circumstances other package graph targets may expose generated sources, but it is unclear when this happens, if it does at all.