-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add ProjectOptions.Interactive so that callers can specify that project evaluation can be interactive #8533
Conversation
@@ -3733,7 +3741,8 @@ private void ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, | |||
s_buildEventContext, | |||
evaluationContext.SdkResolverService, | |||
BuildEventContext.InvalidSubmissionId, | |||
evaluationContext); | |||
evaluationContext, | |||
_interactive); |
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.
Its difficult to tell in this diff but this is where the interactive
flag is passed to the evaluator.
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.
LGTM!
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 support doing Project
too.
40c8da7
to
9eefbc5
Compare
Fixes #8523
Context
When a build happens the
BuildParameters
object passes along theInteractive
property when creatingProjectInstance
objects. During evaluation, theEvaluator
then sets the built-inMSBuildInteractive
property to true and the SDK resolver context is also set.However, when you create an instance of a
ProjectInstance
object via theProjectInstance.FromFile(string, ProjectOptions)
method, there is no way to indicate that the evaluation should be interactive.Changes Made
This change adds a new
Interactive
property to theProjectOptions
object. The value is passed to the evaluator and theMSBuildInteractive
MSBuild property is now set.I implemented this for:
ProjectInstance.FromFile(string, ProjectOptions)
ProjectInstance.FromProjectRootElement(ProjectRootElement, ProjectOptions)
Project.FromFile(string, ProjectOptions)
Project.FromProjectRootElement(ProjectRootElement, ProjectOptions)
Project.FromXmlReader(XmlReader, ProjectOptions)
Testing
I added unit tests for all affected methods by testing what happens when
Interactive
is set totrue
orfalse
. When the value istrue
, it is expected that theMSBuildInteractive
MSBuild property is set, otherwise the property value should be an empty string.Notes
Project
(although it was trivial to implement).ProjectInstance_Internal_Tests
to Shouldly, commit ff9398d46008b1e2389dafb083cf6b86fb40eedb has a simpler diff showing the added tests.