Skip to content

Commit

Permalink
feature: Add ReactiveUI.Drawing (#2353)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennawatson committed Feb 25, 2020
1 parent ecd1830 commit b7df987
Show file tree
Hide file tree
Showing 44 changed files with 535 additions and 1,270 deletions.
1 change: 1 addition & 0 deletions build.cake
Expand Up @@ -28,6 +28,7 @@ var packageWhitelist = new List<FilePath>
MakeAbsolute(File("./src/ReactiveUI.XamForms/ReactiveUI.XamForms.csproj")),
MakeAbsolute(File("./src/ReactiveUI.Uno/ReactiveUI.Uno.csproj")),
MakeAbsolute(File("./src/ReactiveUI.Blazor/ReactiveUI.Blazor.csproj")),
MakeAbsolute(File("./src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj")),
};

if (IsRunningOnWindows())
Expand Down
2 changes: 1 addition & 1 deletion build.config
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
CAKE_VERSION=0.36.0
CAKE_VERSION=0.37.0
5 changes: 2 additions & 3 deletions src/Directory.build.props
Expand Up @@ -49,7 +49,7 @@
<PackageReference Include="Xunit.StaFact" Version="0.3.18" />
<PackageReference Include="Shouldly" Version="4.0.0-beta0002" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.3.2" />
<PackageReference Include="PublicApiGenerator" Version="9.3.0" />
<PackageReference Include="PublicApiGenerator" Version="10.0.2" />
</ItemGroup>

<ItemGroup Condition="$(IsTestProject)">
Expand All @@ -69,14 +69,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.26" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.50" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="stylecop.analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="2.3.0" PrivateAssets="All" />
<PackageReference Condition="'$(OS)' == 'Windows_NT'" Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
Expand Down
1 change: 0 additions & 1 deletion src/ReactiveUI.Android.Tests/MainActivity.cs
Expand Up @@ -29,7 +29,6 @@ public class MainActivity : RunnerActivity
/// <inheritdoc/>
protected override void OnCreate(Bundle bundle)
{
Locator.CurrentMutable.RegisterPlatformBitmapLoader();
AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly);

AddTestAssembly(typeof(ReactiveUI.Tests.RxAppTest).Assembly);
Expand Down
4 changes: 2 additions & 2 deletions src/ReactiveUI.Android.Tests/ReactiveUI.Android.Tests.csproj
Expand Up @@ -71,7 +71,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit.runner.devices">
<Version>2.*</Version>
<Version>2.5.25</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand All @@ -92,4 +92,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
19 changes: 19 additions & 0 deletions src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj
@@ -0,0 +1,19 @@
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>MonoAndroid90;Xamarin.iOS10;Xamarin.Mac20;Xamarin.TVOS10;tizen40;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net461;uap10.0.16299;netcoreapp3.0</TargetFrameworks>
<AssemblyName>ReactiveUI.Drawing</AssemblyName>
<RootNamespace>ReactiveUI.Drawing</RootNamespace>
<PackageDescription>A extension to the ReactiveUI platform that provides Splat bitmap operation support.</PackageDescription>
<PackageId>ReactiveUI.Drawing</PackageId>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveUI\ReactiveUI.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Splat.Drawing" Version="9.*" />
</ItemGroup>
</Project>
32 changes: 32 additions & 0 deletions src/ReactiveUI.Drawing/Registrations.cs
@@ -0,0 +1,32 @@
// 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.Reactive.Concurrency;
using ReactiveUI;
using Splat;

namespace ReactiveUI.Drawing
{
/// <summary>
/// Splat Drawing platform registrations.
/// </summary>
/// <seealso cref="ReactiveUI.IWantsToRegisterStuff" />
public class Registrations : IWantsToRegisterStuff
{
/// <inheritdoc/>
public void Register(Action<Func<object>, Type> registerFunction)
{
if (registerFunction == null)
{
throw new ArgumentNullException(nameof(registerFunction));
}

#if !NETSTANDARD && !NETCOREAPP2_0
registerFunction(() => new PlatformBitmapLoader(), typeof(IBitmapLoader));
#endif
}
}
}
5 changes: 5 additions & 0 deletions src/ReactiveUI.Fody.Analyzer/ReactiveObjectAnalyzer.cs
Expand Up @@ -49,6 +49,11 @@ public class ReactiveObjectAnalyzer : DiagnosticAnalyzer
/// <param name="context">The Roslyn Context.</param>
public override void Initialize(AnalysisContext context)
{
if (context is null)
{
throw new System.ArgumentNullException(nameof(context));
}

context.EnableConcurrentExecution();
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);

