-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Change netcoreapp5.0 to net5.0 #35176
Conversation
Tagging subscribers to this area: @ViktorHofer |
We will need to change our custom parsing for the designTimeBuilds as well. |
Master already has the net5.0 parsing logic: https://github.com/dotnet/runtime/blob/master/src/libraries/intellisense.targets#L42-L54, dotnet/sdk@0f5fc4b |
@@ -16,7 +16,7 @@ | |||
<Reference Include="System.Text.Json" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup Condition="$(TargetFramework.StartsWith('netcoreapp'))"> | |||
<ItemGroup Condition="$(TargetFramework.StartsWith('$(NetCoreAppCurrent)'))"> |
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.
Should this instead test for equality?
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.
No, because the TargetFramework is overloaded with the OS: netcoreapp5.0-Windows_NT
.
I will create a doc after merging this which describes when to use what. Basically the recommendation is:
- Use an equality check if the TargetFramework isn't overloaded with the OS portion.
- Use a StartsWith when you want to test for multiple .NETStandard or .NETFramework versions
- Use a StartsWith if the TargetFramework is overloaded with the OS portion.
- Use negations if that makes the conditions easier.
src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj
Show resolved
Hide resolved
@@ -14,8 +14,8 @@ | |||
<PropertyGroup> | |||
<!-- For the inbox library (that is shipping with the product), this should always be true. --> | |||
<!-- BUILDING_INBOX_LIBRARY is only false when building the netstandard compatible NuGet package. --> | |||
<DefineConstants Condition="$(TargetFramework.StartsWith('netcoreapp'))">$(DefineConstants);BUILDING_INBOX_LIBRARY</DefineConstants> | |||
<NoWarn Condition="!$(TargetFramework.StartsWith('netcoreapp'))">$(NoWarn);nullable</NoWarn> | |||
<DefineConstants Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)' or '$(TargetFramework)' == 'netcoreapp3.0'">$(DefineConstants);BUILDING_INBOX_LIBRARY</DefineConstants> |
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 about netcoreapp3.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.
We don’t build System.Text.Json for netcoreapp3.1 and we shouldn’t need as it has been inbox since netcoreapp3.0.
Also it seems like we shouldn’t need to cross build System.Text.Json for netcoreapp3.0 since it is inbox and the package should just contain an inbox placeholder:
https://github.com/dotnet/runtime/blob/master/src/libraries/pkg/baseline/packageIndex.json#L6253
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.
We should do a pass over all our OOBs at some point and make sure that we only build what's actually necessary. This will help us keep our build configuration and conditions sane.
Hello @ViktorHofer! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
No Merge. Part of batched rollout in May: #35202
Contributes towards dotnet/sdk#10756
Requires dotnet/arcade#5292
I will create a doc after merging this which describes when to use which condition. Basically the recommendation is:
cc @ericstj