-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite MSBuild reader to use MSBuild API #1125
Rewrite MSBuild reader to use MSBuild API #1125
Conversation
- Control usage of new implementation via SPECFLOW_USE_MSBUILDAPI to be able test both implementations side-by-side - Update TechTalk.SpecFlow.Generator to net46 to be able use MSBuild API, and propagate changes where required across projects which depends on the TechTalk.SpecFlow.Generator - Update MSBuild API to 15.6. This change may be not needed, but, I strongly suspect that it will play more nicely with all version of .NET Core up to not yet released .NET Core 2.1 - Add tests on the exclude folder - Change test a bit to take into account that paths `.\filename` and `filename` appear as two items via MSBuild API, and I dont think that duplicate items is desired behavior - Implementation of MSBuildApiProjectReader is just old resurrected implementation using MSBuild API with small changes See SpecFlowOSS#1029
cd513fd
to
c817b4e
Compare
@@ -128,7 +128,19 @@ private bool IsNewProjectSystem(XDocument xDocument) | |||
|
|||
public static SpecFlowProject LoadSpecFlowProjectFromMsBuild(string projectFilePath) | |||
{ | |||
return new MsBuildProjectReader(new GeneratorConfigurationProvider(new ConfigurationLoader()), new MSBuildRelativePathParser()).ReadSpecFlowProject(projectFilePath); | |||
var configurationProvider = new GeneratorConfigurationProvider(new ConfigurationLoader()); | |||
var useMSBuildApi = Environment.GetEnvironmentVariable("SPECFLOW_USE_MSBUILDAPI") == "1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make the new project reader the default one. Only so do we recognize errors of it.
Looks good! Thanks for it! BTW as you are in the topic: For #1033 we need all PackageReferences of the project to find the plugins. |
This is justified by fact that supporting it, means reimplementing whole MSBuild logic, which is not reasonable. Also for loading plugins would be needed read PackageReferences from the projects, and this would be problematic implement correctly. Current implementation is also flawled. See SpecFlowOSS#1102, and wellknown fact that Exclude property on the MSBuild items is not supported
@SabotageAndi remove XML based implementation |
.\filename
andfilename
appear as two items via MSBuild API, and I dont think that duplicate items is desired behaviorCloses #1029
Types of changes
Checklist: