From 82a1747f86832f9910decb78dad3197ba8a7b8e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 29 Feb 2016 19:16:24 +0100 Subject: [PATCH] Enable building of monotouch and xammac profiles without mono-extensions By using the _opt_.sources file we can specify files that are used when mono-extension is not enabled and add shims for the classes or methods that are missing an implementation in that case. This allows us to build the monotouch and xammac profiles on public Jenkins. --- ...monotouch_tv_opt_Mono.Security.dll.sources | 1 + ...otouch_watch_opt_Mono.Security.dll.sources | 1 + .../xammac_opt_Mono.Security.dll.sources | 4 +++ .../MonoTlsProviderFactory.MonoTouch.opt.cs | 15 +++++++++++ .../System/monotouch_opt_System.dll.sources | 1 + .../monotouch_runtime_opt_System.dll.sources | 1 + .../monotouch_tv_opt_System.dll.sources | 1 + ...onotouch_tv_runtime_opt_System.dll.sources | 1 + .../monotouch_watch_opt_System.dll.sources | 1 + ...touch_watch_runtime_opt_System.dll.sources | 1 + .../xammac_net_4_5_opt_System.dll.sources | 1 + .../System/xammac_opt_System.dll.sources | 1 + .../X509Helper.MonoTouch.opt.cs | 20 +++++++++++++++ .../EncodingHelper.MonoTouch.opt.cs | 15 +++++++++++ .../System/Environment.MonoTouch.opt.cs | 20 +++++++++++++++ mcs/class/corlib/System/Guid.MonoTouch.cs | 25 ------------------- mcs/class/corlib/System/Guid.MonoTouch.opt.cs | 15 +++++++++++ mcs/class/corlib/corlib.dll.sources | 1 - .../corlib/monotouch_opt_corlib.dll.sources | 4 +++ .../monotouch_runtime_opt_corlib.dll.sources | 1 + .../monotouch_tv_opt_corlib.dll.sources | 1 + ...onotouch_tv_runtime_opt_corlib.dll.sources | 1 + .../monotouch_watch_opt_corlib.dll.sources | 1 + ...touch_watch_runtime_opt_corlib.dll.sources | 1 + .../corlib/xammac_opt_corlib.dll.sources | 1 + 25 files changed, 109 insertions(+), 26 deletions(-) create mode 100644 mcs/class/Mono.Security/monotouch_tv_opt_Mono.Security.dll.sources create mode 100644 mcs/class/Mono.Security/monotouch_watch_opt_Mono.Security.dll.sources create mode 100644 mcs/class/Mono.Security/xammac_opt_Mono.Security.dll.sources create mode 100644 mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs create mode 100644 mcs/class/System/monotouch_opt_System.dll.sources create mode 100644 mcs/class/System/monotouch_runtime_opt_System.dll.sources create mode 100644 mcs/class/System/monotouch_tv_opt_System.dll.sources create mode 100644 mcs/class/System/monotouch_tv_runtime_opt_System.dll.sources create mode 100644 mcs/class/System/monotouch_watch_opt_System.dll.sources create mode 100644 mcs/class/System/monotouch_watch_runtime_opt_System.dll.sources create mode 100644 mcs/class/System/xammac_net_4_5_opt_System.dll.sources create mode 100644 mcs/class/System/xammac_opt_System.dll.sources create mode 100644 mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.MonoTouch.opt.cs create mode 100644 mcs/class/corlib/System.Text/EncodingHelper.MonoTouch.opt.cs create mode 100644 mcs/class/corlib/System/Environment.MonoTouch.opt.cs delete mode 100644 mcs/class/corlib/System/Guid.MonoTouch.cs create mode 100644 mcs/class/corlib/System/Guid.MonoTouch.opt.cs create mode 100644 mcs/class/corlib/monotouch_opt_corlib.dll.sources create mode 100644 mcs/class/corlib/monotouch_runtime_opt_corlib.dll.sources create mode 100644 mcs/class/corlib/monotouch_tv_opt_corlib.dll.sources create mode 100644 mcs/class/corlib/monotouch_tv_runtime_opt_corlib.dll.sources create mode 100644 mcs/class/corlib/monotouch_watch_opt_corlib.dll.sources create mode 100644 mcs/class/corlib/monotouch_watch_runtime_opt_corlib.dll.sources create mode 100644 mcs/class/corlib/xammac_opt_corlib.dll.sources diff --git a/mcs/class/Mono.Security/monotouch_tv_opt_Mono.Security.dll.sources b/mcs/class/Mono.Security/monotouch_tv_opt_Mono.Security.dll.sources new file mode 100644 index 00000000000..19d6a0452cc --- /dev/null +++ b/mcs/class/Mono.Security/monotouch_tv_opt_Mono.Security.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_Mono.Security.dll.sources diff --git a/mcs/class/Mono.Security/monotouch_watch_opt_Mono.Security.dll.sources b/mcs/class/Mono.Security/monotouch_watch_opt_Mono.Security.dll.sources new file mode 100644 index 00000000000..19d6a0452cc --- /dev/null +++ b/mcs/class/Mono.Security/monotouch_watch_opt_Mono.Security.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_Mono.Security.dll.sources diff --git a/mcs/class/Mono.Security/xammac_opt_Mono.Security.dll.sources b/mcs/class/Mono.Security/xammac_opt_Mono.Security.dll.sources new file mode 100644 index 00000000000..e8464be185b --- /dev/null +++ b/mcs/class/Mono.Security/xammac_opt_Mono.Security.dll.sources @@ -0,0 +1,4 @@ +./Mono.Security.Cryptography/ARC4Managed.cs +./Mono.Security.Cryptography/MD2Managed.cs +./Mono.Security.Cryptography/MD4Managed.cs +./Mono.Security.Cryptography/SHA224Managed.cs diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs new file mode 100644 index 00000000000..b8c5d6db3e1 --- /dev/null +++ b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs @@ -0,0 +1,15 @@ +#if MONOTOUCH || XAMMAC + +// this file is a shim to enable compiling monotouch profiles without mono-extensions +namespace Mono.Net.Security +{ + static partial class MonoTlsProviderFactory + { + static IMonoTlsProvider CreateDefaultProvider () + { + throw new System.NotSupportedException (); + } + } +} + +#endif diff --git a/mcs/class/System/monotouch_opt_System.dll.sources b/mcs/class/System/monotouch_opt_System.dll.sources new file mode 100644 index 00000000000..68774577148 --- /dev/null +++ b/mcs/class/System/monotouch_opt_System.dll.sources @@ -0,0 +1 @@ +Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs diff --git a/mcs/class/System/monotouch_runtime_opt_System.dll.sources b/mcs/class/System/monotouch_runtime_opt_System.dll.sources new file mode 100644 index 00000000000..54025c51efd --- /dev/null +++ b/mcs/class/System/monotouch_runtime_opt_System.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/monotouch_tv_opt_System.dll.sources b/mcs/class/System/monotouch_tv_opt_System.dll.sources new file mode 100644 index 00000000000..54025c51efd --- /dev/null +++ b/mcs/class/System/monotouch_tv_opt_System.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/monotouch_tv_runtime_opt_System.dll.sources b/mcs/class/System/monotouch_tv_runtime_opt_System.dll.sources new file mode 100644 index 00000000000..54025c51efd --- /dev/null +++ b/mcs/class/System/monotouch_tv_runtime_opt_System.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/monotouch_watch_opt_System.dll.sources b/mcs/class/System/monotouch_watch_opt_System.dll.sources new file mode 100644 index 00000000000..54025c51efd --- /dev/null +++ b/mcs/class/System/monotouch_watch_opt_System.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/monotouch_watch_runtime_opt_System.dll.sources b/mcs/class/System/monotouch_watch_runtime_opt_System.dll.sources new file mode 100644 index 00000000000..54025c51efd --- /dev/null +++ b/mcs/class/System/monotouch_watch_runtime_opt_System.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/xammac_net_4_5_opt_System.dll.sources b/mcs/class/System/xammac_net_4_5_opt_System.dll.sources new file mode 100644 index 00000000000..86ff246428c --- /dev/null +++ b/mcs/class/System/xammac_net_4_5_opt_System.dll.sources @@ -0,0 +1 @@ +#include xammac_opt_System.dll.sources diff --git a/mcs/class/System/xammac_opt_System.dll.sources b/mcs/class/System/xammac_opt_System.dll.sources new file mode 100644 index 00000000000..68774577148 --- /dev/null +++ b/mcs/class/System/xammac_opt_System.dll.sources @@ -0,0 +1 @@ +Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.MonoTouch.opt.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.MonoTouch.opt.cs new file mode 100644 index 00000000000..19f1c4eabb5 --- /dev/null +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.MonoTouch.opt.cs @@ -0,0 +1,20 @@ +#if MONOTOUCH || XAMMAC + +// this file is a shim to enable compiling monotouch profiles without mono-extensions +namespace System.Security.Cryptography.X509Certificates +{ + static partial class X509Helper + { + public static X509CertificateImpl InitFromHandle (IntPtr handle) + { + throw new NotSupportedException (); + } + + public static X509CertificateImpl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags) + { + throw new NotSupportedException (); + } + } +} + +#endif diff --git a/mcs/class/corlib/System.Text/EncodingHelper.MonoTouch.opt.cs b/mcs/class/corlib/System.Text/EncodingHelper.MonoTouch.opt.cs new file mode 100644 index 00000000000..9aba0f63ba1 --- /dev/null +++ b/mcs/class/corlib/System.Text/EncodingHelper.MonoTouch.opt.cs @@ -0,0 +1,15 @@ +#if MONOTOUCH + +// this file is a shim to enable compiling monotouch profiles without mono-extensions +namespace System.Text +{ + internal static partial class EncodingHelper + { + internal static Encoding GetDefaultEncoding () + { + throw new NotSupportedException (); + } + } +} + +#endif diff --git a/mcs/class/corlib/System/Environment.MonoTouch.opt.cs b/mcs/class/corlib/System/Environment.MonoTouch.opt.cs new file mode 100644 index 00000000000..d45de30c05a --- /dev/null +++ b/mcs/class/corlib/System/Environment.MonoTouch.opt.cs @@ -0,0 +1,20 @@ +#if MONOTOUCH + +// this file is a shim to enable compiling monotouch profiles without mono-extensions +namespace System +{ + public static partial class Environment + { + public static string GetFolderPath(SpecialFolder folder, SpecialFolderOption option) + { + throw new NotSupportedException (); + } + + internal static string UnixGetFolderPath (SpecialFolder folder, SpecialFolderOption option) + { + throw new NotSupportedException (); + } + } +} + +#endif diff --git a/mcs/class/corlib/System/Guid.MonoTouch.cs b/mcs/class/corlib/System/Guid.MonoTouch.cs deleted file mode 100644 index 714bdb6f86f..00000000000 --- a/mcs/class/corlib/System/Guid.MonoTouch.cs +++ /dev/null @@ -1,25 +0,0 @@ -#if MONOTOUCH && FULL_AOT_RUNTIME - -using Crimson.CommonCrypto; - -namespace System -{ - partial struct Guid - { - public static Guid NewGuid () - { - byte[] b = new byte [16]; - Cryptor.GetRandom (b); - - Guid res = new Guid (b); - // Mask in Variant 1-0 in Bit[7..6] - res._d = (byte) ((res._d & 0x3fu) | 0x80u); - // Mask in Version 4 (random based Guid) in Bits[15..13] - res._c = (short) ((res._c & 0x0fffu) | 0x4000u); - - return res; - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/corlib/System/Guid.MonoTouch.opt.cs b/mcs/class/corlib/System/Guid.MonoTouch.opt.cs new file mode 100644 index 00000000000..beb6a3a08f1 --- /dev/null +++ b/mcs/class/corlib/System/Guid.MonoTouch.opt.cs @@ -0,0 +1,15 @@ +#if MONOTOUCH && FULL_AOT_RUNTIME + +// this file is a shim to enable compiling monotouch profiles without mono-extensions +namespace System +{ + partial struct Guid + { + public static Guid NewGuid () + { + throw new NotSupportedException (); + } + } +} + +#endif diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index 00cccc2c023..412582e1a3b 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -104,7 +104,6 @@ System/GC.cs System/GCCollectionMode.cs System/GCNotificationStatus.cs System/Guid.cs -System/Guid.MonoTouch.cs System/IConsoleDriver.cs System/IntPtr.cs System/KnownTerminals.cs diff --git a/mcs/class/corlib/monotouch_opt_corlib.dll.sources b/mcs/class/corlib/monotouch_opt_corlib.dll.sources new file mode 100644 index 00000000000..be231efa3a5 --- /dev/null +++ b/mcs/class/corlib/monotouch_opt_corlib.dll.sources @@ -0,0 +1,4 @@ +System/Environment.MonoTouch.opt.cs +System/Guid.MonoTouch.opt.cs +System.Text/EncodingHelper.MonoTouch.opt.cs +System.Security.Cryptography.X509Certificates/X509Helper.MonoTouch.opt.cs diff --git a/mcs/class/corlib/monotouch_runtime_opt_corlib.dll.sources b/mcs/class/corlib/monotouch_runtime_opt_corlib.dll.sources new file mode 100644 index 00000000000..d32b5060240 --- /dev/null +++ b/mcs/class/corlib/monotouch_runtime_opt_corlib.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_corlib.dll.sources diff --git a/mcs/class/corlib/monotouch_tv_opt_corlib.dll.sources b/mcs/class/corlib/monotouch_tv_opt_corlib.dll.sources new file mode 100644 index 00000000000..d32b5060240 --- /dev/null +++ b/mcs/class/corlib/monotouch_tv_opt_corlib.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_corlib.dll.sources diff --git a/mcs/class/corlib/monotouch_tv_runtime_opt_corlib.dll.sources b/mcs/class/corlib/monotouch_tv_runtime_opt_corlib.dll.sources new file mode 100644 index 00000000000..d32b5060240 --- /dev/null +++ b/mcs/class/corlib/monotouch_tv_runtime_opt_corlib.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_corlib.dll.sources diff --git a/mcs/class/corlib/monotouch_watch_opt_corlib.dll.sources b/mcs/class/corlib/monotouch_watch_opt_corlib.dll.sources new file mode 100644 index 00000000000..d32b5060240 --- /dev/null +++ b/mcs/class/corlib/monotouch_watch_opt_corlib.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_corlib.dll.sources diff --git a/mcs/class/corlib/monotouch_watch_runtime_opt_corlib.dll.sources b/mcs/class/corlib/monotouch_watch_runtime_opt_corlib.dll.sources new file mode 100644 index 00000000000..d32b5060240 --- /dev/null +++ b/mcs/class/corlib/monotouch_watch_runtime_opt_corlib.dll.sources @@ -0,0 +1 @@ +#include monotouch_opt_corlib.dll.sources diff --git a/mcs/class/corlib/xammac_opt_corlib.dll.sources b/mcs/class/corlib/xammac_opt_corlib.dll.sources new file mode 100644 index 00000000000..449e2520dde --- /dev/null +++ b/mcs/class/corlib/xammac_opt_corlib.dll.sources @@ -0,0 +1 @@ +System.Security.Cryptography.X509Certificates/X509Helper.MonoTouch.opt.cs -- 2.25.1