Brightspace / rules_csharp

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

Create a good default BUILD file for NuGet packages #22

Closed j3parker closed 5 years ago

j3parker commented 5 years ago

We should do what we did for things like nunitframework.BUILD automatically, via a macro that uses globs.

The downside to this is that the import_library rules won't have deps set up (it's not possible for us to do this within Bazel). It's on the end user to reference all the things they need (and the transitive deps for nuget packages). We still have build_file/build_file_content as an escape hatch to do more sophisticated things, and maybe offer a tool to generate these from packages.config/the centralized packages stuff.

@mthjones mentioned that NuGet packages can include a ref folder tree, so we should use that. He also mentioned there are other weird folders (like runtimes, native) etc. and we should consider having our auto-generated things fail during loading when those are there (but maybe that will be annoying, so give this some thought).

j3parker commented 5 years ago

See this note about the runtime folder: https://github.com/dotnet/corefx/tree/master/pkg/Microsoft.NETCore.Platforms#rid-qualified-assets-are-preferred

j3parker commented 5 years ago

Oh shit, sorry @jrbeverly :( I didn't see you had self-assigned to this one. I'm surprised I didn't get a notification (there is none in my "read" notifications either). I wasn't watching this repo (I am now) but it was an issue I opened so I would have expected to get a ding.

Let's sync up tomorrow.

mthjones commented 5 years ago

Sorry for the delayed response, but a quick correction on this:

He also mentioned there are other weird folders (like runtimes, native) etc. and we should consider having our auto-generated things fail during loading when those are there (but maybe that will be annoying, so give this some thought).

In regards to failing the build, I was referring specifically to the build, buildMultiTargeting and buildTransitive folders, as those contain MSBuild-specific .targets and .props files which Bazel won't be able to handle properly and which will require custom re-implementations.