Skip to content

Commit

Permalink
initial work to support netcoreapp1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsink committed Jun 22, 2017
1 parent b6209cd commit 0928cff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/Directory.build.targets
Expand Up @@ -18,8 +18,11 @@
<PropertyGroup Condition="'$(TargetFramework)' == 'MonoAndroid70'">
<DefineConstants>$(DefineConstants);MONO;ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp1.1'">
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform " Version="5.2.2" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions src/ReactiveUI/CreatesCommandBinding.cs
Expand Up @@ -21,11 +21,11 @@ public class CreatesCommandBindingViaEvent : ICreatesCommandBinding
{
// NB: These are in priority order
static readonly List<Tuple<string, Type>> defaultEventsToBind = new List<Tuple<string, Type>>() {
#if !MONO && !PORTABLE
#if !MONO && !PORTABLE && !NETCOREAPP
Tuple.Create("Click", typeof (RoutedEventArgs)),
#endif
Tuple.Create("TouchUpInside", typeof (EventArgs)),
#if !MONO && !NETFX_CORE && !PORTABLE
#if !MONO && !NETFX_CORE && !PORTABLE && !NETCOREAPP
Tuple.Create("MouseUp", typeof (MouseButtonEventArgs)),
#elif NETFX_CORE
Tuple.Create("PointerReleased", typeof(PointerRoutedEventArgs)),
Expand Down
13 changes: 10 additions & 3 deletions src/ReactiveUI/Platforms/shared/Registrations.cs
Expand Up @@ -12,13 +12,15 @@ public class PlatformRegistrations : IWantsToRegisterStuff
{
public void Register(Action<Func<object>, Type> registerFunction)
{
#if !NETCOREAPP
registerFunction(() => new PlatformOperations(), typeof(IPlatformOperations));
#endif

#if !NETFX_CORE && !WP8 && !WP81
#if !NETFX_CORE && !WP8 && !WP81 && !NETCOREAPP
registerFunction(() => new ComponentModelTypeConverter(), typeof(IBindingTypeConverter));
#endif

#if !MONO
#if !MONO && !NETCOREAPP
registerFunction(() => new ActivationForViewFetcher(), typeof(IActivationForViewFetcher));
registerFunction(() => new DependencyObjectObservableForProperty(), typeof(ICreatesObservableForProperty));
registerFunction(() => new BooleanToVisibilityTypeConverter(), typeof(IBindingTypeConverter));
Expand Down Expand Up @@ -50,14 +52,19 @@ public void Register(Action<Func<object>, Type> registerFunction)
RxApp.MainThreadScheduler = new WaitForDispatcherScheduler(() => new NSRunloopScheduler());
#endif

#if !MONO && !NETFX_CORE
#if !MONO && !NETFX_CORE && !NETCOREAPP
RxApp.MainThreadScheduler = new WaitForDispatcherScheduler(() => DispatcherScheduler.Current);
#endif

#if NETFX_CORE
RxApp.MainThreadScheduler = new WaitForDispatcherScheduler(() => CoreDispatcherScheduler.Current);
#endif

#if NETCOREAPP
// TODO does something for the MainThreadScheduler need to go here?
// interesting to note that when MONO is defined, MainThreadScheduler does not get set.
#endif

#if ANDROID
RxApp.MainThreadScheduler = HandlerScheduler.MainThreadScheduler;
#endif
Expand Down
8 changes: 6 additions & 2 deletions src/ReactiveUI/ReactiveUI.csproj
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.1;net45;uap10.0;Xamarin.iOS10;Xamarin.Mac20;MonoAndroid70</TargetFrameworks>
<TargetFrameworks>netstandard1.1;net45;uap10.0;Xamarin.iOS10;Xamarin.Mac20;MonoAndroid70;netcoreapp1.1</TargetFrameworks>
<AssemblyName>ReactiveUI</AssemblyName>
<RootNamespace>ReactiveUI</RootNamespace>
<Description>A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. Supports Xamarin.iOS, Xamarin.Android, Xamarin.Mac, Xamarin Forms, WPF, Windows Forms, Windows Phone 8.1, Windows Store and Universal Windows Platform (UWP).</Description>
Expand Down Expand Up @@ -59,6 +59,10 @@
<Compile Include="Platforms\xamarin-common\**\*.cs" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
<Compile Include="Platforms\netcoreapp1.1\**\*.cs" />
</ItemGroup>

<ItemGroup>
<None Update="VariadicTemplates.tt" Generator="TextTemplatingFileGenerator" LastGenOutput="VariadicTemplates.cs" />
<Compile Update="VariadicTemplates.cs" DesignTime="true" AutoGen="true" DependentUpon="VariadicTemplates.tt" />
Expand All @@ -69,4 +73,4 @@
</ItemGroup>

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project>
</Project>

0 comments on commit 0928cff

Please sign in to comment.