You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should try and limit the usage of $(OS) property in all the targets files. In places we need it we should use it in a limited fashion to setup other properties like RunningOnUnix/Windows and we should use that as the conditions in all our targets.
I think we should be able to all of these patterns with a few properties:
RunningOnCore : This is determined by MSBuildRuntimeType. This should only control MSBuild-related stuff, like the path to the task assembly being used, or which Roslyn props file is imported (different behavior on .NET Core).
RunningOnUnix: This will be used to control things like path separators, environment variable syntax, executable file suffix, etc. which are the same everywhere except for Windows. This is determined by the value of OS. Any value other than Windows_NT will result in RunningOnUnix being set to true.
OSGroup: This should be able to supplant all other uses of OS, OSEnvironment, and TargetOS. This property is already defaulted to the correct value (based on the local environment) if it is not set.
I'm going to try to take a crack at cleaning our targets above following the above plan. A goal will be to allow using .NET Core MSBuild on Windows, at least as a proof of concept.
I experimented a bit. I believe we do need to keep around TargetOS. The problem is that OSGroup doesn't actually represent the OS you are running on, but rather the build configuration you are building for. Most of the time, it is just AnyOS, because most tests are not different per-platform. So we do need the TargetOS property to differentiate.
We should try and limit the usage of $(OS) property in all the targets files. In places we need it we should use it in a limited fashion to setup other properties like RunningOnUnix/Windows and we should use that as the conditions in all our targets.
Examples we should clean-up.
test.targets (https://github.com/dotnet/corefx/pull/15177/files#diff-b8c5f6b5d9e571e8187355199b2a1680R33), in this case we should use TargetOS.
https://github.com/dotnet/corefx/blob/master/Tools-Override/ConstructSharedFx.targets#L25
We should grep through all our targets files and update them in a consistent manner.
The text was updated successfully, but these errors were encountered: