Closed Kralizek closed 1 year ago
It seems that this is not yet supported in the dotnet-cli so for that reason I doubt that we can support this at this time.
Which part of the dotnet-cli needs to support solution filters? dotnet test
has support for it.
A quick Google search suggested dotnet build does not support solution filters.
Thanks. I'm not aware of the internals of this amazing library!
Just throwing things in the air: wouldn't be possible to generate a temporary sln file and add the needed projects by reading the slnf one?
I'm thinking of something like
dotnet new sln -n tmp
foreach (proj in slnf.projects)
dotnet sln add proj.fullPath
dotnet stryker -s tmp
(Very much pseudo code)
Sure, but it's unlikely we will prioritize something like that over other more widely impactful features or fixes due to limited time.
I've briefly looked at this issue since building a slnf is currently possible. However there is currently no public method available on the SolutionFile that Buildalyzer returns from MSBuild that can be used to find out if a given project is included in the solution filter.
The people at Nuget had the same issue: PR But MSBuild rejected the proposal to make the method public: PR
We could use the same solution that the Nuget team used:
var projectShouldBuildMethod = isSolutionFilter ? solutionFileType.GetMethod("ProjectShouldBuild", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
@MathiasSpanhove if I understand you correctly this is something that would be contributed to buildalyzer before we can use it, correct?
I would say that if Microsoft does not think that this should be exposed publicly, we should not try to support it.
Technically it needs to be contributed to MSBuild since Buildalyzer returns the MSBuild SolutionFile objects. But I completely understand the reasoning to not implement this 'hack', I just wanted to add some information I found just in case someone else wants to look into this in the future (hopefully MSBuild has better slnf support then)
@MathiasSpanhove buildalyzer actually does not return msbuild objects unless you use the roslyn workspace extensions. The information is very helpful!
At this point I don't see a good way to support this, and I personally don't wish to add rebuilding visual studio to the ever growing list of external dependencies we have.
Is your feature request related to a problem? Please describe. My solution is divided in several sub solution using solution filters. Currently there is no way to target one of these files when executing
stryker
.Describe the solution you'd like I'd like to be able to specify the solution filter file instead of a solution or a project file.
Describe alternatives you've considered Alternatively I need to create a parallel solution with the subset of projects needed for properly running
stryker