From 3e8e952d58d57505639a842919331946d83b2235 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Fri, 15 Jul 2016 12:44:02 -0400 Subject: [PATCH] [System.Drawing.Primitives] Add System.Drawing.Primitives.dll Facade Xamarin.Android needs to support [.NET Standard 1.6][0], which mentions a [`System.Drawing.Primitives.dll` assembly][1] which has not previously been supported or shipped. `System.Drawing.Primitives.dll` contains `System.Drawing.Point` and related typees, which Xamarin.Android places into `Mono.Android.dll`. Add a new `System.Drawing.Primitives.dll` assembly to use as a *facade assembly*, which contains [type forwarders][2] to "redirect" the types from `System.Drawing.Primitives.dll` to the corresponding types within `Mono.Android.dll`. [0]: https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/libraries [1]: https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md#list-of-net-corefx-apis-and-their-associated-net-platform-standard-version [2]: https://msdn.microsoft.com/en-us/library/ms404275(v=vs.110).aspx --- .gitignore | 1 + Configuration.props | 2 + Makefile | 1 + Xamarin.Android.sln | 11 +++ .../android-toolchain.targets | 12 --- build-tools/scripts/Paths.targets | 22 ++++++ .../Properties/AssemblyInfo.cs | 10 +++ .../System.Drawing.Primitives.csproj | 76 +++++++++++++++++++ tools/scripts/xabuild | 4 +- 9 files changed, 125 insertions(+), 14 deletions(-) create mode 100644 build-tools/scripts/Paths.targets create mode 100644 src/System.Drawing.Primitives/Properties/AssemblyInfo.cs create mode 100644 src/System.Drawing.Primitives/System.Drawing.Primitives.csproj diff --git a/.gitignore b/.gitignore index 10375c2cdec..2ac1238a0a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.userprefs bin Configuration.Override.props +msfinal.pub obj packages .DS_Store diff --git a/Configuration.props b/Configuration.props index 4a5e0874391..4e82ee0ba30 100644 --- a/Configuration.props +++ b/Configuration.props @@ -38,6 +38,8 @@ $([System.IO.Path]::GetFullPath ('$(AndroidMxeInstallPrefix)')) + $([System.IO.Path]::GetFullPath ('$(AndroidNdkDirectory)')) + $([System.IO.Path]::GetFullPath ('$(AndroidSdkDirectory)')) $([System.IO.Path]::GetFullPath ('$(JavaInteropSourceDirectory)')) $([System.IO.Path]::GetFullPath ('$(MonoSourceDirectory)')) $([System.IO.Path]::GetFullPath ('$(SqliteSourceDirectory)')) diff --git a/Makefile b/Makefile index 08bf668b6d3..2205bfa6a44 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ prepare:: nuget restore (cd external/Java.Interop && nuget restore) cp Configuration.Java.Interop.Override.props external/Java.Interop/Configuration.Override.props + cp `$(MSBUILD) /nologo /v:minimal /t:GetMonoSourceFullPath build-tools/scripts/Paths.targets`/mcs/class/msfinal.pub . ifeq ($(OS),Linux) UBUNTU_DEPS = libzip4 curl openjdk-8-jdk git make automake autoconf libtool unzip vim-common clang lib32stdc++6 lib32z1 diff --git a/Xamarin.Android.sln b/Xamarin.Android.sln index 2451e0956c9..6be5d9ad543 100644 --- a/Xamarin.Android.sln +++ b/Xamarin.Android.sln @@ -83,6 +83,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK", "src\OpenTK-1.0\Op EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libZipSharp", "external\LibZipSharp\libZipSharp.csproj", "{E248B2CA-303B-4645-ADDC-9D4459D550FD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Drawing.Primitives", "src\System.Drawing.Primitives\System.Drawing.Primitives.csproj", "{C9FF2E4D-D927-479E-838B-647C16763F64}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|AnyCPU = Debug|AnyCPU @@ -378,6 +380,14 @@ Global {E248B2CA-303B-4645-ADDC-9D4459D550FD}.XAIntegrationDebug|Any CPU.Build.0 = Debug|Any CPU {E248B2CA-303B-4645-ADDC-9D4459D550FD}.XAIntegrationRelease|Any CPU.ActiveCfg = Debug|Any CPU {E248B2CA-303B-4645-ADDC-9D4459D550FD}.XAIntegrationRelease|Any CPU.Build.0 = Debug|Any CPU + {C9FF2E4D-D927-479E-838B-647C16763F64}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU + {C9FF2E4D-D927-479E-838B-647C16763F64}.Debug|AnyCPU.Build.0 = Debug|Any CPU + {C9FF2E4D-D927-479E-838B-647C16763F64}.Release|AnyCPU.ActiveCfg = Release|Any CPU + {C9FF2E4D-D927-479E-838B-647C16763F64}.Release|AnyCPU.Build.0 = Release|Any CPU + {C9FF2E4D-D927-479E-838B-647C16763F64}.XAIntegrationDebug|AnyCPU.ActiveCfg = Debug|Any CPU + {C9FF2E4D-D927-479E-838B-647C16763F64}.XAIntegrationDebug|AnyCPU.Build.0 = Debug|Any CPU + {C9FF2E4D-D927-479E-838B-647C16763F64}.XAIntegrationRelease|AnyCPU.ActiveCfg = Debug|Any CPU + {C9FF2E4D-D927-479E-838B-647C16763F64}.XAIntegrationRelease|AnyCPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {8FF78EB6-6FC8-46A7-8A15-EBBA9045C5FA} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62} @@ -417,6 +427,7 @@ Global {5EB9E888-E357-417E-9F39-DDEC195CE47F} = {04E3E11E-B47D-4599-8AFC-50515A95E715} {900A0F71-BAAD-417A-8D1A-8D330297CDD0} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62} {E248B2CA-303B-4645-ADDC-9D4459D550FD} = {04E3E11E-B47D-4599-8AFC-50515A95E715} + {C9FF2E4D-D927-479E-838B-647C16763F64} = {04E3E11E-B47D-4599-8AFC-50515A95E715} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 diff --git a/build-tools/android-toolchain/android-toolchain.targets b/build-tools/android-toolchain/android-toolchain.targets index b8b67119e3a..b9a0e061e90 100644 --- a/build-tools/android-toolchain/android-toolchain.targets +++ b/build-tools/android-toolchain/android-toolchain.targets @@ -85,18 +85,6 @@ AlwaysCreate="False" /> - - - - - - + + + + + + + + + + + + diff --git a/src/System.Drawing.Primitives/Properties/AssemblyInfo.cs b/src/System.Drawing.Primitives/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..9dbf5a4bee4 --- /dev/null +++ b/src/System.Drawing.Primitives/Properties/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Assembly forwards +[assembly: TypeForwardedTo (typeof (System.Drawing.Point))] +[assembly: TypeForwardedTo (typeof (System.Drawing.PointF))] +[assembly: TypeForwardedTo (typeof (System.Drawing.Rectangle))] +[assembly: TypeForwardedTo (typeof (System.Drawing.RectangleF))] +[assembly: TypeForwardedTo (typeof (System.Drawing.Size))] +[assembly: TypeForwardedTo (typeof (System.Drawing.SizeF))] diff --git a/src/System.Drawing.Primitives/System.Drawing.Primitives.csproj b/src/System.Drawing.Primitives/System.Drawing.Primitives.csproj new file mode 100644 index 00000000000..82307323b1f --- /dev/null +++ b/src/System.Drawing.Primitives/System.Drawing.Primitives.csproj @@ -0,0 +1,76 @@ + + + + Debug + AnyCPU + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {C9FF2E4D-D927-479E-838B-647C16763F64} + Library + System.Drawing + System.Drawing.Primitives + true + + + + $(AndroidFrameworkVersion) + $(MonoSourceFullPath)\mcs\class\mono.pub + + + true + full + false + ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0\Facades + DEBUG; + prompt + 4 + false + false + + + true + ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0\Facades + prompt + 4 + false + false + + + + $(OutputPath)..\mscorlib.dll + False + + + $(OutputPath)..\System.dll + False + + + $(OutputPath)..\System.Core.dll + False + + + $(OutputPath)..\System.Xml.dll + False + + + $(OutputPath)..\Java.Interop.dll + False + + + + + + + + + + {66CF299A-CE95-4131-BCD8-DB66E30C4BF7} + Mono.Android + False + + + {3F1F2F50-AF1A-4A5A-BEDB-193372F068D7} + Xamarin.Android.Build.Tasks + False + + + \ No newline at end of file diff --git a/tools/scripts/xabuild b/tools/scripts/xabuild index 0091396c104..3a8b3a6b0ae 100755 --- a/tools/scripts/xabuild +++ b/tools/scripts/xabuild @@ -9,8 +9,8 @@ export TARGETS_DIR="$topdir/bin/$CONFIGURATION/lib/xbuild" export MSBuildExtensionsPath="$TARGETS_DIR" export MONO_ANDROID_PATH="$topdir/bin/$CONFIGURATION" export XBUILD_FRAMEWORK_FOLDERS_PATH="$topdir/bin/$CONFIGURATION/lib/xbuild-frameworks" -ANDROID_NDK_PATH=$(cd $topdir/build-tools/android-toolchain && xbuild /nologo /v:minimal /t:_GetAndroidNdkDirectory android-toolchain.targets) -ANDROID_SDK_PATH=$(cd $topdir/build-tools/android-toolchain && xbuild /nologo /v:minimal /t:_GetAndroidSdkDirectory android-toolchain.targets) +ANDROID_NDK_PATH=$(xbuild /nologo /v:minimal /t:GetAndroidNdkFullPath $topdir/build-tools/scripts/Paths.targets) +ANDROID_SDK_PATH=$(xbuild /nologo /v:minimal /t:GetAndroidSdkFullPath $topdir/build-tools/scripts/Paths.targets) ANDROID_NDK_PATH=$(echo $ANDROID_NDK_PATH | sed 's/^\w*//g') ANDROID_SDK_PATH=$(echo $ANDROID_SDK_PATH | sed 's/^\w*//g')