Expand Down
@@ -1,27 +1,27 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.AndroidSupport")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Tests")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Winforms")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Wpf")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.XamForms")]
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName=".NET Framework 4.6.1")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.AndroidSupport")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.Tests")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.Winforms")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.Wpf")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.XamForms")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName=".NET Framework 4.6.1")]
namespace ReactiveUI.Fody.Helpers
{
[System.AttributeUsageAttribute(System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.All)]
[System.AttributeUsage(System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.All)]
public class ObservableAsPropertyAttribute : System.Attribute
{
public ObservableAsPropertyAttribute() { }
}
public class static ObservableAsPropertyExtensions
public static class ObservableAsPropertyExtensions
{
public static ReactiveUI.ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this System.IObservable<TRet> item, TObj source, System.Linq.Expressions.Expression<System.Func<TObj, TRet>> property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null)
public static ReactiveUI.ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this System.IObservable<TRet> item, TObj source, System.Linq.Expressions.Expression<System.Func<TObj, TRet>> property, TRet initialValue = default, bool deferSubscription = false, System.Reactive.Concurrency.IScheduler scheduler = null)
where TObj : ReactiveUI.ReactiveObject { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Property | System.AttributeTargets.All)]
[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.All)]
public class ReactiveAttribute : System.Attribute
{
public ReactiveAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Property | System.AttributeTargets.All)]
[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.All)]
public class ReactiveDependencyAttribute : System.Attribute
{
public ReactiveDependencyAttribute(string targetName) { }
Expand Down

This file was deleted.

@@ -0,0 +1,31 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.AndroidSupport")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.Tests")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.Winforms")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.Wpf")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ReactiveUI.XamForms")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v2.0", FrameworkDisplayName="")]
namespace ReactiveUI.Fody.Helpers
{
[System.AttributeUsage(System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.All)]
public class ObservableAsPropertyAttribute : System.Attribute
{
public ObservableAsPropertyAttribute() { }
}
public static class ObservableAsPropertyExtensions
{
public static ReactiveUI.ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this System.IObservable<TRet> item, TObj source, System.Linq.Expressions.Expression<System.Func<TObj, TRet>> property, TRet initialValue = default, bool deferSubscription = false, System.Reactive.Concurrency.IScheduler scheduler = null)
where TObj : ReactiveUI.ReactiveObject { }
}
[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.All)]
public class ReactiveAttribute : System.Attribute
{
public ReactiveAttribute() { }
}
[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.All)]
public class ReactiveDependencyAttribute : System.Attribute
{
public ReactiveDependencyAttribute(string targetName) { }
public string Target { get; }
public string TargetProperty { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/ReactiveUI.Fody.Tests/ApiApprovalBase.cs
Expand Up @@ -41,7 +41,7 @@ protected static void CheckApproval(Assembly assembly, [CallerMemberName]string
approvedPublicApi = File.ReadAllText(approvedFileName);
}

var receivedPublicApi = Filter(ApiGenerator.GeneratePublicApi(assembly));
var receivedPublicApi = Filter(ApiGenerator.GeneratePublicApi(assembly, new ApiGeneratorOptions()));

if (!string.Equals(receivedPublicApi, approvedPublicApi, StringComparison.InvariantCulture))
{
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net461</TargetFrameworks>
<FodyTargetFramework>netstandard2.0</FodyTargetFramework>
<FodyTargetFramework Condition=" $(TargetFramework.StartsWith('net4')) ">$(TargetFramework)</FodyTargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion>
Expand Down
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net461</TargetFrameworks>
<FodyTargetFramework>netstandard2.0</FodyTargetFramework>
<FodyTargetFramework Condition=" $(TargetFramework.StartsWith('net4')) ">$(TargetFramework)</FodyTargetFramework>
Expand Down

0 comments on commit b7df987

Please sign in to comment.