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 #144

Closed jimevans closed 4 years ago

jimevans commented 4 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()).

Fixes #143

j3parker commented 4 years ago

Awesome!