GithubHelp home page GithubHelp logo

reactiveui / pharmacist Goto Github PK

View Code? Open in Web Editor NEW
237.0 10.0 14.0 2.46 MB

Builds observables from events.

License: MIT License

C# 100.00%
reactive-programming reactive-extensions dotnet msbuild reactivex rx dotnetcore observable

pharmacist's Introduction

Build Code Coverage

Pharmacist

Builds observables from events.

Source Generator

A source generator version is being worked on over here: https://github.com/reactivemarbles/ObservableEventsSourceGenerator

NuGet Packages

Install the following packages to start using Pharmacist.

Name Platform NuGet
Pharmacist.Core Core - Libary CoreBadge
Pharmacist Global Tool GlobalToolBadge
Pharmacist.MSBuild MSBuild Task MsBuildBadge
Pharmacist.Common Common CommonBadge

What does it do?

Pharmacist will convert events within an assembly and create observable wrappers for them.

It has been called pharmacist since it will generate Reactive Extensions (Rx) Observables for events, so it's a play on word about "Rx" which is short for prescriptions.

It can generate the observables for the following:

  • System Platforms, such as Xamarin (iOS/Android/TVOS), UWP
  • NuGet packages
  • Assemblies.

There is a MSBuild Task version and a global tool version.

How do I use?

MsBuild

Pharmacist can automatically create Observable wrappers for projects for their explicitly included NuGet packages.

In your .csproj file you can add:

<ItemGroup>
    <PackageReference Include="Pharmacist.MsBuild" Version="1.*" PrivateAssets="all" />
    <PackageReference Include="Pharmacist.Common" Version="1.*" />
</ItemGroup>

Pharmacist.MsBuild contains the MsBuild target file and appropriate tasks. Pharmacist.Common includes common source code that is required to invoke the generated observables.

This will generate wrappers only for other included PackageReference's contained within the project file.

For example if you had a inclusion for Xamarin.Forms in the same project that includes Pharmacist it will generate Observable wrappers for the included codes. It will not include any child PackageReference from other projects included via a ProjectReference. You can override that functionality by including <PharmacistGlobalPackages>true</PharmacistGlobalPackages> in a PropertyGroup inside your project.

Also it will only generate the specified ProjectReference and none of it's dependent packages. For example for a ProjectReference inclusion of ReactiveUI, it will not generate dependencies such as System.Reactive. If you want to generate observable wrappers for the dependent NuGet packages you must explicitly include them.

Command Line

Pharmacist comes with a command line version which is useful for generating for a specified platform.

The following values are supported for platforms: Android, iOS, Mac, WPF, UWP, Winforms, TVOS

Install the global tool:

dotnet tool install -g Pharmacist

To generate files:

pharmacist generate-platform -p <Platform> -o c:/directory/for/output --output-prefix="Events"

This would generate a file named Events_<Platform>.cs, where Platform would be the platform specified.

In the near future this will be changing to TargetFramework with /wpf and /winforms options.

Contribute

Pharmacist is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. Because of our Open Collective model for funding and transparency, we are able to funnel support and funds through to our contributors and community. We ❤ the people who are involved in this project, and we’d love to have you on board, especially if you are just getting started or have never contributed to open-source before.

So here's to you, lovely person who wants to join us — this is how you can support us:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.