Brightspace / rules_csharp

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

Source for GenerateFrameworkBuildFile.cs #167

Closed purkhusid closed 2 years ago

purkhusid commented 2 years ago

Hey! Would it be possible to get the source for build\src\D2L.Build.BazelGenerator\Commands\GenerateFrameworkBuildFile.cs that is mentioned in the generated files in this repo?

omsmith commented 2 years ago

Hey @purkhusid!

It's part of a larger project of ours, but will look into extracting it.

purkhusid commented 2 years ago

That would be awesome! Thanks!

omsmith commented 2 years ago

We've extracted the function out into https://github.com/Brightspace/D2L.Build.BazelGenerator.

We'll have the admit that while the comment screams Don't edit it by hand!, the generator is not perfect (though we didn't necessarily try very hard to make it so) and we've had to massage the output. So, surely isn't usable as-is, but might be the basic idea for building something else.

But the basic logic:

It doesn't produce aliases which we added in by hand. And I believe there's some differences in the dependencies of what we actually committed to the framework files. Fully generating it was aspirational, but that was also a long time ago, so sorry for being fuzzy on the details.

Hope it helps.

j3parker commented 2 years ago

Thanks @omsmith ! Note that this comes from our internal code base where we read in our existing build (a combination of nant and custom stuff) and generate BUILD/WORKSPACE, so if it seems a little over-built that's why.

purkhusid commented 2 years ago

Thanks for doing this!