Skip to content

Conversation

@ViktorHofer
Copy link
Member

Move common msbuild properties and targets into the repo root.

@trylek I don't really understand the difference between dir.common.props/targets and Directory.Build.props/targets. I think we should clean this up so that only the latter exists and is imported everywhere.

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for cleaning this up. I'll take a look at the extra CoreCLR scripts.

@ViktorHofer
Copy link
Member Author

Had to force push without changing anything (Arcade update wasn't picked up in a retry).

Moving common msbuild properties and targets into the repo root.
Consolidating msbuild analyzers logic centrally in the repo root and
adding a property switch `EnableAnalyzers` to enable analyzers. We
still need to import the Analyzers.props file unconditionally as
libraries currently doesn't use the PackageReference logic in ref and
src projects and instead uses a depproj to create a props file
dynamically.
<AssemblyName>System.Private.CoreLib</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<ExcludeAssemblyInfoPartialFile>true</ExcludeAssemblyInfoPartialFile>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to generate the target framework atrribute in CoreLib? It is just an extra cruft that nobody cares about.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generate the attribute for all assemblies in libraries, even for Private ones like System.Private.Xml. Mainly I did this to follow-up on your comment here: dotnet/corefx#32680 (comment)

Copy link
Member

@jkotas jkotas Nov 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok - I forgot about that discussion. As you can tell, I still wonder why we are generating this cruft for inbox assemblies.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still wonder why we are generating this cruft for inbox assemblies.

It's funny because in the past you mentioned that we should enable it for all - even the inbox ones. I don't have a strong opinion here but I would like to enable this for the sake of consistency. Also I prefer not opting out of the default sdk behavior if there isn't a strong reason.

Also as a side note, I noticed partners taking a dependency on the attribute, ie vstest for test assemblies: https://github.com/microsoft/vstest/blob/7b6248203164f8ea821f6795632bd22e0b69afb0/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs#L67.

Copy link
Member

@jkotas jkotas Nov 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's funny because in the past you mentioned that we should enable it for all - even the inbox ones.

I do not think that I have said that. I have said that if all inbox ones have it, CoreLib should have it too.

vstest for test assemblies:

These are not inbox assemblies. And I believe that this path is .NET Framework specific. I do not think this method will ever execute on .NET Core.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have said that if all inbox ones have it, CoreLib should have it too.

Thanks for clarifying.

And I believe that this path is .NET Framework specific.

I know there was another code path somewhere for .NET Core but I can't find it right now...

Copy link
Member Author

@ViktorHofer ViktorHofer Dec 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you think we should remove the attribute from all inbox assemblies we can do that in a follow-up PR.

@ViktorHofer ViktorHofer merged commit 6afe96c into dotnet:master Dec 1, 2019
@ViktorHofer ViktorHofer deleted the CommonMSBuild branch December 1, 2019 10:01
Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
MichalStrehovsky pushed a commit to MichalStrehovsky/runtime that referenced this pull request Mar 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants