phmonte / Buildalyzer

A utility to perform design-time builds of .NET projects without having to think too hard about it.
MIT License
589 stars 92 forks source link

#210 A change so it can analyse Azure function apps. #215

Closed bonner-earle closed 1 year ago

bonner-earle commented 1 year ago

For Issue #210
I don't fully understand how csc works, so this change is based on my observations of what is happening for the test project supplied in the defect, i.e. that the changed method is called twice both with coreCompile set to true, the first one contains the file paths for the source files. So the solution that appears to work is to aggregate the the results of the two calls together, attempted in a way to not interfere with other kinds of project, or what the app was doing before.

I have no idea which of the two commands should be retained as the command, so the last one wins. I have run the tests and run the example project supplied on the defect with this fix and it produces an output which includes all the source files.
On my box I still get that running a design time build of the function app throws an error, which occurs for me on the integration test that does a design time build of the test Function app, however as you don't seem to have that problem it will be interesting to see if the tests pass for you

bonner-earle commented 1 year ago

After working on this and trying to get a custom version of stryker to work. I discovered that for function apps I only want the first call to csc.

daveaglick commented 1 year ago

After working on this and trying to get a custom version of stryker to work. I discovered that for function apps I only want the first call to csc.

Yeah, looks like you hit the same wall I did in #210 - there's just too much going on in the Function App extensions to MSBuild that I think it's outside the ability of Buildalyzer to analyze.

Thanks for the effort though! At least now we know.