From ede5563100d85e3524a386332423ddae43885817 Mon Sep 17 00:00:00 2001 From: Shimmy Weitzhandler <2716316+weitzhandler@users.noreply.github.com> Date: Wed, 12 Jun 2019 05:15:18 +0300 Subject: [PATCH 01/13] Initial commit --- .editorconfig | 7 + .../CuncurrencyAbstractionLayerWasmImpl.cs | 246 ++++++++++++++++++ ...PlatformEnlightenmentProviderExtensions.cs | 23 ++ .../System.Reactive/Internal/StopwatchImpl.cs | 25 ++ .../src/System.Reactive/Internal/Stubs.cs | 30 +++ .../WasmPlatformEnlightenmentProvider.cs | 60 +++++ .../System.Reactive/Internal/WasmScheduler.cs | 183 +++++++++++++ .../System.Reactive.Wasm.csproj | 19 ++ System.Reactive.Wasm.sln | 25 ++ 9 files changed, 618 insertions(+) create mode 100644 .editorconfig create mode 100644 Rx.NET/Source/src/System.Reactive/Concurrency/CuncurrencyAbstractionLayerWasmImpl.cs create mode 100644 Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProviderExtensions.cs create mode 100644 Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs create mode 100644 Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs create mode 100644 Rx.NET/Source/src/System.Reactive/Internal/WasmPlatformEnlightenmentProvider.cs create mode 100644 Rx.NET/Source/src/System.Reactive/Internal/WasmScheduler.cs create mode 100644 Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj create mode 100644 System.Reactive.Wasm.sln diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..12900d6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +# To learn more about .editorconfig see https://aka.ms/editorconfigdocs +root = true + +# All files +[*] +indent_style = space +indent_size = 4 diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/CuncurrencyAbstractionLayerWasmImpl.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/CuncurrencyAbstractionLayerWasmImpl.cs new file mode 100644 index 0000000..9e7b532 --- /dev/null +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/CuncurrencyAbstractionLayerWasmImpl.cs @@ -0,0 +1,246 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +#if !NO_THREAD +using System.Collections.Generic; +using System.Reactive.Disposables; +using System.Threading; + +namespace System.Reactive.Concurrency +{ + // + // WARNING: This code is kept *identically* in two places. One copy is kept in System.Reactive.Core for non-PLIB platforms. + // Another copy is kept in System.Reactive.PlatformServices to enlighten the default lowest common denominator + // behavior of Rx for PLIB when used on a more capable platform. + // + internal class /*Default*/ConcurrencyAbstractionLayerWasmImpl : IConcurrencyAbstractionLayer + { + public IDisposable StartTimer(Action action, object state, TimeSpan dueTime) => new Timer(action, state, Normalize(dueTime)); + + public IDisposable StartPeriodicTimer(Action action, TimeSpan period) + { + if (period < TimeSpan.Zero) + throw new ArgumentOutOfRangeException(nameof(period)); + + // + // The contract for periodic scheduling in Rx is that specifying TimeSpan.Zero as the period causes the scheduler to + // call back periodically as fast as possible, sequentially. + // + if (period == TimeSpan.Zero) + { + return new FastPeriodicTimer(action); + } + else + { + return new PeriodicTimer(action, period); + } + } + + public IDisposable QueueUserWorkItem(Action action, object state) + { + System.Threading.ThreadPool.QueueUserWorkItem(_ => action(_), state); + return Disposable.Empty; + } + + public void Sleep(TimeSpan timeout) => System.Threading.Thread.Sleep(Normalize(timeout)); + + public IStopwatch StartStopwatch() => new StopwatchImpl(); + + public bool SupportsLongRunning => false; + + public void StartThread(Action action, object state) + { + new Thread(() => + { + action(state); + }) + { IsBackground = true }.Start(); + } + + private static TimeSpan Normalize(TimeSpan dueTime) => dueTime < TimeSpan.Zero ? TimeSpan.Zero : dueTime; + + // + // Some historical context. In the early days of Rx, we discovered an issue with + // the rooting of timers, causing them to get GC'ed even when the IDisposable of + // a scheduled activity was kept alive. The original code simply created a timer + // as follows: + // + // var t = default(Timer); + // t = new Timer(_ => + // { + // t = null; + // Debug.WriteLine("Hello!"); + // }, null, 5000, Timeout.Infinite); + // + // IIRC the reference to "t" captured by the closure wasn't sufficient on .NET CF + // to keep the timer rooted, causing problems on Windows Phone 7. As a result, we + // added rooting code using a dictionary (SD 7280), which we carried forward all + // the way to Rx v2.0 RTM. + // + // However, the desktop CLR's implementation of System.Threading.Timer exhibits + // other characteristics where a timer can root itself when the timer is still + // reachable through the state or callback parameters. To illustrate this, run + // the following piece of code: + // + // static void Main() + // { + // Bar(); + // + // while (true) + // { + // GC.Collect(); + // GC.WaitForPendingFinalizers(); + // Thread.Sleep(100); + // } + // } + // + // static void Bar() + // { + // var t = default(Timer); + // t = new Timer(_ => + // { + // t = null; // Comment out this line to see the timer stop + // Console.WriteLine("Hello!"); + // }, null, 5000, Timeout.Infinite); + // } + // + // When the closure over "t" is removed, the timer will stop automatically upon + // garbage collection. However, when retaining the reference, this problem does + // not exist. The code below exploits this behavior, avoiding unnecessary costs + // to root timers in a thread-safe manner. + // + // Below is a fragment of SOS output, proving the proper rooting: + // + // !gcroot 02492440 + // HandleTable: + // 005a13fc (pinned handle) + // -> 03491010 System.Object[] + // -> 024924dc System.Threading.TimerQueue + // -> 02492450 System.Threading.TimerQueueTimer + // -> 02492420 System.Threading.TimerCallback + // -> 02492414 TimerRootingExperiment.Program+<>c__DisplayClass1 + // -> 02492440 System.Threading.Timer + // + // With the USE_TIMER_SELF_ROOT symbol, we shake off this additional rooting code + // for newer platforms where this no longer needed. We checked this on .NET Core + // as well as .NET 4.0, and only #define this symbol for those platforms. + // + // NB: 4/13/2017 - All target platforms for the 4.x release have the self-rooting + // behavior described here, so we removed the USE_TIMER_SELF_ROOT + // symbol. + // + + private sealed class Timer : IDisposable + { + private Action _action; + private volatile System.Threading.Timer _timer; + + public Timer(Action action, object state, TimeSpan dueTime) + { + _action = action; + + // Don't want the spin wait in Tick to get stuck if this thread gets aborted. + try { } + finally + { + // + // Rooting of the timer happens through the this.Tick delegate's target object, + // which is the current instance and has a field to store the Timer instance. + // + _timer = new System.Threading.Timer(Tick, state, dueTime, TimeSpan.FromMilliseconds(System.Threading.Timeout.Infinite)); + } + } + + private void Tick(object state) + { + try + { + _action(state); + } + finally + { + SpinWait.SpinUntil(IsTimerAssigned); + Dispose(); + } + } + + private bool IsTimerAssigned() => _timer != null; + + public void Dispose() + { + var timer = _timer; + if (timer != TimerStubs.Never) + { + _action = Stubs.Ignore; + _timer = TimerStubs.Never; + + timer.Dispose(); + } + } + } + + private sealed class PeriodicTimer : IDisposable + { + private Action _action; + private volatile System.Threading.Timer _timer; + + public PeriodicTimer(Action action, TimeSpan period) + { + _action = action; + + // + // Rooting of the timer happens through the this.Tick delegate's target object, + // which is the current instance and has a field to store the Timer instance. + // + _timer = new System.Threading.Timer(Tick, null, period, period); + } + + private void Tick(object state) => _action(); + + public void Dispose() + { + var timer = _timer; + if (timer != null) + { + _action = Stubs.Nop; + _timer = null; + + timer.Dispose(); + } + } + } + + private sealed class FastPeriodicTimer : IDisposable + { + private readonly Action _action; + private volatile bool disposed; + + public FastPeriodicTimer(Action action) + { + _action = action; + + new System.Threading.Thread(Loop) + { + Name = "Rx-FastPeriodicTimer", + IsBackground = true + } + .Start(); + } + + private void Loop() + { + while (!disposed) + { + _action(); + } + } + + public void Dispose() + { + disposed = true; + } + } + } +} +#endif \ No newline at end of file diff --git a/Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProviderExtensions.cs b/Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProviderExtensions.cs new file mode 100644 index 0000000..9de7e2f --- /dev/null +++ b/Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProviderExtensions.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace System.Reactive.PlatformServices +{ + public static class PlatformEnlightenmentProviderExtensions + { + /// + /// Sets the to the one. + /// +#pragma warning disable IDE0060 + public static void EnableWasm(this IPlatformEnlightenmentProvider provider) +#pragma warning restore IDE0060 // Remove unused parameter + { +#pragma warning disable CS0618 // Type or member is obsolete + PlatformEnlightenmentProvider.Current = new WasmPlatformEnlightenmentProvider(); +#pragma warning restore CS0618 // Type or member is obsolete + } + + + } +} diff --git a/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs b/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs new file mode 100644 index 0000000..e23382c --- /dev/null +++ b/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +using System.Diagnostics; + +namespace System.Reactive.Concurrency +{ + // + // WARNING: This code is kept *identically* in two places. One copy is kept in System.Reactive.Core for non-PLIB platforms. + // Another copy is kept in System.Reactive.PlatformServices to enlighten the default lowest common denominator + // behavior of Rx for PLIB when used on a more capable platform. + // + internal class /*Default*/StopwatchImpl : IStopwatch + { + private readonly Stopwatch _sw; + + public StopwatchImpl() + { + _sw = Stopwatch.StartNew(); + } + + public TimeSpan Elapsed => _sw.Elapsed; + } +} diff --git a/Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs b/Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs new file mode 100644 index 0000000..9282348 --- /dev/null +++ b/Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +namespace System.Reactive +{ + internal static class Stubs + { + public static readonly Action Ignore = _ => { }; + public static readonly Func I = _ => _; + } + + internal static class Stubs + { + public static readonly Action Nop = () => { }; + //public static readonly Action Throw = ex => { ex.Throw(); }; + } + +#if !NO_THREAD + internal static class TimerStubs + { +#if NETSTANDARD1_3 + public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); +#else + public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }); +#endif + } +#endif +} + diff --git a/Rx.NET/Source/src/System.Reactive/Internal/WasmPlatformEnlightenmentProvider.cs b/Rx.NET/Source/src/System.Reactive/Internal/WasmPlatformEnlightenmentProvider.cs new file mode 100644 index 0000000..9c3e021 --- /dev/null +++ b/Rx.NET/Source/src/System.Reactive/Internal/WasmPlatformEnlightenmentProvider.cs @@ -0,0 +1,60 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +// +// WARNING: The full namespace-qualified type name should stay the same for the discovery in System.Reactive.Core to work! +// +using System.ComponentModel; +using System.Diagnostics; +using System.Reactive.Concurrency; +using System.Reactive.Linq; +using System.Reflection; +using System.Runtime.InteropServices; + +namespace System.Reactive.PlatformServices +{ + /// + /// (Infrastructure) Provider for platform-specific framework enlightenments. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentProvider + { + private readonly static bool _isWasm = RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY")); + + /// + /// (Infastructure) Tries to gets the specified service. + /// + /// Service type. + /// Optional set of arguments. + /// Service instance or null if not found. + public override T GetService(object[] args) //where T : class + { + var t = typeof(T); + +#if !NO_THREAD || WINDOWS + if (t == typeof(IConcurrencyAbstractionLayer)) + { +#if NETSTANDARD2_0 + if (_isWasm) + { + return (T)(object)new ConcurrencyAbstractionLayerWasmImpl(); + } +#endif + } +#endif + + if (t == typeof(IScheduler) && args != null) + { +#if NETSTANDARD2_0 + if (_isWasm) + { + return (T)(object)WasmScheduler.Default; + } +#endif + } + + return base.GetService(args); + } + } +} \ No newline at end of file diff --git a/Rx.NET/Source/src/System.Reactive/Internal/WasmScheduler.cs b/Rx.NET/Source/src/System.Reactive/Internal/WasmScheduler.cs new file mode 100644 index 0000000..65abd35 --- /dev/null +++ b/Rx.NET/Source/src/System.Reactive/Internal/WasmScheduler.cs @@ -0,0 +1,183 @@ +#if NETSTANDARD2_0 +using System; +using System.Collections.Generic; +using System.Reactive.Concurrency; +using System.Reactive.Disposables; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace System.Reactive.Concurrency +{ + class WasmScheduler : LocalScheduler, ISchedulerPeriodic + { + private static Lazy s_default = new Lazy(() => new WasmScheduler()); + + // Import from https://github.com/mono/mono/blob/0a8126c2094d2d0800a462d4d0c790d4db421477/mcs/class/corlib/System.Threading/Timer.cs#L39 + internal static class WasmRuntime + { + static Dictionary callbacks; + static int next_id; + + [MethodImplAttribute(MethodImplOptions.InternalCall)] + static extern void SetTimeout(int timeout, int id); + + internal static void ScheduleTimeout(int timeout, Action action) + { + if (callbacks == null) + { + callbacks = new Dictionary(); + } + + int id = ++next_id; + callbacks[id] = action; + SetTimeout(timeout, id); + } + + //XXX Keep this in sync with mini-wasm.c:mono_set_timeout_exec + static void TimeoutCallback(int id) + { + var cb = callbacks[id]; + callbacks.Remove(id); + cb(); + } + } + + /// + /// Constructs a WasmScheduler that schedules units of work on the Windows ThreadPool. + /// + public WasmScheduler() + { + } + + /// + /// Gets the singleton instance of the Windows Runtime thread pool scheduler. + /// + public static WasmScheduler Default + { + get + { + return s_default.Value; + } + } + + /// + /// Schedules an action to be executed. + /// + /// The type of the state passed to the scheduled action. + /// State passed to the action to be executed. + /// Action to be executed. + /// The disposable object used to cancel the scheduled action (best effort). + /// is null. + public override IDisposable Schedule(TState state, Func action) + { + if (action == null) + { + throw new ArgumentNullException("action"); + } + + var d = new SingleAssignmentDisposable(); + + WasmRuntime.ScheduleTimeout(0, () => + { + if (!d.IsDisposed) + { + d.Disposable = action(this, state); + } + }); + + return d; + } + + /// + /// Schedules a periodic piece of work, using a Windows.System.Threading.ThreadPoolTimer object. + /// + /// The type of the state passed to the scheduled action. + /// Initial state passed to the action upon the first iteration. + /// Period for running the work periodically. + /// Action to be executed, potentially updating the state. + /// The disposable object used to cancel the scheduled recurring action (best effort). + /// is null. + /// is less than one millisecond. + public IDisposable SchedulePeriodic(TState state, TimeSpan period, Func action) + { + // + // The WinRT thread pool is based on the Win32 thread pool and cannot handle + // sub-1ms resolution. When passing a lower period, we get single-shot + // timer behavior instead. See MSDN documentation for CreatePeriodicTimer + // for more information. + // + if (period < TimeSpan.FromMilliseconds(1)) + { + throw new ArgumentOutOfRangeException("period", "The WinRT thread pool doesn't support creating periodic timers with a period below 1 millisecond."); + } + + if (action == null) + { + throw new ArgumentNullException("action"); + } + + var state1 = state; + var gate = new AsyncLock(); + + WasmRuntime.ScheduleTimeout( + (int)period.TotalMilliseconds, + () => + { + Action run = null; + + run = () => + { + gate.Wait(() => + { + state1 = action(state1); + + WasmRuntime.ScheduleTimeout( + (int)period.TotalMilliseconds, + run + ); + }); + }; + } + ); + + return Disposable.Create(() => + { + gate.Dispose(); + action = Stubs.I; + }); + } + + public override IDisposable Schedule(TState state, TimeSpan dueTime, Func action) + { + if (action == null) + { + throw new ArgumentNullException("action"); + } + + var dt = Scheduler.Normalize(dueTime); + + if (dt.Ticks == 0) + { + return Schedule(state, action); + } + + var d = new SingleAssignmentDisposable(); + + WasmRuntime.ScheduleTimeout( + (int)dt.TotalMilliseconds, + () => + { + if (!d.IsDisposed) + { + d.Disposable = action(this, state); + } + } + ); + + return d; + } + } +} +#endif \ No newline at end of file diff --git a/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj b/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj new file mode 100644 index 0000000..52f0a6b --- /dev/null +++ b/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj @@ -0,0 +1,19 @@ + + + + netstandard2.0 + true + Rx.Uno.Wasm + 0.1.0 + nventive, shimmy + Rx.Uno.Wasm + Uno Wasm implementation for System.Reactive + MIT + https://github.com/weitzhandler/System.Reactive.Wasm + + + + + + + diff --git a/System.Reactive.Wasm.sln b/System.Reactive.Wasm.sln new file mode 100644 index 0000000..a6723ce --- /dev/null +++ b/System.Reactive.Wasm.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29001.49 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive.Wasm", "Rx.NET\Source\src\System.Reactive\System.Reactive.Wasm.csproj", "{8B20B249-86A7-4FE5-96F7-A8479225B2F3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8B20B249-86A7-4FE5-96F7-A8479225B2F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B20B249-86A7-4FE5-96F7-A8479225B2F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B20B249-86A7-4FE5-96F7-A8479225B2F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B20B249-86A7-4FE5-96F7-A8479225B2F3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1C13D26C-1DEA-4041-A59B-AC127980BBFB} + EndGlobalSection +EndGlobal From fc1866ecdd93b07554bd0a9aa83888f5145a8229 Mon Sep 17 00:00:00 2001 From: Shimmy Weitzhandler <2716316+weitzhandler@users.noreply.github.com> Date: Wed, 12 Jun 2019 08:22:16 +0300 Subject: [PATCH 02/13] Updated NuGet version --- Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj b/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj index 52f0a6b..3f1a364 100644 --- a/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj +++ b/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj @@ -4,7 +4,7 @@ netstandard2.0 true Rx.Uno.Wasm - 0.1.0 + 1.0.0-alpha nventive, shimmy Rx.Uno.Wasm Uno Wasm implementation for System.Reactive From 888edf0ba6b467785d0a0dfe69197ff77a8c4dda Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Thu, 13 Jun 2019 16:31:36 +1000 Subject: [PATCH 03/13] housekeeping: Change the code to match ReactiveUI standards, add build scripts --- .editorconfig | 152 ++++++++- .gitattributes | 289 ++++++++++++++++++ .gitignore | 133 ++------ LICENSE | 6 +- .../System.Reactive/Internal/StopwatchImpl.cs | 25 -- .../src/System.Reactive/Internal/Stubs.cs | 30 -- .../System.Reactive.Wasm.csproj | 19 -- azure-pipelines.yml | 19 ++ build.cake | 25 ++ build.cmd | 2 + build.config | 2 + build.ps1 | 112 +++++++ build.sh | 51 ++++ cake.config | 7 + src/ApiGeneratorGlobalSuppressions.cs | 161 ++++++++++ src/Directory.build.props | 61 ++++ src/Directory.build.targets | 30 ++ .../System.Reactive.Wasm.sln | 15 +- .../ConcurrencyAbstractionLayerWasmImpl.cs | 95 +++--- ...PlatformEnlightenmentProviderExtensions.cs | 13 +- .../Internal/StopwatchImpl.cs | 24 ++ src/System.Reactive.Wasm/Internal/Stubs.cs | 23 ++ .../Internal/TimerStubs.cs | 16 + .../WasmPlatformEnlightenmentProvider.cs | 17 +- .../Internal/WasmScheduler.cs | 138 ++++----- .../System.Reactive.Wasm.csproj | 13 + src/analyzers.ruleset | 280 +++++++++++++++++ src/analyzers.tests.ruleset | 284 +++++++++++++++++ src/global.json | 5 + src/stylecop.json | 41 +++ version.json | 17 ++ 31 files changed, 1780 insertions(+), 325 deletions(-) create mode 100644 .gitattributes delete mode 100644 Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs delete mode 100644 Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs delete mode 100644 Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj create mode 100644 azure-pipelines.yml create mode 100644 build.cake create mode 100644 build.cmd create mode 100644 build.config create mode 100644 build.ps1 create mode 100644 build.sh create mode 100644 cake.config create mode 100644 src/ApiGeneratorGlobalSuppressions.cs create mode 100644 src/Directory.build.props create mode 100644 src/Directory.build.targets rename System.Reactive.Wasm.sln => src/System.Reactive.Wasm.sln (56%) rename Rx.NET/Source/src/System.Reactive/Concurrency/CuncurrencyAbstractionLayerWasmImpl.cs => src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs (90%) rename {Rx.NET/Source/src/System.Reactive => src/System.Reactive.Wasm}/Internal/PlatformEnlightenmentProviderExtensions.cs (59%) create mode 100644 src/System.Reactive.Wasm/Internal/StopwatchImpl.cs create mode 100644 src/System.Reactive.Wasm/Internal/Stubs.cs create mode 100644 src/System.Reactive.Wasm/Internal/TimerStubs.cs rename {Rx.NET/Source/src/System.Reactive => src/System.Reactive.Wasm}/Internal/WasmPlatformEnlightenmentProvider.cs (78%) rename {Rx.NET/Source/src/System.Reactive => src/System.Reactive.Wasm}/Internal/WasmScheduler.cs (62%) create mode 100644 src/System.Reactive.Wasm/System.Reactive.Wasm.csproj create mode 100644 src/analyzers.ruleset create mode 100644 src/analyzers.tests.ruleset create mode 100644 src/global.json create mode 100644 src/stylecop.json create mode 100644 version.json diff --git a/.editorconfig b/.editorconfig index 12900d6..8a7cddf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,155 @@ -# To learn more about .editorconfig see https://aka.ms/editorconfigdocs +# editorconfig.org + +# top-most EditorConfig file root = true -# All files +# Default settings: +# A newline ending every file +# Use 4 spaces as indentation [*] +insert_final_newline = true indent_style = space indent_size = 4 + +[project.json] +indent_size = 2 + +# C# files +[*.cs] +# New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current + +# avoid this. unless absolutely necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# only use var when it's obvious what the variable type is +csharp_style_var_for_built_in_types = false:none +csharp_style_var_when_type_is_apparent = false:suggestion +csharp_style_var_elsewhere = false:suggestion + +# use language keywords instead of BCL types +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# name all constant fields using PascalCase +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# static fields should have s_ prefix +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static + +dotnet_naming_style.static_prefix_style.capitalization = camel_case + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style + +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal + +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + +# Code style defaults +dotnet_sort_system_directives_first = true +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false + +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_methods = false:none +csharp_style_expression_bodied_constructors = false:none +csharp_style_expression_bodied_operators = false:none +csharp_style_expression_bodied_properties = true:suggestion +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Pattern matching +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion + +# Null checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = do_not_ignore +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# C++ Files +[*.{cpp,h,in}] +curly_bracket_next_line = true +indent_brace_style = Allman + +# Xml project files +[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] +indent_size = 2 + +# Xml build files +[*.builds] +indent_size = 2 + +# Xml files +[*.{xml,stylecop,resx,ruleset}] +indent_size = 2 + +# Xml config files +[*.{props,targets,config,nuspec}] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf +[*.{cmd, bat}] +end_of_line = crlf \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5044446 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,289 @@ +# Catch all for anything we forgot. Add rules if you get CRLF to LF warnings. +* text=auto + +# Text files that should be normalized to LF in odb. +*.cs text eol=lf diff=csharp +*.xaml text +*.config text +*.c text +*.h text +*.cpp text +*.hpp text +*.sln text +*.csproj text +*.vcxproj text +*.md text +*.tt text +*.sh text +*.ps1 text +*.cmd text +*.bat text +*.markdown text +*.msbuild text +# Binary files that should not be normalized or diffed +*.png binary +*.jpg binary +*.gif binary +*.ico binary +*.rc binary +*.pfx binary +*.snk binary +*.dll binary +*.exe binary +*.lib binary +*.exp binary +*.pdb binary +*.sdf binary +*.7z binary +# Generated file should just use CRLF, it's fiiine +SolutionInfo.cs text eol=crlf diff=csharp +*.mht filter=lfs diff=lfs merge=lfs -text +*.ppam filter=lfs diff=lfs merge=lfs -text +*.wmv filter=lfs diff=lfs merge=lfs -text +*.btif filter=lfs diff=lfs merge=lfs -text +*.fla filter=lfs diff=lfs merge=lfs -text +*.qt filter=lfs diff=lfs merge=lfs -text +*.xlam filter=lfs diff=lfs merge=lfs -text +*.xm filter=lfs diff=lfs merge=lfs -text +*.djvu filter=lfs diff=lfs merge=lfs -text +*.woff filter=lfs diff=lfs merge=lfs -text +*.a filter=lfs diff=lfs merge=lfs -text +*.bak filter=lfs diff=lfs merge=lfs -text +*.lha filter=lfs diff=lfs merge=lfs -text +*.mpg filter=lfs diff=lfs merge=lfs -text +*.xltm filter=lfs diff=lfs merge=lfs -text +*.eol filter=lfs diff=lfs merge=lfs -text +*.ipa filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.uvm filter=lfs diff=lfs merge=lfs -text +*.cmx filter=lfs diff=lfs merge=lfs -text +*.dng filter=lfs diff=lfs merge=lfs -text +*.xltx filter=lfs diff=lfs merge=lfs -text +*.fli filter=lfs diff=lfs merge=lfs -text +*.wmx filter=lfs diff=lfs merge=lfs -text +*.jxr filter=lfs diff=lfs merge=lfs -text +*.pyv filter=lfs diff=lfs merge=lfs -text +*.s7z filter=lfs diff=lfs merge=lfs -text +*.csv filter=lfs diff=lfs merge=lfs -text +*.pptm filter=lfs diff=lfs merge=lfs -text +*.rz filter=lfs diff=lfs merge=lfs -text +*.wm filter=lfs diff=lfs merge=lfs -text +*.xlsx filter=lfs diff=lfs merge=lfs -text +*.bh filter=lfs diff=lfs merge=lfs -text +*.dat filter=lfs diff=lfs merge=lfs -text +*.mid filter=lfs diff=lfs merge=lfs -text +*.mpga filter=lfs diff=lfs merge=lfs -text +*.ogg filter=lfs diff=lfs merge=lfs -text +*.s3m filter=lfs diff=lfs merge=lfs -text +*.mar filter=lfs diff=lfs merge=lfs -text +*.movie filter=lfs diff=lfs merge=lfs -text +*.pptx filter=lfs diff=lfs merge=lfs -text +*.dll filter=lfs diff=lfs merge=lfs -text +*.docm filter=lfs diff=lfs merge=lfs -text +*.m3u filter=lfs diff=lfs merge=lfs -text +*.mov filter=lfs diff=lfs merge=lfs -text +*.aac filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.midi filter=lfs diff=lfs merge=lfs -text +*.mobi filter=lfs diff=lfs merge=lfs -text +*.potm filter=lfs diff=lfs merge=lfs -text +*.woff2 filter=lfs diff=lfs merge=lfs -text +*.cab filter=lfs diff=lfs merge=lfs -text +*.dmg filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.war filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.icns filter=lfs diff=lfs merge=lfs -text +*.slk filter=lfs diff=lfs merge=lfs -text +*.wbmp filter=lfs diff=lfs merge=lfs -text +*.xpm filter=lfs diff=lfs merge=lfs -text +*.xmind filter=lfs diff=lfs merge=lfs -text +*.3g2 filter=lfs diff=lfs merge=lfs -text +*.m4v filter=lfs diff=lfs merge=lfs -text +*.pic filter=lfs diff=lfs merge=lfs -text +*.uvi filter=lfs diff=lfs merge=lfs -text +*.uvp filter=lfs diff=lfs merge=lfs -text +*.xls filter=lfs diff=lfs merge=lfs -text +*.jpgv filter=lfs diff=lfs merge=lfs -text +*.mka filter=lfs diff=lfs merge=lfs -text +*.swf filter=lfs diff=lfs merge=lfs -text +*.uvs filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text +*.ecelp4800 filter=lfs diff=lfs merge=lfs -text +*.mng filter=lfs diff=lfs merge=lfs -text +*.pps filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.arj filter=lfs diff=lfs merge=lfs -text +*.lzh filter=lfs diff=lfs merge=lfs -text +*.raw filter=lfs diff=lfs merge=lfs -text +*.rlc filter=lfs diff=lfs merge=lfs -text +*.sgi filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.au filter=lfs diff=lfs merge=lfs -text +*.dcm filter=lfs diff=lfs merge=lfs -text +*.GIF filter=lfs diff=lfs merge=lfs -text +*.resources filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.sil filter=lfs diff=lfs merge=lfs -text +*.bk filter=lfs diff=lfs merge=lfs -text +*.DS_Store filter=lfs diff=lfs merge=lfs -text +*.ief filter=lfs diff=lfs merge=lfs -text +*.JPEG filter=lfs diff=lfs merge=lfs -text +*.pbm filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.sketch filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.nef filter=lfs diff=lfs merge=lfs -text +*.oga filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.ecelp7470 filter=lfs diff=lfs merge=lfs -text +*.xlt filter=lfs diff=lfs merge=lfs -text +*.exe filter=lfs diff=lfs merge=lfs -text +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.pnm filter=lfs diff=lfs merge=lfs -text +*.ttc filter=lfs diff=lfs merge=lfs -text +*.wdp filter=lfs diff=lfs merge=lfs -text +*.xbm filter=lfs diff=lfs merge=lfs -text +*.ecelp9600 filter=lfs diff=lfs merge=lfs -text +*.pot filter=lfs diff=lfs merge=lfs -text +*.wvx filter=lfs diff=lfs merge=lfs -text +*.uvu filter=lfs diff=lfs merge=lfs -text +*.asf filter=lfs diff=lfs merge=lfs -text +*.dxf filter=lfs diff=lfs merge=lfs -text +*.flv filter=lfs diff=lfs merge=lfs -text +*.mdi filter=lfs diff=lfs merge=lfs -text +*.pcx filter=lfs diff=lfs merge=lfs -text +*.tiff filter=lfs diff=lfs merge=lfs -text +*.bzip2 filter=lfs diff=lfs merge=lfs -text +*.deb filter=lfs diff=lfs merge=lfs -text +*.graffle filter=lfs diff=lfs merge=lfs -text +*.h261 filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text +*.ppm filter=lfs diff=lfs merge=lfs -text +*.tif filter=lfs diff=lfs merge=lfs -text +*.ppt filter=lfs diff=lfs merge=lfs -text +*.fbs filter=lfs diff=lfs merge=lfs -text +*.gzip filter=lfs diff=lfs merge=lfs -text +*.o filter=lfs diff=lfs merge=lfs -text +*.sub filter=lfs diff=lfs merge=lfs -text +*.z filter=lfs diff=lfs merge=lfs -text +*.alz filter=lfs diff=lfs merge=lfs -text +*.BMP filter=lfs diff=lfs merge=lfs -text +*.dotm filter=lfs diff=lfs merge=lfs -text +*.key filter=lfs diff=lfs merge=lfs -text +*.rgb filter=lfs diff=lfs merge=lfs -text +*.f4v filter=lfs diff=lfs merge=lfs -text +*.iso filter=lfs diff=lfs merge=lfs -text +*.ai filter=lfs diff=lfs merge=lfs -text +*.dtshd filter=lfs diff=lfs merge=lfs -text +*.fpx filter=lfs diff=lfs merge=lfs -text +*.shar filter=lfs diff=lfs merge=lfs -text +*.img filter=lfs diff=lfs merge=lfs -text +*.rmf filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.eot filter=lfs diff=lfs merge=lfs -text +*.wma filter=lfs diff=lfs merge=lfs -text +*.cpio filter=lfs diff=lfs merge=lfs -text +*.cr2 filter=lfs diff=lfs merge=lfs -text +*.adp filter=lfs diff=lfs merge=lfs -text +*.mpeg filter=lfs diff=lfs merge=lfs -text +*.npx filter=lfs diff=lfs merge=lfs -text +*.pdb filter=lfs diff=lfs merge=lfs -text +*.PNG filter=lfs diff=lfs merge=lfs -text +*.xwd filter=lfs diff=lfs merge=lfs -text +*.egg filter=lfs diff=lfs merge=lfs -text +*.ppsx filter=lfs diff=lfs merge=lfs -text +*.mp4a filter=lfs diff=lfs merge=lfs -text +*.pages filter=lfs diff=lfs merge=lfs -text +*.baml filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.class filter=lfs diff=lfs merge=lfs -text +*.h264 filter=lfs diff=lfs merge=lfs -text +*.lib filter=lfs diff=lfs merge=lfs -text +*.mmr filter=lfs diff=lfs merge=lfs -text +*.dot filter=lfs diff=lfs merge=lfs -text +*.gif filter=lfs diff=lfs merge=lfs -text +*.JPG filter=lfs diff=lfs merge=lfs -text +*.m4a filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.thmx filter=lfs diff=lfs merge=lfs -text +*.3ds filter=lfs diff=lfs merge=lfs -text +*.bmp filter=lfs diff=lfs merge=lfs -text +*.ogv filter=lfs diff=lfs merge=lfs -text +*.xif filter=lfs diff=lfs merge=lfs -text +*.aiff filter=lfs diff=lfs merge=lfs -text +*.dts filter=lfs diff=lfs merge=lfs -text +*.rip filter=lfs diff=lfs merge=lfs -text +*.vob filter=lfs diff=lfs merge=lfs -text +*.7z filter=lfs diff=lfs merge=lfs -text +*.fh filter=lfs diff=lfs merge=lfs -text +*.flac filter=lfs diff=lfs merge=lfs -text +*.g3 filter=lfs diff=lfs merge=lfs -text +*.jpm filter=lfs diff=lfs merge=lfs -text +*.ppsm filter=lfs diff=lfs merge=lfs -text +*.potx filter=lfs diff=lfs merge=lfs -text +*.zipx filter=lfs diff=lfs merge=lfs -text +*.dsk filter=lfs diff=lfs merge=lfs -text +*.ico filter=lfs diff=lfs merge=lfs -text +*.ktx filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.numbers filter=lfs diff=lfs merge=lfs -text +*.3gp filter=lfs diff=lfs merge=lfs -text +*.fst filter=lfs diff=lfs merge=lfs -text +*.scpt filter=lfs diff=lfs merge=lfs -text +*.epub filter=lfs diff=lfs merge=lfs -text +*.rmvb filter=lfs diff=lfs merge=lfs -text +*.webm filter=lfs diff=lfs merge=lfs -text +*.docx filter=lfs diff=lfs merge=lfs -text +*.pgm filter=lfs diff=lfs merge=lfs -text +*.pya filter=lfs diff=lfs merge=lfs -text +*.rtf filter=lfs diff=lfs merge=lfs -text +*.smv filter=lfs diff=lfs merge=lfs -text +*.tga filter=lfs diff=lfs merge=lfs -text +*.cur filter=lfs diff=lfs merge=lfs -text +*.dwg filter=lfs diff=lfs merge=lfs -text +*.lvp filter=lfs diff=lfs merge=lfs -text +*.pyo filter=lfs diff=lfs merge=lfs -text +*.apk filter=lfs diff=lfs merge=lfs -text +*.ar filter=lfs diff=lfs merge=lfs -text +*.caf filter=lfs diff=lfs merge=lfs -text +*.doc filter=lfs diff=lfs merge=lfs -text +*.h263 filter=lfs diff=lfs merge=lfs -text +*.xlsm filter=lfs diff=lfs merge=lfs -text +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.mxu filter=lfs diff=lfs merge=lfs -text +*.wax filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.mj2 filter=lfs diff=lfs merge=lfs -text +*.otf filter=lfs diff=lfs merge=lfs -text +*.udf filter=lfs diff=lfs merge=lfs -text +*.aif filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.pyc filter=lfs diff=lfs merge=lfs -text +*.weba filter=lfs diff=lfs merge=lfs -text +*.webp filter=lfs diff=lfs merge=lfs -text +*.cgm filter=lfs diff=lfs merge=lfs -text +*.mkv filter=lfs diff=lfs merge=lfs -text +*.ppa filter=lfs diff=lfs merge=lfs -text +*.uvh filter=lfs diff=lfs merge=lfs -text +*.xpi filter=lfs diff=lfs merge=lfs -text +*.psd filter=lfs diff=lfs merge=lfs -text +*.xlsb filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.wim filter=lfs diff=lfs merge=lfs -text +*.ape filter=lfs diff=lfs merge=lfs -text +*.avi filter=lfs diff=lfs merge=lfs -text +*.dex filter=lfs diff=lfs merge=lfs -text +*.dra filter=lfs diff=lfs merge=lfs -text +*.dvb filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.xla filter=lfs diff=lfs merge=lfs -text +*.fvt filter=lfs diff=lfs merge=lfs -text +*.lzo filter=lfs diff=lfs merge=lfs -text +*.pea filter=lfs diff=lfs merge=lfs -text +*.ras filter=lfs diff=lfs merge=lfs -text +*.tlz filter=lfs diff=lfs merge=lfs -text +*.viv filter=lfs diff=lfs merge=lfs -text +*.winmd filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index 3e759b7..e3f3582 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files *.suo @@ -19,18 +17,18 @@ [Rr]eleases/ x64/ x86/ +build/ bld/ [Bb]in/ [Oo]bj/ -[Ll]og/ -# Visual Studio 2015/2017 cache/options directory +# Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ -# Visual Studio 2017 auto generated files -Generated\ Files/ +# Visual Studio code +.vscode/ # MSTest test Results [Tt]est[Rr]esult*/ @@ -45,29 +43,20 @@ TestResult.xml [Rr]eleasePS/ dlldata.c -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json +# DNX +*.lock.json artifacts/ -**/Properties/launchSettings.json - -# StyleCop -StyleCopReport.xml +*.nuget.props +*.nuget.targets -# Files built by Visual Studio *_i.c *_p.c *_i.h *.ilk *.meta *.obj -*.iobj *.pch *.pdb -*.ipdb *.pgc *.pgd *.rsp @@ -84,6 +73,7 @@ StyleCopReport.xml *.pidb *.svclog *.scc +*.binlog # Chutzpah Test files _Chutzpah* @@ -96,8 +86,6 @@ ipch/ *.opensdf *.sdf *.cachefile -*.VC.db -*.VC.VC.opendb # Visual Studio profiler *.psess @@ -105,9 +93,6 @@ ipch/ *.vspx *.sap -# Visual Studio Trace Files -*.e2e - # TFS 2012 Local Workspace $tf/ @@ -128,14 +113,6 @@ _TeamCity* # DotCover is a Code Coverage Tool *.dotCover -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - # NCrunch _NCrunch_* .*crunch*.local.xml @@ -167,42 +144,31 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, +# TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* +**/packages/* # except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ +!**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets +#!**/packages/repositories.config -# Microsoft Azure Build Output +# Windows Azure Build Output csx/ *.build.csdef -# Microsoft Azure Emulator +# Windows Azure Emulator ecf/ rcf/ -# Windows Store app package directories and files +# Windows Store app package directory AppPackages/ BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx # Visual Studio cache files # files ending in .cache can be ignored @@ -216,19 +182,11 @@ ClientBin/ *~ *.dbmdl *.dbproj.schemaview -*.jfm *.pfx *.publishsettings +node_modules/ orleans.codegen.cs -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - # RIA/Silverlight projects Generated_Code/ @@ -239,19 +197,15 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak # SQL Server files *.mdf *.ldf -*.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings -*.rptproj.rsuser # Microsoft Fakes FakesAssemblies/ @@ -261,7 +215,6 @@ FakesAssemblies/ # Node.js Tools for Visual Studio .ntvs_analysis.dat -node_modules/ # Visual Studio 6 build log *.plg @@ -269,9 +222,6 @@ node_modules/ # Visual Studio 6 workspace options file *.opt -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts @@ -282,49 +232,22 @@ _Pvt_Extensions # Paket dependency manager .paket/paket.exe -paket-files/ # FAKE - F# Make .fake/ -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss +# Tools +tools/ -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ +# ReactiveUI +artifacts/ +src/ReactiveUI.Events*/Events_*.cs -# MSBuild Binary and Structured Log -*.binlog +# macOS +.DS_Store -# NVidia Nsight GPU debugger configuration file -*.nvuser +src/*.Tests/**/*.received.txt +.idea/ -# MFractors (Xamarin productivity tool) working folder -.mfractor/ +# Fody Weavers (for tests) +src/Tools/ \ No newline at end of file diff --git a/LICENSE b/LICENSE index 35af75d..984713a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,8 @@ -MIT License +The MIT License (MIT) -Copyright (c) 2019 ReactiveUI +Copyright (c) .NET Foundation and Contributors + +All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs b/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs deleted file mode 100644 index e23382c..0000000 --- a/Rx.NET/Source/src/System.Reactive/Internal/StopwatchImpl.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; - -namespace System.Reactive.Concurrency -{ - // - // WARNING: This code is kept *identically* in two places. One copy is kept in System.Reactive.Core for non-PLIB platforms. - // Another copy is kept in System.Reactive.PlatformServices to enlighten the default lowest common denominator - // behavior of Rx for PLIB when used on a more capable platform. - // - internal class /*Default*/StopwatchImpl : IStopwatch - { - private readonly Stopwatch _sw; - - public StopwatchImpl() - { - _sw = Stopwatch.StartNew(); - } - - public TimeSpan Elapsed => _sw.Elapsed; - } -} diff --git a/Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs b/Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs deleted file mode 100644 index 9282348..0000000 --- a/Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. - -namespace System.Reactive -{ - internal static class Stubs - { - public static readonly Action Ignore = _ => { }; - public static readonly Func I = _ => _; - } - - internal static class Stubs - { - public static readonly Action Nop = () => { }; - //public static readonly Action Throw = ex => { ex.Throw(); }; - } - -#if !NO_THREAD - internal static class TimerStubs - { -#if NETSTANDARD1_3 - public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); -#else - public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }); -#endif - } -#endif -} - diff --git a/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj b/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj deleted file mode 100644 index 3f1a364..0000000 --- a/Rx.NET/Source/src/System.Reactive/System.Reactive.Wasm.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - netstandard2.0 - true - Rx.Uno.Wasm - 1.0.0-alpha - nventive, shimmy - Rx.Uno.Wasm - Uno Wasm implementation for System.Reactive - MIT - https://github.com/weitzhandler/System.Reactive.Wasm - - - - - - - diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..74e8520 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,19 @@ +trigger: +- master +- rel/* +- preview/* + +pr: +- master +- rel/* +- preview/* + +resources: + repositories: + - repository: templates + type: github + name: ReactiveUI/ReactiveUI.Cake.Recipe + endpoint: reactiveui + +jobs: +- template: Azure/azure-pipelines-windows-only.yml@templates \ No newline at end of file diff --git a/build.cake b/build.cake new file mode 100644 index 0000000..23b9d36 --- /dev/null +++ b/build.cake @@ -0,0 +1,25 @@ +#load nuget:https://www.myget.org/F/reactiveui/api/v2?package=ReactiveUI.Cake.Recipe&prerelease + +Environment.SetVariableNames(); + +// Whitelisted Packages +var packageWhitelist = new[] +{ + MakeAbsolute(File("./src/System.Reactive.Wasm/System.Reactive.Wasm.csproj")), +}; + +var packageTestWhitelist = new FilePath[] +{ +}; + +BuildParameters.SetParameters(context: Context, + buildSystem: BuildSystem, + title: "System.Reactive.Wasm", + whitelistPackages: packageWhitelist, + whitelistTestPackages: packageTestWhitelist, + artifactsDirectory: "./artifacts", + sourceDirectory: "./src"); + +ToolSettings.SetToolSettings(context: Context); + +Build.Run(); diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..e5fa880 --- /dev/null +++ b/build.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -ExecutionPolicy Unrestricted ./build.ps1 %CAKE_ARGS% %* diff --git a/build.config b/build.config new file mode 100644 index 0000000..2553743 --- /dev/null +++ b/build.config @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +CAKE_VERSION=0.33.0 \ No newline at end of file diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..5b0c98e --- /dev/null +++ b/build.ps1 @@ -0,0 +1,112 @@ +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent + +[string] $CakeVersion = '' +foreach($line in Get-Content "$PSScriptRoot\build.config") +{ + if ($line -like 'CAKE_VERSION=*') { + $CakeVersion = $line.SubString(13) + } +} + + +if ([string]::IsNullOrEmpty($CakeVersion)) { + 'Failed to parse Cake Version' + exit 1 +} + +# Make sure tools folder exists +$ToolPath = Join-Path $PSScriptRoot "tools" +if (!(Test-Path $ToolPath)) { + Write-Verbose "Creating tools directory..." + New-Item -Path $ToolPath -Type Directory -Force | out-null +} + + +if ($PSVersionTable.PSEdition -ne 'Core') { + # Attempt to set highest encryption available for SecurityProtocol. + # PowerShell will not set this by default (until maybe .NET 4.6.x). This + # will typically produce a message for PowerShell v2 (just an info + # message though) + try { + # Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48) + # Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't + # exist in .NET 4.0, even though they are addressable if .NET 4.5+ is + # installed (.NET 4.5 is an in-place upgrade). + [System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48 + } catch { + Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3' + } +} + +########################################################################### +# INSTALL .NET CORE CLI +########################################################################### + +Function Remove-PathVariable([string]$VariableToRemove) +{ + $SplitChar = ';' + if ($IsMacOS -or $IsLinux) { + $SplitChar = ':' + } + + $path = [Environment]::GetEnvironmentVariable("PATH", "User") + if ($path -ne $null) + { + $newItems = $path.Split($SplitChar, [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join($SplitChar, $newItems), "User") + } + + $path = [Environment]::GetEnvironmentVariable("PATH", "Process") + if ($path -ne $null) + { + $newItems = $path.Split($SplitChar, [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join($SplitChar, $newItems), "Process") + } +} + +$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +$env:DOTNET_CLI_TELEMETRY_OPTOUT=1 + +########################################################################### +# INSTALL CAKE +########################################################################### + +# Make sure Cake has been installed. +[string] $CakeExePath = '' +[string] $CakeInstalledVersion = Get-Command dotnet-cake -ErrorAction SilentlyContinue | % {&$_.Source --version} + +if ($CakeInstalledVersion -eq $CakeVersion) { + # Cake found locally + $CakeExePath = (Get-Command dotnet-cake).Source +} +else { + $CakePath = Join-Path $ToolPath ".store\cake.tool\$CakeVersion" + $CakeExePath = (Get-ChildItem -Path $ToolPath -Filter "dotnet-cake*" -File| ForEach-Object FullName | Select-Object -First 1) + + + if ((!(Test-Path -Path $CakePath -PathType Container)) -or (!(Test-Path $CakeExePath -PathType Leaf))) { + + if ((![string]::IsNullOrEmpty($CakeExePath)) -and (Test-Path $CakeExePath -PathType Leaf)) + { + & dotnet tool uninstall --tool-path $ToolPath Cake.Tool + } + + & dotnet tool install --tool-path $ToolPath --version $CakeVersion Cake.Tool + if ($LASTEXITCODE -ne 0) + { + 'Failed to install cake' + exit 1 + } + $CakeExePath = (Get-ChildItem -Path $ToolPath -Filter "dotnet-cake*" -File| ForEach-Object FullName | Select-Object -First 1) + } +} + +########################################################################### +# RUN BUILD SCRIPT +########################################################################### +& "$CakeExePath" ./build.cake --bootstrap +if ($LASTEXITCODE -eq 0) +{ + & "$CakeExePath" ./build.cake $args +} +exit $LASTEXITCODE \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..8c2183f --- /dev/null +++ b/build.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# Define varibles +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +source $SCRIPT_DIR/build.config +TOOLS_DIR=$SCRIPT_DIR/tools +CAKE_EXE=$TOOLS_DIR/dotnet-cake +CAKE_PATH=$TOOLS_DIR/.store/cake.tool/$CAKE_VERSION + +# Make sure the tools folder exist. +if [ ! -d "$TOOLS_DIR" ]; then + mkdir "$TOOLS_DIR" +fi + +########################################################################### +# INSTALL CAKE +########################################################################### +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0 + +CAKE_INSTALLED_VERSION=$(dotnet-cake --version 2>&1) + +if [ "$CAKE_VERSION" != "$CAKE_INSTALLED_VERSION" ]; then + if [ ! -f "$CAKE_EXE" ] || [ ! -d "$CAKE_PATH" ]; then + if [ -f "$CAKE_EXE" ]; then + dotnet tool uninstall --tool-path $TOOLS_DIR Cake.Tool + fi + + echo "Installing Cake $CAKE_VERSION..." + dotnet tool install --tool-path $TOOLS_DIR --version $CAKE_VERSION Cake.Tool + if [ $? -ne 0 ]; then + echo "An error occured while installing Cake." + exit 1 + fi + fi + + # Make sure that Cake has been installed. + if [ ! -f "$CAKE_EXE" ]; then + echo "Could not find Cake.exe at '$CAKE_EXE'." + exit 1 + fi +else + CAKE_EXE="dotnet-cake" +fi + +########################################################################### +# RUN BUILD SCRIPT +########################################################################### + +# Start Cake +(exec "$CAKE_EXE" --bootstrap) && (exec "$CAKE_EXE" "$@") \ No newline at end of file diff --git a/cake.config b/cake.config new file mode 100644 index 0000000..c26865e --- /dev/null +++ b/cake.config @@ -0,0 +1,7 @@ +[Paths] +Tools=./tools +Addins=./tools/Addins +Modules=./tools/Modules + +[NuGet] +UseInProcessClient=true diff --git a/src/ApiGeneratorGlobalSuppressions.cs b/src/ApiGeneratorGlobalSuppressions.cs new file mode 100644 index 0000000..4cc1e89 --- /dev/null +++ b/src/ApiGeneratorGlobalSuppressions.cs @@ -0,0 +1,161 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ConvertAttributeToCode(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.Object")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ConvertAttributeToCode(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.Object")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCodeTypeReference(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCodeTypeReference(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.FormatParameterConstant(Mono.Cecil.IConstantProvider)~System.Object")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.FormatParameterConstant(Mono.Cecil.IConstantProvider)~System.Object")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateEvent(Mono.Cecil.EventDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeMember")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateEvent(Mono.Cecil.EventDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeMember")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.HasVisiblePropertyMethod(System.CodeDom.MemberAttributes)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.HasVisiblePropertyMethod(System.CodeDom.MemberAttributes)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsCompilerGenerated(Mono.Cecil.IMemberDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsCompilerGenerated(Mono.Cecil.IMemberDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDelegate(Mono.Cecil.TypeDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDelegate(Mono.Cecil.TypeDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsExtensionMethod(Mono.Cecil.ICustomAttributeProvider)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsExtensionMethod(Mono.Cecil.ICustomAttributeProvider)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsHidingMethod(Mono.Cecil.MethodDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsHidingMethod(Mono.Cecil.MethodDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.MakeReadonly(System.CodeDom.CodeTypeReference)~System.CodeDom.CodeTypeReference")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.MakeReadonly(System.CodeDom.CodeTypeReference)~System.CodeDom.CodeTypeReference")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseLineEndings(System.String)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseLineEndings(System.String)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeAttribute(Mono.Cecil.CustomAttribute,System.Collections.Generic.HashSet{System.String})~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeAttribute(Mono.Cecil.CustomAttribute,System.Collections.Generic.HashSet{System.String})~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeType(Mono.Cecil.TypeDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeType(Mono.Cecil.TypeDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldOutputBaseType(Mono.Cecil.TypeDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldOutputBaseType(Mono.Cecil.TypeDefinition)~System.Boolean")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1122:Use string.Empty for empty strings", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "RCS1001:Add braces (when expression spans over multiple lines).", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1117:Parameters should be on same line or separate lines", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GeneratePublicApi(System.Reflection.Assembly,System.Type[],System.Boolean,System.String[],System.String[])~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1117:Parameters should be on same line or separate lines", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1000:Keywords should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1209:Using alias directives should be placed after other using directives", Justification = "NuGet Inclusion")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1210:Using directives should be ordered alphabetically by namespace", Justification = "NuGet Inclusion")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1208:System using directives should be placed before other using directives", Justification = "NuGet Inclusion")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:Elements should appear in the correct order", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:Elements should appear in the correct order", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1825:Avoid zero-length array allocations.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1512:Single-line comments should not be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1520:Use braces consistently", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1005:Single line comments should begin with single space", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1111:Closing parenthesis should be on line of last parameter", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] diff --git a/src/Directory.build.props b/src/Directory.build.props new file mode 100644 index 0000000..607c324 --- /dev/null +++ b/src/Directory.build.props @@ -0,0 +1,61 @@ + + + $(NoWarn);VSX1000 + AnyCPU + $(MSBuildProjectName.Contains('Tests')) + git + true + $(MSBuildThisFileDirectory)analyzers.ruleset + Wasm implementation for System.Reactive. + mvvm;rx;reactive extensions;observable;frp;uwp;net;netstandard;uno;blazer + $(MSBuildProjectName.Contains('Tests')) + Embedded + + true + + true + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + + false + $(EnableSourceLink) + + + $(MSBuildThisFileDirectory)analyzers.tests.ruleset + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Directory.build.targets b/src/Directory.build.targets new file mode 100644 index 0000000..9e43ace --- /dev/null +++ b/src/Directory.build.targets @@ -0,0 +1,30 @@ + + + $(AssemblyName) ($(TargetFramework)) + + + + $(DefineConstants);NET_45;XAML + + + $(DefineConstants);NETFX_CORE;XAML;WINDOWS_UWP + + + $(DefineConstants);MONO;UIKIT;COCOA + + + $(DefineConstants);MONO;COCOA + + + $(DefineConstants);MONO;UIKIT;COCOA + + + $(DefineConstants);MONO;UIKIT;COCOA + + + $(DefineConstants);MONO;ANDROID + + + $(DefineConstants);TIZEN + + diff --git a/System.Reactive.Wasm.sln b/src/System.Reactive.Wasm.sln similarity index 56% rename from System.Reactive.Wasm.sln rename to src/System.Reactive.Wasm.sln index a6723ce..3f4b3e1 100644 --- a/System.Reactive.Wasm.sln +++ b/src/System.Reactive.Wasm.sln @@ -3,7 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29001.49 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive.Wasm", "Rx.NET\Source\src\System.Reactive\System.Reactive.Wasm.csproj", "{8B20B249-86A7-4FE5-96F7-A8479225B2F3}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5D3F6FE2-CB16-4FFA-B5B0-9D8817D49505}" + ProjectSection(SolutionItems) = preProject + ..\version.json = ..\version.json + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive.Wasm", "System.Reactive.Wasm\System.Reactive.Wasm.csproj", "{3338BB57-11A9-4602-BBEB-9881128A53D9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +16,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8B20B249-86A7-4FE5-96F7-A8479225B2F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B20B249-86A7-4FE5-96F7-A8479225B2F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B20B249-86A7-4FE5-96F7-A8479225B2F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B20B249-86A7-4FE5-96F7-A8479225B2F3}.Release|Any CPU.Build.0 = Release|Any CPU + {3338BB57-11A9-4602-BBEB-9881128A53D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3338BB57-11A9-4602-BBEB-9881128A53D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3338BB57-11A9-4602-BBEB-9881128A53D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3338BB57-11A9-4602-BBEB-9881128A53D9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/CuncurrencyAbstractionLayerWasmImpl.cs b/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs similarity index 90% rename from Rx.NET/Source/src/System.Reactive/Concurrency/CuncurrencyAbstractionLayerWasmImpl.cs rename to src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs index 9e7b532..14b26d6 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/CuncurrencyAbstractionLayerWasmImpl.cs +++ b/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs @@ -1,6 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. #if !NO_THREAD using System.Collections.Generic; @@ -9,46 +10,49 @@ namespace System.Reactive.Concurrency { - // // WARNING: This code is kept *identically* in two places. One copy is kept in System.Reactive.Core for non-PLIB platforms. // Another copy is kept in System.Reactive.PlatformServices to enlighten the default lowest common denominator // behavior of Rx for PLIB when used on a more capable platform. - // - internal class /*Default*/ConcurrencyAbstractionLayerWasmImpl : IConcurrencyAbstractionLayer + internal class ConcurrencyAbstractionLayerWasmImpl : IConcurrencyAbstractionLayer { + /// + public bool SupportsLongRunning => false; + + /// public IDisposable StartTimer(Action action, object state, TimeSpan dueTime) => new Timer(action, state, Normalize(dueTime)); + /// public IDisposable StartPeriodicTimer(Action action, TimeSpan period) { if (period < TimeSpan.Zero) + { throw new ArgumentOutOfRangeException(nameof(period)); + } - // - // The contract for periodic scheduling in Rx is that specifying TimeSpan.Zero as the period causes the scheduler to + // The contract for periodic scheduling in Rx is that specifying TimeSpan.Zero as the period causes the scheduler to // call back periodically as fast as possible, sequentially. - // if (period == TimeSpan.Zero) { return new FastPeriodicTimer(action); } - else - { - return new PeriodicTimer(action, period); - } + + return new PeriodicTimer(action, period); } + /// public IDisposable QueueUserWorkItem(Action action, object state) { System.Threading.ThreadPool.QueueUserWorkItem(_ => action(_), state); return Disposable.Empty; } - public void Sleep(TimeSpan timeout) => System.Threading.Thread.Sleep(Normalize(timeout)); + /// + public void Sleep(TimeSpan timeout) => Thread.Sleep(Normalize(timeout)); + /// public IStopwatch StartStopwatch() => new StopwatchImpl(); - public bool SupportsLongRunning => false; - + /// public void StartThread(Action action, object state) { new Thread(() => @@ -60,7 +64,6 @@ public void StartThread(Action action, object state) private static TimeSpan Normalize(TimeSpan dueTime) => dueTime < TimeSpan.Zero ? TimeSpan.Zero : dueTime; - // // Some historical context. In the early days of Rx, we discovered an issue with // the rooting of timers, causing them to get GC'ed even when the IDisposable of // a scheduled activity was kept alive. The original code simply created a timer @@ -86,7 +89,7 @@ public void StartThread(Action action, object state) // static void Main() // { // Bar(); - // + // // while (true) // { // GC.Collect(); @@ -94,7 +97,7 @@ public void StartThread(Action action, object state) // Thread.Sleep(100); // } // } - // + // // static void Bar() // { // var t = default(Timer); @@ -129,8 +132,6 @@ public void StartThread(Action action, object state) // NB: 4/13/2017 - All target platforms for the 4.x release have the self-rooting // behavior described here, so we removed the USE_TIMER_SELF_ROOT // symbol. - // - private sealed class Timer : IDisposable { private Action _action; @@ -141,17 +142,29 @@ public Timer(Action action, object state, TimeSpan dueTime) _action = action; // Don't want the spin wait in Tick to get stuck if this thread gets aborted. - try { } + try + { + } finally { - // // Rooting of the timer happens through the this.Tick delegate's target object, // which is the current instance and has a field to store the Timer instance. - // _timer = new System.Threading.Timer(Tick, state, dueTime, TimeSpan.FromMilliseconds(System.Threading.Timeout.Infinite)); } } + public void Dispose() + { + var timer = _timer; + if (timer != TimerStubs.Never) + { + _action = Stubs.Ignore; + _timer = TimerStubs.Never; + + timer.Dispose(); + } + } + private void Tick(object state) { try @@ -166,18 +179,6 @@ private void Tick(object state) } private bool IsTimerAssigned() => _timer != null; - - public void Dispose() - { - var timer = _timer; - if (timer != TimerStubs.Never) - { - _action = Stubs.Ignore; - _timer = TimerStubs.Never; - - timer.Dispose(); - } - } } private sealed class PeriodicTimer : IDisposable @@ -189,15 +190,11 @@ public PeriodicTimer(Action action, TimeSpan period) { _action = action; - // // Rooting of the timer happens through the this.Tick delegate's target object, // which is the current instance and has a field to store the Timer instance. - // _timer = new System.Threading.Timer(Tick, null, period, period); } - private void Tick(object state) => _action(); - public void Dispose() { var timer = _timer; @@ -209,12 +206,14 @@ public void Dispose() timer.Dispose(); } } + + private void Tick(object state) => _action(); } private sealed class FastPeriodicTimer : IDisposable { private readonly Action _action; - private volatile bool disposed; + private volatile bool _disposed; public FastPeriodicTimer(Action action) { @@ -228,19 +227,19 @@ public FastPeriodicTimer(Action action) .Start(); } + public void Dispose() + { + _disposed = true; + } + private void Loop() { - while (!disposed) + while (!_disposed) { _action(); } } - - public void Dispose() - { - disposed = true; - } } } } -#endif \ No newline at end of file +#endif diff --git a/Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProviderExtensions.cs b/src/System.Reactive.Wasm/Internal/PlatformEnlightenmentProviderExtensions.cs similarity index 59% rename from Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProviderExtensions.cs rename to src/System.Reactive.Wasm/Internal/PlatformEnlightenmentProviderExtensions.cs index 9de7e2f..fbe0b52 100644 --- a/Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProviderExtensions.cs +++ b/src/System.Reactive.Wasm/Internal/PlatformEnlightenmentProviderExtensions.cs @@ -1,14 +1,23 @@ -using System; +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System; using System.Collections.Generic; using System.Text; namespace System.Reactive.PlatformServices { + /// + /// Contains extension methods associated with registrations of platform enlightenment providers. + /// public static class PlatformEnlightenmentProviderExtensions { /// /// Sets the to the one. /// + /// The provider. This parameter is ignored. #pragma warning disable IDE0060 public static void EnableWasm(this IPlatformEnlightenmentProvider provider) #pragma warning restore IDE0060 // Remove unused parameter @@ -17,7 +26,5 @@ public static void EnableWasm(this IPlatformEnlightenmentProvider provider) PlatformEnlightenmentProvider.Current = new WasmPlatformEnlightenmentProvider(); #pragma warning restore CS0618 // Type or member is obsolete } - - } } diff --git a/src/System.Reactive.Wasm/Internal/StopwatchImpl.cs b/src/System.Reactive.Wasm/Internal/StopwatchImpl.cs new file mode 100644 index 0000000..1064f0a --- /dev/null +++ b/src/System.Reactive.Wasm/Internal/StopwatchImpl.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Diagnostics; + +namespace System.Reactive.Concurrency +{ + /// + /// A stop watch implementation. + /// + internal class StopwatchImpl : IStopwatch + { + private readonly Stopwatch _sw; + + public StopwatchImpl() + { + _sw = Stopwatch.StartNew(); + } + + public TimeSpan Elapsed => _sw.Elapsed; + } +} diff --git a/src/System.Reactive.Wasm/Internal/Stubs.cs b/src/System.Reactive.Wasm/Internal/Stubs.cs new file mode 100644 index 0000000..25bae14 --- /dev/null +++ b/src/System.Reactive.Wasm/Internal/Stubs.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace System.Reactive +{ +#pragma warning disable SA1402 // File may only contain a single type + internal static class Stubs +#pragma warning restore SA1402 // File may only contain a single type + { + public static readonly Action Ignore = _ => { }; + public static readonly Func I = _ => _; + } + + internal static class Stubs + { + public static readonly Action Nop = () => { }; + } + +#if !NO_THREAD +#endif +} diff --git a/src/System.Reactive.Wasm/Internal/TimerStubs.cs b/src/System.Reactive.Wasm/Internal/TimerStubs.cs new file mode 100644 index 0000000..6eda662 --- /dev/null +++ b/src/System.Reactive.Wasm/Internal/TimerStubs.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace System.Reactive +{ + internal static class TimerStubs + { +#if NETSTANDARD1_3 + public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); +#else + public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }); +#endif + } +} diff --git a/Rx.NET/Source/src/System.Reactive/Internal/WasmPlatformEnlightenmentProvider.cs b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs similarity index 78% rename from Rx.NET/Source/src/System.Reactive/Internal/WasmPlatformEnlightenmentProvider.cs rename to src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs index 9c3e021..15049e0 100644 --- a/Rx.NET/Source/src/System.Reactive/Internal/WasmPlatformEnlightenmentProvider.cs +++ b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs @@ -1,10 +1,9 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. -// // WARNING: The full namespace-qualified type name should stay the same for the discovery in System.Reactive.Core to work! -// using System.ComponentModel; using System.Diagnostics; using System.Reactive.Concurrency; @@ -15,12 +14,12 @@ namespace System.Reactive.PlatformServices { /// - /// (Infrastructure) Provider for platform-specific framework enlightenments. + /// (Infrastructure) Provider for platform-specific framework enlightenment. /// [EditorBrowsable(EditorBrowsableState.Never)] public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentProvider { - private readonly static bool _isWasm = RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY")); + private static readonly bool _isWasm = RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY")); /// /// (Infastructure) Tries to gets the specified service. @@ -28,7 +27,7 @@ public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentPro /// Service type. /// Optional set of arguments. /// Service instance or null if not found. - public override T GetService(object[] args) //where T : class + public override T GetService(object[] args) { var t = typeof(T); @@ -57,4 +56,4 @@ public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentPro return base.GetService(args); } } -} \ No newline at end of file +} diff --git a/Rx.NET/Source/src/System.Reactive/Internal/WasmScheduler.cs b/src/System.Reactive.Wasm/Internal/WasmScheduler.cs similarity index 62% rename from Rx.NET/Source/src/System.Reactive/Internal/WasmScheduler.cs rename to src/System.Reactive.Wasm/Internal/WasmScheduler.cs index 65abd35..18b5b9b 100644 --- a/Rx.NET/Source/src/System.Reactive/Internal/WasmScheduler.cs +++ b/src/System.Reactive.Wasm/Internal/WasmScheduler.cs @@ -1,4 +1,9 @@ -#if NETSTANDARD2_0 +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +#if NETSTANDARD2_0 using System; using System.Collections.Generic; using System.Reactive.Concurrency; @@ -10,71 +15,24 @@ namespace System.Reactive.Concurrency { - class WasmScheduler : LocalScheduler, ISchedulerPeriodic + /// + /// A scheduler for the WASM systems. + /// + public class WasmScheduler : LocalScheduler, ISchedulerPeriodic { - private static Lazy s_default = new Lazy(() => new WasmScheduler()); - - // Import from https://github.com/mono/mono/blob/0a8126c2094d2d0800a462d4d0c790d4db421477/mcs/class/corlib/System.Threading/Timer.cs#L39 - internal static class WasmRuntime - { - static Dictionary callbacks; - static int next_id; - - [MethodImplAttribute(MethodImplOptions.InternalCall)] - static extern void SetTimeout(int timeout, int id); - - internal static void ScheduleTimeout(int timeout, Action action) - { - if (callbacks == null) - { - callbacks = new Dictionary(); - } - - int id = ++next_id; - callbacks[id] = action; - SetTimeout(timeout, id); - } - - //XXX Keep this in sync with mini-wasm.c:mono_set_timeout_exec - static void TimeoutCallback(int id) - { - var cb = callbacks[id]; - callbacks.Remove(id); - cb(); - } - } - - /// - /// Constructs a WasmScheduler that schedules units of work on the Windows ThreadPool. - /// - public WasmScheduler() - { - } + private static readonly Lazy _default = new Lazy(() => new WasmScheduler()); /// /// Gets the singleton instance of the Windows Runtime thread pool scheduler. /// - public static WasmScheduler Default - { - get - { - return s_default.Value; - } - } + public static WasmScheduler Default => _default.Value; - /// - /// Schedules an action to be executed. - /// - /// The type of the state passed to the scheduled action. - /// State passed to the action to be executed. - /// Action to be executed. - /// The disposable object used to cancel the scheduled action (best effort). - /// is null. + /// public override IDisposable Schedule(TState state, Func action) { if (action == null) { - throw new ArgumentNullException("action"); + throw new ArgumentNullException(nameof(action)); } var d = new SingleAssignmentDisposable(); @@ -102,20 +60,18 @@ public override IDisposable Schedule(TState state, Func is less than one millisecond. public IDisposable SchedulePeriodic(TState state, TimeSpan period, Func action) { - // // The WinRT thread pool is based on the Win32 thread pool and cannot handle // sub-1ms resolution. When passing a lower period, we get single-shot // timer behavior instead. See MSDN documentation for CreatePeriodicTimer // for more information. - // if (period < TimeSpan.FromMilliseconds(1)) { - throw new ArgumentOutOfRangeException("period", "The WinRT thread pool doesn't support creating periodic timers with a period below 1 millisecond."); + throw new ArgumentOutOfRangeException(nameof(period), "The WinRT thread pool doesn't support creating periodic timers with a period below 1 millisecond."); } if (action == null) { - throw new ArgumentNullException("action"); + throw new ArgumentNullException(nameof(action)); } var state1 = state; @@ -128,19 +84,17 @@ public IDisposable SchedulePeriodic(TState state, TimeSpan period, Func< Action run = null; run = () => - { - gate.Wait(() => - { - state1 = action(state1); - - WasmRuntime.ScheduleTimeout( - (int)period.TotalMilliseconds, - run - ); - }); - }; - } - ); + { + gate.Wait(() => + { + state1 = action(state1); + + WasmRuntime.ScheduleTimeout( + (int)period.TotalMilliseconds, + run); + }); + }; + }); return Disposable.Create(() => { @@ -149,11 +103,12 @@ public IDisposable SchedulePeriodic(TState state, TimeSpan period, Func< }); } + /// public override IDisposable Schedule(TState state, TimeSpan dueTime, Func action) { if (action == null) { - throw new ArgumentNullException("action"); + throw new ArgumentNullException(nameof(action)); } var dt = Scheduler.Normalize(dueTime); @@ -173,11 +128,40 @@ public override IDisposable Schedule(TState state, TimeSpan dueTime, Fun { d.Disposable = action(this, state); } - } - ); + }); return d; } + + // Import from https://github.com/mono/mono/blob/0a8126c2094d2d0800a462d4d0c790d4db421477/mcs/class/corlib/System.Threading/Timer.cs#L39 + internal static class WasmRuntime + { + private static Dictionary _callbacks; + private static int _next_id; + + internal static void ScheduleTimeout(int timeout, Action action) + { + if (_callbacks == null) + { + _callbacks = new Dictionary(); + } + + int id = ++_next_id; + _callbacks[id] = action; + SetTimeout(timeout, id); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void SetTimeout(int timeout, int id); + + // XXX Keep this in sync with mini-wasm.c:mono_set_timeout_exec + private static void TimeoutCallback(int id) + { + var cb = _callbacks[id]; + _callbacks.Remove(id); + cb(); + } + } } } -#endif \ No newline at end of file +#endif diff --git a/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj b/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj new file mode 100644 index 0000000..e51074f --- /dev/null +++ b/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0 + System.Reactive.Wasm + Wasm implementation for System.Reactive + + + + + + + diff --git a/src/analyzers.ruleset b/src/analyzers.ruleset new file mode 100644 index 0000000..c1436ad --- /dev/null +++ b/src/analyzers.ruleset @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/analyzers.tests.ruleset b/src/analyzers.tests.ruleset new file mode 100644 index 0000000..191cfed --- /dev/null +++ b/src/analyzers.tests.ruleset @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/global.json b/src/global.json new file mode 100644 index 0000000..1e4edb3 --- /dev/null +++ b/src/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "MSBuild.Sdk.Extras": "1.6.68" + } +} diff --git a/src/stylecop.json b/src/stylecop.json new file mode 100644 index 0000000..66c88ad --- /dev/null +++ b/src/stylecop.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "indentation": { + "useTabs": false, + "indentationSize": 4 + }, + "documentationRules": { + "documentExposedElements": true, + "documentInternalElements": false, + "documentPrivateElements": false, + "documentInterfaces": true, + "documentPrivateFields": false, + "documentationCulture": "en-US", + "companyName": ".NET Foundation and Contributors", + "copyrightText": "Copyright (c) 2019 {companyName}. All rights reserved.\nLicensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the {licenseName} license.\nSee the {licenseFile} file in the project root for full license information.", + "variables": { + "licenseName": "MIT", + "licenseFile": "LICENSE" + }, + "xmlHeader": false + }, + "layoutRules": { + "newlineAtEndOfFile": "allow", + "allowConsecutiveUsings": true + }, + "maintainabilityRules": { + "topLevelTypes": [ + "class", + "interface", + "struct", + "enum", + "delegate" + ] + }, + "orderingRules": { + "usingDirectivesPlacement": "outsideNamespace", + "systemUsingDirectivesFirst": true + }, + } +} diff --git a/version.json b/version.json new file mode 100644 index 0000000..7bb1982 --- /dev/null +++ b/version.json @@ -0,0 +1,17 @@ +{ + "version": "4.1.5", + "publicReleaseRefSpec": [ + "^refs/heads/master$", // we release out of master + "^refs/heads/develop$", // we release out of develop + "^refs/heads/rel/\\d+\\.\\d+\\.\\d+" // we also release branches starting with rel/N.N.N + ], + "nugetPackageVersion":{ + "semVer": 2 + }, + "cloudBuild": { + "setVersionVariables": true, + "buildNumber": { + "enabled": false + } + } +} From 72593ddac8483c536ff36e4f39edc9f4295a27a7 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Thu, 13 Jun 2019 16:54:40 +1000 Subject: [PATCH 04/13] housekeeping: Removed redundant initializers, check for single threading --- .../ConcurrencyAbstractionLayerWasmImpl.cs | 2 -- src/System.Reactive.Wasm/Internal/Stubs.cs | 3 -- .../Internal/TimerStubs.cs | 4 --- .../WasmPlatformEnlightenmentProvider.cs | 30 +++++++++---------- .../Internal/WasmScheduler.cs | 7 ----- 5 files changed, 15 insertions(+), 31 deletions(-) diff --git a/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs b/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs index 14b26d6..98e334f 100644 --- a/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs +++ b/src/System.Reactive.Wasm/Concurrency/ConcurrencyAbstractionLayerWasmImpl.cs @@ -3,7 +3,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -#if !NO_THREAD using System.Collections.Generic; using System.Reactive.Disposables; using System.Threading; @@ -242,4 +241,3 @@ private void Loop() } } } -#endif diff --git a/src/System.Reactive.Wasm/Internal/Stubs.cs b/src/System.Reactive.Wasm/Internal/Stubs.cs index 25bae14..3fa4da8 100644 --- a/src/System.Reactive.Wasm/Internal/Stubs.cs +++ b/src/System.Reactive.Wasm/Internal/Stubs.cs @@ -17,7 +17,4 @@ internal static class Stubs { public static readonly Action Nop = () => { }; } - -#if !NO_THREAD -#endif } diff --git a/src/System.Reactive.Wasm/Internal/TimerStubs.cs b/src/System.Reactive.Wasm/Internal/TimerStubs.cs index 6eda662..fbcb68b 100644 --- a/src/System.Reactive.Wasm/Internal/TimerStubs.cs +++ b/src/System.Reactive.Wasm/Internal/TimerStubs.cs @@ -7,10 +7,6 @@ namespace System.Reactive { internal static class TimerStubs { -#if NETSTANDARD1_3 - public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); -#else public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }); -#endif } } diff --git a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs index 15049e0..e1f1ee9 100644 --- a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs +++ b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs @@ -10,6 +10,7 @@ using System.Reactive.Linq; using System.Reflection; using System.Runtime.InteropServices; +using System.Threading; namespace System.Reactive.PlatformServices { @@ -31,26 +32,25 @@ public override T GetService(object[] args) { var t = typeof(T); -#if !NO_THREAD || WINDOWS - if (t == typeof(IConcurrencyAbstractionLayer)) + bool allowsThreads = true; + + try + { + new Thread(() => { }).Start(); + } + catch (NotSupportedException) + { + allowsThreads = false; + } + + if (!allowsThreads && t == typeof(IConcurrencyAbstractionLayer)) { -#if NETSTANDARD2_0 - if (_isWasm) - { - return (T)(object)new ConcurrencyAbstractionLayerWasmImpl(); - } -#endif + return (T)(object)new ConcurrencyAbstractionLayerWasmImpl(); } -#endif if (t == typeof(IScheduler) && args != null) { -#if NETSTANDARD2_0 - if (_isWasm) - { - return (T)(object)WasmScheduler.Default; - } -#endif + return (T)(object)WasmScheduler.Default; } return base.GetService(args); diff --git a/src/System.Reactive.Wasm/Internal/WasmScheduler.cs b/src/System.Reactive.Wasm/Internal/WasmScheduler.cs index 18b5b9b..d5015bb 100644 --- a/src/System.Reactive.Wasm/Internal/WasmScheduler.cs +++ b/src/System.Reactive.Wasm/Internal/WasmScheduler.cs @@ -3,15 +3,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -#if NETSTANDARD2_0 -using System; using System.Collections.Generic; -using System.Reactive.Concurrency; using System.Reactive.Disposables; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; namespace System.Reactive.Concurrency { @@ -164,4 +158,3 @@ private static void TimeoutCallback(int id) } } } -#endif From 2a8cdb9a1b5b0bc20e9d04c033ae5f783c08a17e Mon Sep 17 00:00:00 2001 From: Shimmy Weitzhandler <2716316+weitzhandler@users.noreply.github.com> Date: Sat, 15 Jun 2019 22:17:58 +0300 Subject: [PATCH 05/13] Improved EnlightenmentProvider and added blank tests project --- ...ctive.Wasm.sln => System.Reactive.Wasm.sln | 16 ++++-- .../WasmPlatformEnlightenmentProvider.cs | 52 ++++++++++++------- .../System.Reactive.Wasm.Tests.csproj | 22 ++++++++ 3 files changed, 65 insertions(+), 25 deletions(-) rename src/System.Reactive.Wasm.sln => System.Reactive.Wasm.sln (53%) create mode 100644 tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj diff --git a/src/System.Reactive.Wasm.sln b/System.Reactive.Wasm.sln similarity index 53% rename from src/System.Reactive.Wasm.sln rename to System.Reactive.Wasm.sln index 3f4b3e1..e0b3e1b 100644 --- a/src/System.Reactive.Wasm.sln +++ b/System.Reactive.Wasm.sln @@ -8,7 +8,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\version.json = ..\version.json EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive.Wasm", "System.Reactive.Wasm\System.Reactive.Wasm.csproj", "{3338BB57-11A9-4602-BBEB-9881128A53D9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive.Wasm", "src\System.Reactive.Wasm\System.Reactive.Wasm.csproj", "{E667F495-E8EF-4902-93C7-98363E292675}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reactive.Wasm.Tests", "tests\System.Reactive.Wasm.Tests\System.Reactive.Wasm.Tests.csproj", "{46822265-BD04-4B8D-80F4-DCE7A6B351B6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,10 +18,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3338BB57-11A9-4602-BBEB-9881128A53D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3338BB57-11A9-4602-BBEB-9881128A53D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3338BB57-11A9-4602-BBEB-9881128A53D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3338BB57-11A9-4602-BBEB-9881128A53D9}.Release|Any CPU.Build.0 = Release|Any CPU + {E667F495-E8EF-4902-93C7-98363E292675}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E667F495-E8EF-4902-93C7-98363E292675}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E667F495-E8EF-4902-93C7-98363E292675}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E667F495-E8EF-4902-93C7-98363E292675}.Release|Any CPU.Build.0 = Release|Any CPU + {46822265-BD04-4B8D-80F4-DCE7A6B351B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46822265-BD04-4B8D-80F4-DCE7A6B351B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46822265-BD04-4B8D-80F4-DCE7A6B351B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46822265-BD04-4B8D-80F4-DCE7A6B351B6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs index e1f1ee9..d7a6036 100644 --- a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs +++ b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs @@ -20,7 +20,28 @@ namespace System.Reactive.PlatformServices [EditorBrowsable(EditorBrowsableState.Never)] public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentProvider { - private static readonly bool _isWasm = RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY")); + private static bool? _isWasm; + + private static bool IsWasm + { + get + { + if (!_isWasm.HasValue) + { + try + { + new Thread(() => { }).Start(); + _isWasm = false; + } + catch (NotSupportedException) + { + _isWasm = true; + } + } + + return _isWasm.Value; + } + } /// /// (Infastructure) Tries to gets the specified service. @@ -30,27 +51,18 @@ public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentPro /// Service instance or null if not found. public override T GetService(object[] args) { - var t = typeof(T); - - bool allowsThreads = true; - - try + if (IsWasm) { - new Thread(() => { }).Start(); - } - catch (NotSupportedException) - { - allowsThreads = false; - } + Type t = typeof(T); - if (!allowsThreads && t == typeof(IConcurrencyAbstractionLayer)) - { - return (T)(object)new ConcurrencyAbstractionLayerWasmImpl(); - } - - if (t == typeof(IScheduler) && args != null) - { - return (T)(object)WasmScheduler.Default; + if (t == typeof(IConcurrencyAbstractionLayer)) + { + return (T)(object)new ConcurrencyAbstractionLayerWasmImpl(); + } + else if (t == typeof(IScheduler)) + { + return (T)(object)WasmScheduler.Default; + } } return base.GetService(args); diff --git a/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj b/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj new file mode 100644 index 0000000..08a2140 --- /dev/null +++ b/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj @@ -0,0 +1,22 @@ + + + + netcoreapp2.2 + + false + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + From 15043abd422ae730c9bbbdfa545690b3180cf1fd Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Sun, 16 Jun 2019 15:57:19 +1000 Subject: [PATCH 06/13] Update build.cake --- build.cake | 1 + 1 file changed, 1 insertion(+) diff --git a/build.cake b/build.cake index 23b9d36..610ccd7 100644 --- a/build.cake +++ b/build.cake @@ -10,6 +10,7 @@ var packageWhitelist = new[] var packageTestWhitelist = new FilePath[] { + MakeAbsolute(File("/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj")), }; BuildParameters.SetParameters(context: Context, From 792394866dc009b96598d374ff8a3fbc54f8810c Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Sun, 16 Jun 2019 15:57:42 +1000 Subject: [PATCH 07/13] Update build.cake --- build.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cake b/build.cake index 610ccd7..84427aa 100644 --- a/build.cake +++ b/build.cake @@ -10,7 +10,7 @@ var packageWhitelist = new[] var packageTestWhitelist = new FilePath[] { - MakeAbsolute(File("/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj")), + MakeAbsolute(File("./src/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj")), }; BuildParameters.SetParameters(context: Context, From 59959b576fdce5b81df6b38e44bfebf6c92e6611 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Sun, 16 Jun 2019 15:58:32 +1000 Subject: [PATCH 08/13] Move the tests project to the correct location needed --- .../System.Reactive.Wasm.Tests.csproj | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj diff --git a/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj b/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj deleted file mode 100644 index 08a2140..0000000 --- a/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - netcoreapp2.2 - - false - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - From 29823a3893b3b785d78ad7bba4050e2db179df26 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Sun, 16 Jun 2019 16:01:08 +1000 Subject: [PATCH 09/13] Fix project --- .../System.Reactive.Wasm.Tests.csproj | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj diff --git a/src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj b/src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj new file mode 100644 index 0000000..f4b8ad2 --- /dev/null +++ b/src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj @@ -0,0 +1,12 @@ + + + + netcoreapp2.2 + false + + + + + + + From f94d29597b17570899e66cafbc4ec3c6a8812411 Mon Sep 17 00:00:00 2001 From: Shimmy Weitzhandler <2716316+weitzhandler@users.noreply.github.com> Date: Sun, 16 Jun 2019 09:06:34 +0300 Subject: [PATCH 10/13] Fix test project doesn't load --- System.Reactive.Wasm.sln | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/System.Reactive.Wasm.sln b/System.Reactive.Wasm.sln index e0b3e1b..02d8223 100644 --- a/System.Reactive.Wasm.sln +++ b/System.Reactive.Wasm.sln @@ -10,7 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive.Wasm", "src\System.Reactive.Wasm\System.Reactive.Wasm.csproj", "{E667F495-E8EF-4902-93C7-98363E292675}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reactive.Wasm.Tests", "tests\System.Reactive.Wasm.Tests\System.Reactive.Wasm.Tests.csproj", "{46822265-BD04-4B8D-80F4-DCE7A6B351B6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Reactive.Wasm.Tests", "src\System.Reactive.Wasm.Tests\System.Reactive.Wasm.Tests.csproj", "{AEF30B2B-21E7-40CD-927F-4BF8448ACF6F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -22,10 +22,10 @@ Global {E667F495-E8EF-4902-93C7-98363E292675}.Debug|Any CPU.Build.0 = Debug|Any CPU {E667F495-E8EF-4902-93C7-98363E292675}.Release|Any CPU.ActiveCfg = Release|Any CPU {E667F495-E8EF-4902-93C7-98363E292675}.Release|Any CPU.Build.0 = Release|Any CPU - {46822265-BD04-4B8D-80F4-DCE7A6B351B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46822265-BD04-4B8D-80F4-DCE7A6B351B6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46822265-BD04-4B8D-80F4-DCE7A6B351B6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46822265-BD04-4B8D-80F4-DCE7A6B351B6}.Release|Any CPU.Build.0 = Release|Any CPU + {AEF30B2B-21E7-40CD-927F-4BF8448ACF6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AEF30B2B-21E7-40CD-927F-4BF8448ACF6F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AEF30B2B-21E7-40CD-927F-4BF8448ACF6F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AEF30B2B-21E7-40CD-927F-4BF8448ACF6F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 14137e6cf1455c2c2c9041305fdd59056167a894 Mon Sep 17 00:00:00 2001 From: Shimmy Weitzhandler <2716316+weitzhandler@users.noreply.github.com> Date: Sun, 16 Jun 2019 09:09:04 +0300 Subject: [PATCH 11/13] Added dummy test --- src/System.Reactive.Wasm.Tests/TestClass.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/System.Reactive.Wasm.Tests/TestClass.cs diff --git a/src/System.Reactive.Wasm.Tests/TestClass.cs b/src/System.Reactive.Wasm.Tests/TestClass.cs new file mode 100644 index 0000000..f86a6a8 --- /dev/null +++ b/src/System.Reactive.Wasm.Tests/TestClass.cs @@ -0,0 +1,18 @@ +using Xunit; + +namespace System.Reactive.Wasm.Tests +{ + /// + /// To be implemented later. + /// + public class TestClass + { + /// + /// Just to keep the CI quiet. + /// + [Fact] + public void Test_Dummy() + { + } + } +} From 3ed4ad773c6705bfd427d983a2b4b44d38a99aec Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Sun, 16 Jun 2019 16:09:26 +1000 Subject: [PATCH 12/13] Fix folder in the cake file --- build.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cake b/build.cake index 84427aa..1a5cb40 100644 --- a/build.cake +++ b/build.cake @@ -10,7 +10,7 @@ var packageWhitelist = new[] var packageTestWhitelist = new FilePath[] { - MakeAbsolute(File("./src/tests/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj")), + MakeAbsolute(File("./src/System.Reactive.Wasm.Tests/System.Reactive.Wasm.Tests.csproj")), }; BuildParameters.SetParameters(context: Context, From 74b42600e4a882ecfcc5f20b1ee0f334c8084066 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Sun, 16 Jun 2019 16:19:02 +1000 Subject: [PATCH 13/13] Change the wasm check to understand about unit tests --- .../WasmPlatformEnlightenmentProvider.cs | 37 +++++++++---------- .../System.Reactive.Wasm.csproj | 1 + 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs index d7a6036..08b4bfd 100644 --- a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs +++ b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs @@ -4,6 +4,7 @@ // See the LICENSE file in the project root for full license information. // WARNING: The full namespace-qualified type name should stay the same for the discovery in System.Reactive.Core to work! +using System; using System.ComponentModel; using System.Diagnostics; using System.Reactive.Concurrency; @@ -12,6 +13,8 @@ using System.Runtime.InteropServices; using System.Threading; +using Splat; + namespace System.Reactive.PlatformServices { /// @@ -20,28 +23,24 @@ namespace System.Reactive.PlatformServices [EditorBrowsable(EditorBrowsableState.Never)] public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentProvider { - private static bool? _isWasm; - - private static bool IsWasm - { - get + private static Lazy _isWasm = new Lazy( + () => { - if (!_isWasm.HasValue) + if (ModeDetector.InUnitTestRunner()) { - try - { - new Thread(() => { }).Start(); - _isWasm = false; - } - catch (NotSupportedException) - { - _isWasm = true; - } + return true; } - return _isWasm.Value; - } - } + try + { + new Thread(() => { }).Start(); + return false; + } + catch (NotSupportedException) + { + return true; + } + }, LazyThreadSafetyMode.PublicationOnly); /// /// (Infastructure) Tries to gets the specified service. @@ -51,7 +50,7 @@ private static bool IsWasm /// Service instance or null if not found. public override T GetService(object[] args) { - if (IsWasm) + if (_isWasm.Value) { Type t = typeof(T); diff --git a/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj b/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj index e51074f..c0be8e9 100644 --- a/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj +++ b/src/System.Reactive.Wasm/System.Reactive.Wasm.csproj @@ -8,6 +8,7 @@ +