Skip to content
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

Fixed /restore and /graph conjunction error on exit code #9461

Merged
merged 9 commits into from
Dec 8, 2023
1 change: 1 addition & 0 deletions src/MSBuild.UnitTests/XMake_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ public void InvalidMaxCPUCountSwitch4()
[InlineData("-getProperty:Foo;Bar -getItem:MyItem -t:Build", true, "TargetValue", true, true, false, true, false)]
[InlineData("-getProperty:Foo;Bar -getItem:MyItem", true, "EvalValue", true, false, false, true, false)]
[InlineData("-getProperty:Foo;Bar -getTargetResult:MyTarget", true, "TargetValue", false, false, true, true, false)]
[InlineData("-getProperty:Foo;Bar -getTargetResult:MyTarget -t:restore", true, "TargetValue", false, false, true, true, false)]
maridematte marked this conversation as resolved.
Show resolved Hide resolved
[InlineData("-getProperty:Foo;Bar", true, "EvalValue", false, false, false, false, false)]
[InlineData("-getProperty:Foo;Bar -t:Build", true, "TargetValue", false, false, false, false, false)]
[InlineData("-getItem:MyItem", false, "", true, false, false, false, false)]
Expand Down
10 changes: 5 additions & 5 deletions src/MSBuild/XMake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1568,18 +1568,18 @@ internal static bool BuildProject(
entryValue.Equals(propertyKvp.Value)))
.Value;
}
else
{
success = graphResult.OverallResult == BuildResultCode.Success;
}
}
else
{
result = ExecuteBuild(buildManager, buildRequest);
}
}

if (result != null && result.Exception == null)
if (graphResult != null && !saveProjectResult)
{
success = graphResult.OverallResult == BuildResultCode.Success;
}
else if (result != null && result.Exception == null)
{
success = result.OverallResult == BuildResultCode.Success;
}
Expand Down