-
Notifications
You must be signed in to change notification settings - Fork 155
Conversation
@@ -60,8 +60,9 @@ private static string GetCurrentTFM(ImmutableArray<string> globalProperties, Unc | |||
$"{MSBuildFacts.TargetFrameworkNodeName} is not set in {nameof(project.FirstConfiguredProject)}"); | |||
} | |||
|
|||
// This is pretty much never gonna happen, but it was cheap to write the code | |||
return MSBuildHelpers.IsNotNetFramework(rawTFM) ? StripDecimals(rawTFM) : rawTFM; | |||
// MSBuildHelpers.IsNotNetFramework is pretty much never gonna happen... |
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 change this to just say MSBuildHelpers.IsWindows(rawTFM) can happen when coverting a UWP
@@ -374,6 +411,13 @@ private static bool UnquoteString(ref string s) | |||
} | |||
|
|||
s = s[1..^1]; | |||
|
|||
// Make sure there wasn't another string in there | |||
if (s.Contains('\'')) |
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.
What is this needed for?
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.
@sotteson1 Can you explain your rationale behind this change?
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.
@sotteson1 Can you explain your rationale behind this change?
It's been months since I added that, but it seems like there was a case where there was another string in the text after the first quotes were removed. I was returning false to indicate the function failed, but then it's probably not good that it's already modified the ref'ed parameter. Sorry I don't have more information than that.
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 see why this is needed.
We have a property Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "
When we split this by ==
in the method ConditionToDimensionValues
, the right side of the string becomes '' or '$(VisualStudioVersion)' < '14.0'
The Unquote function ends up returning ' or '$(VisualStudioVersion)' < '14.0
which is an invalid unquoted string
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.
A correct fix is checking whether the string s[1..^1] contains ` before we convert to unquoted string and not after.
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.
In an ideal scenario, the ConditionToDimensionValues
method (on line 78 in the same file) should first split by the or
and and
conditions and then split by ==
Do you think this might be a bug? @jmarolf what do you think is the expected behavior here?
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 think we should change the behavior in a followup PR to have ConditionToDimensionValues
work as you describe.
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.
looks good, just a few questions
This PR adds support to convert the UWP app style project files to WinUI (and in effect be able to use the new Windows App SDK).
This PR is an effort to add the UWP - Windows App SDK migration tooling to the existing .net upgrade-assistant tool that uses the try-convert tool as a submodule.