Brightspace / rules_csharp

Bazel rules for C#
Apache License 2.0
8 stars 5 forks source link

Remove reliance on path attribute for srcs arguments in AssemblyAction #143

Closed jimevans closed 3 years ago

jimevans commented 3 years ago

In AssemblyAction, when adding arguments for the compiler command line, the args.add_all() call is looping through the srcs attribute, and adding the .path from each one. Since each element of the srcs attribute is a File object, adding the file names by calling .path is redundant; at rule execution time, the path is resolved and used as the string argument.

The motivation for this change is that .add_all() also understands File objects that are created with declare_directory(), meaning a rule invoking a source code generator can be used, and the output of that rule used directly (if created with actions.declare_directory()).