diff options
author | Buyaa Namnan <bunamnan@microsoft.com> | 2021-03-31 07:41:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-31 07:41:14 +0300 |
commit | 09f075fff71e8ca0c910d19419a0af8a1179840b (patch) | |
tree | 11dbe998bc75479d98c7fddbd7bf7c0c26a38956 /eng/versioning.targets | |
parent | da23d5a6a45fc4d54a478fd3689789ef3c38ec26 (diff) |
Resolve unknown platform name warnings (#50193)
* Add targets as supported platforms
* Update analyzer version
* Update comment, remove '' != 'false' condition
Diffstat (limited to 'eng/versioning.targets')
-rw-r--r-- | eng/versioning.targets | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/eng/versioning.targets b/eng/versioning.targets index a55fe2407ec..cf0f497a109 100644 --- a/eng/versioning.targets +++ b/eng/versioning.targets @@ -47,17 +47,27 @@ <ItemGroup Condition="('$(TargetsBrowser)' == 'true' or '$(CrossPlatformAndHasNoBrowserTarget)' == 'true') and '$(IsTestProject)' != 'true'"> <SupportedPlatform Include="browser"/> </ItemGroup> - - <!-- Enables warnings for tvOS targeted builds --> - <ItemGroup Condition="'$(TargetstvOS)' == 'true' and '$(IsTestProject)' != 'true'"> - <SupportedPlatform Include="tvos"/> + + <!-- Add target platforms into MSBuild SupportedPlatform list --> + <ItemGroup Condition="'$(TargetsAnyOS)' != 'true' and '$(IsTestProject)' != 'true'"> + <SupportedPlatform Condition="'$(Targetsillumos)' == 'true'" Include="illumos"/> + <SupportedPlatform Condition="'$(TargetsSolaris)' == 'true'" Include="Solaris"/> + <SupportedPlatform Condition="'$(TargetstvOS)' == 'true'" Include="tvOS"/> + <SupportedPlatform Condition="'$(TargetsUnix)' == 'true'" Include="Unix"/> </ItemGroup> <ItemGroup> <_unsupportedOSPlatforms Include="$(UnsupportedOSPlatforms)" /> </ItemGroup> - <Target Name="AddUnsupportedOSPlatformAttribute" BeforeTargets="GenerateAssemblyInfo" AfterTargets="PrepareForBuild" Condition="'@(_unsupportedOSPlatforms)' != '' and '$(IsTestProject)' != 'true' and '$(IncludePlatformAttributes)' != 'false'"> + <!-- Adds UnsupportedOSPlatform attribute to the assembly when: + * At least one <UnsupportedOSPlatforms /> has been specified + * This isn't a test project + * This is a cross-platform target + * The build isn't targeting .NET Framework + --> + <Target Name="AddUnsupportedOSPlatformAttribute" BeforeTargets="GenerateAssemblyInfo" AfterTargets="PrepareForBuild" + Condition="'@(_unsupportedOSPlatforms)' != '' and '$(TargetsAnyOS)' == 'true' and '$(IsTestProject)' != 'true' and '$(TargetFrameworkIdentifier)' != '.NETFramework'"> <ItemGroup> <AssemblyAttribute Include="System.Runtime.Versioning.UnsupportedOSPlatform"> <_Parameter1>%(_unsupportedOSPlatforms.Identity)</_Parameter1> |