<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>$(NetCoreAppToolCurrent);net472</TargetFrameworks>
+ <TargetFrameworks>$(NetCoreAppToolCurrent);$(TargetFrameworkForNETFramework)</TargetFrameworks>
<OutputType>Library</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<ItemGroup>
<Compile Include="MonoAOTCompiler.cs" />
<Compile Include="..\Common\Utils.cs" />
- <Compile Include="..\Common\NotNullAttribute.cs" Condition="$(TargetFramework.StartsWith('net4'))" />
+ <Compile Include="$(RepoRoot)src\libraries\System.Private.CoreLib\src\System\Diagnostics\CodeAnalysis\NullableAttributes.cs" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" />
</ItemGroup>
<ItemGroup>
<Content Include="MonoAOTCompiler.props">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>$(NetCoreAppToolCurrent);net472</TargetFrameworks>
+ <TargetFrameworks>$(NetCoreAppToolCurrent);$(TargetFrameworkForNETFramework)</TargetFrameworks>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn),CA1050</NoWarn>
<!-- Ignore nullable warnings on net4* -->
- <NoWarn Condition="$(TargetFramework.StartsWith('net4'))">$(NoWarn),CS8604,CS8602</NoWarn>
+ <NoWarn Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">$(NoWarn),CS8604,CS8602</NoWarn>
</PropertyGroup>
- <ItemGroup>
- <Compile Include="..\Common\NotNullAttribute.cs" Condition="$(TargetFramework.StartsWith('net4'))" />
+ <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
+ <Compile Include="..\Common\IsExternalInit.cs" />
+ <Compile Include="$(RepoRoot)src\libraries\System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs" />
+ </ItemGroup>
+
+ <ItemGroup>
<PackageReference Include="Microsoft.Build" Version="$(RefOnlyMicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(RefOnlyMicrosoftBuildFrameworkVersion)" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(RefOnlyMicrosoftBuildTasksCoreVersion)" />
<_PublishFramework Include="$(TargetFrameworks)" />
<!-- non-net4* -->
- <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(MSBuildProjectName)*"
- Condition="!$([System.String]::Copy('%(_PublishFramework.Identity)').StartsWith('net4'))"
- TargetPath="tasks\%(_PublishFramework.Identity)" />
- <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\publish\System.Reflection.MetadataLoadContext.dll"
- Condition="!$([System.String]::Copy('%(_PublishFramework.Identity)').StartsWith('net4'))"
- TargetPath="tasks\%(_PublishFramework.Identity)" />
+ <FilesToPackage Include="$(OutputPath)$(NetCoreAppToolCurrent)\$(MSBuildProjectName)*"
+ TargetPath="tasks\$(NetCoreAppToolCurrent)" />
+ <FilesToPackage Include="$(OutputPath)$(NetCoreAppToolCurrent)\publish\System.Reflection.MetadataLoadContext.dll"
+ TargetPath="tasks\$(NetCoreAppToolCurrent)" />
<!-- for net472 we need all the dependent assemblies too, so copy from the publish folder -->
- <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\publish\*"
- Condition="$([System.String]::Copy('%(_PublishFramework.Identity)').StartsWith('net4'))"
- TargetPath="tasks\%(_PublishFramework.Identity)" />
+ <FilesToPackage Include="$(OutputPath)$(TargetFrameworkForNETFramework)\publish\*"
+ TargetPath="tasks\$(TargetFrameworkForNETFramework)" />
</ItemGroup>
</Target>