Skip to content

Commit

Permalink
Drawing: Replace harvested assets with live config
Browse files Browse the repository at this point in the history
Removing the netcoreapp2.0, netstandard2.0 and net461 configurations
of System.Drawing.Common as these aren't built live anymore (harvested).
Replace the netstandard2.0 and net461 harvested asset with live builds
and stop supporting netcoreapp2.x.

Bringing these assets back as the minimum supported set of platforms are
ones that support netstandard2.0 and are still in support.

Contributes to dotnet#47530
  • Loading branch information
ViktorHofer committed Apr 27, 2021
1 parent 5902515 commit d870ebc
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 13 deletions.
6 changes: 6 additions & 0 deletions src/libraries/System.Drawing.Common/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<Import Project="..\Directory.Build.targets" />
<PropertyGroup>
<AssemblyVersion Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">4.0.1.0</AssemblyVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
<ItemGroup>
<ProjectReference Include="..\ref\System.Drawing.Common.csproj">
<SupportedFramework>netcoreapp3.0</SupportedFramework>
<SupportedFramework>netcoreapp3.0;net461</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Drawing.Common.csproj" />
<HarvestIncludePaths Include="runtimes/win/lib/netcoreapp2.0;runtimes/unix/lib/netcoreapp2.0" />
<HarvestIncludePaths Include="ref/netstandard2.0;lib/netstandard2.0" />
<HarvestIncludePaths Include="ref/net461;lib/net461" />
<InboxOnTargetFramework Include="$(AllXamarinFrameworks)" />
<PackageFile Include="buildTransitive\System.Drawing.Common.targets"
TargetPath="buildTransitive\netcoreapp2.0" />
<File Include="$(PlaceHolderFile)"
TargetPath="buildTransitive\netcoreapp3.0" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project InitialTargets="_ValidateSystemDrawingCommonNotNetCoreApp2x">
<Target Name="_ValidateSystemDrawingCommonNotNetCoreApp2x"
Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $(TargetFrameworkVersion.StartsWith('v2.'))">
<Error Condition="'$(SuppressTfmSupportBuildWarnings)' == ''"
Code="SYSLIB9001" Text="System.Drawing.Common doesn't support $(TargetFramework). Consider updating your TargetFramework to netcoreapp3.0 or later." />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.0;netstandard2.0;net461</TargetFrameworks>
<ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
<IncludeInternalObsoleteAttribute>true</IncludeInternalObsoleteAttribute>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<IsPartialFacadeAssembly Condition="'$(TargetFramework)' == 'net461'">true</IsPartialFacadeAssembly>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Drawing.Common.cs" />
<Compile Include="System.Drawing.Common.Forwards.cs" />
<Compile Include="System.Drawing.Common.Forwards.cs" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<Compile Include="System.Drawing.Common.netstandard.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.0'">
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
<ProjectReference Include="..\..\System.Collections.NonGeneric\ref\System.Collections.NonGeneric.csproj" />
<ProjectReference Include="..\..\System.ComponentModel\ref\System.ComponentModel.csproj" />
<ProjectReference Include="..\..\System.ComponentModel.Primitives\ref\System.ComponentModel.Primitives.csproj" />
Expand All @@ -34,4 +39,7 @@
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Numerics.Vectors" Version="$(SystemNumericsVectorsVersion)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------

namespace System.Drawing
{
public static partial class ColorTranslator
{
public static System.Drawing.Color FromHtml(string htmlColor) { throw null; }
public static System.Drawing.Color FromOle(int oleColor) { throw null; }
public static System.Drawing.Color FromWin32(int win32Color) { throw null; }
public static string ToHtml(System.Drawing.Color c) { throw null; }
public static int ToOle(System.Drawing.Color c) { throw null; }
public static int ToWin32(System.Drawing.Color c) { throw null; }
}
public static partial class SystemColors
{
public static System.Drawing.Color ActiveBorder { get { throw null; } }
public static System.Drawing.Color ActiveCaption { get { throw null; } }
public static System.Drawing.Color ActiveCaptionText { get { throw null; } }
public static System.Drawing.Color AppWorkspace { get { throw null; } }
public static System.Drawing.Color ButtonFace { get { throw null; } }
public static System.Drawing.Color ButtonHighlight { get { throw null; } }
public static System.Drawing.Color ButtonShadow { get { throw null; } }
public static System.Drawing.Color Control { get { throw null; } }
public static System.Drawing.Color ControlDark { get { throw null; } }
public static System.Drawing.Color ControlDarkDark { get { throw null; } }
public static System.Drawing.Color ControlLight { get { throw null; } }
public static System.Drawing.Color ControlLightLight { get { throw null; } }
public static System.Drawing.Color ControlText { get { throw null; } }
public static System.Drawing.Color Desktop { get { throw null; } }
public static System.Drawing.Color GradientActiveCaption { get { throw null; } }
public static System.Drawing.Color GradientInactiveCaption { get { throw null; } }
public static System.Drawing.Color GrayText { get { throw null; } }
public static System.Drawing.Color Highlight { get { throw null; } }
public static System.Drawing.Color HighlightText { get { throw null; } }
public static System.Drawing.Color HotTrack { get { throw null; } }
public static System.Drawing.Color InactiveBorder { get { throw null; } }
public static System.Drawing.Color InactiveCaption { get { throw null; } }
public static System.Drawing.Color InactiveCaptionText { get { throw null; } }
public static System.Drawing.Color Info { get { throw null; } }
public static System.Drawing.Color InfoText { get { throw null; } }
public static System.Drawing.Color Menu { get { throw null; } }
public static System.Drawing.Color MenuBar { get { throw null; } }
public static System.Drawing.Color MenuHighlight { get { throw null; } }
public static System.Drawing.Color MenuText { get { throw null; } }
public static System.Drawing.Color ScrollBar { get { throw null; } }
public static System.Drawing.Color Window { get { throw null; } }
public static System.Drawing.Color WindowFrame { get { throw null; } }
public static System.Drawing.Color WindowText { get { throw null; } }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<WarningsNotAsErrors>CS0618</WarningsNotAsErrors>
<DefineConstants Condition="'$(TargetsWindows)' == 'true'">$(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS;FEATURE_SYSTEM_EVENTS</DefineConstants>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netcoreapp3.0-windows;netcoreapp3.0-Unix;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netcoreapp3.0-windows;netcoreapp3.0-Unix;netcoreapp3.0;net461;netstandard2.0</TargetFrameworks>
<ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
<IncludeInternalObsoleteAttribute>true</IncludeInternalObsoleteAttribute>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsAnyOS)' == 'true'">SR.SystemDrawingCommon_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<IncludeInternalObsoleteAttribute Condition="'$(TargetFramework)' != 'net461'">true</IncludeInternalObsoleteAttribute>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsAnyOS)' == 'true' and '$(TargetFramework)' != 'net461'">SR.SystemDrawingCommon_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetsAnyOS)' != 'true'">
<Compile Include="System\Drawing\Bitmap.cs" />
Expand Down Expand Up @@ -360,10 +361,8 @@
<LogicalName>placeholder.ico</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Buffers" />
<Reference Include="System.Collections" />
Expand All @@ -389,4 +388,7 @@
<Reference Include="System.Threading.Thread" />
<Reference Include="System.Text.Encoding.Extensions" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Numerics.Vectors" Version="$(SystemNumericsVectorsVersion)" />
</ItemGroup>
</Project>

0 comments on commit d870ebc

Please sign in to comment.