io.github.reactivecircus.blueprint:blueprint-interactor-common

Common APIs for all Blueprint Interactor implementations


Keywords
android, architecture, kotlin, kotlin-coroutines, kotlin-flow, rxjava2, rxjava3, testing
License
Apache-2.0

Documentation

Blueprint

CircleCI Codacy Badge License

Architectural frameworks and toolkits for bootstrapping modern Android codebases, written in Kotlin.

Motivation

These days whenever I kickoff a new Android project I always start by adding a bunch of infrastructure code (frameworks and toolkits) I developed over the years as they work really well in modern Android codebases which follow Clean Architecture and reactive paradigm, with strong emphasis on automated UI testing.

These frameworks and toolkits have now become a library.

Dependencies

Blueprint offers multiple independent artifacts covering different use cases. But they are all "optional" which means you can choose to only use the ones that make sense for your codebase.

Dependencies are hosted on Maven Central.

Latest stable version:

def blueprint_version = "1.0.1"

If you use Kotlin Coroutines and Flow:

// Building Interactors based on Kotlin Coroutines and Flow
implementation "io.github.reactivecircus.blueprint:blueprint-interactor-coroutines:${blueprint_version}"

// Wrapper API for threading with Kotlin CoroutineDispatcher
implementation "io.github.reactivecircus.blueprint:blueprint-threading-coroutines:${blueprint_version}"

// Android UI extensions, utilities and widgets
implementation "io.github.reactivecircus.blueprint:blueprint-ui:${blueprint_version}"

// Android UI testing framework with Testing Robot DSL
implementation "io.github.reactivecircus.blueprint:blueprint-testing-robot:${blueprint_version}"

If you use RxJava 2:

// Building Interactors based on RxJava 2
implementation "io.github.reactivecircus.blueprint:blueprint-interactor-rx2:${blueprint_version}"

// Wrapper API for threading with RxJava 2 Schedulers
implementation "io.github.reactivecircus.blueprint:blueprint-threading-rx2:${blueprint_version}"

// Android UI extensions, utilities and widgets
implementation "io.github.reactivecircus.blueprint:blueprint-ui:${blueprint_version}"

// Android UI testing framework with Testing Robot DSL
implementation "io.github.reactivecircus.blueprint:blueprint-testing-robot:${blueprint_version}"

If you use RxJava 3:

// Building Interactors based on RxJava 3
implementation "io.github.reactivecircus.blueprint:blueprint-interactor-rx3:${blueprint_version}"

// Wrapper API for threading with RxJava 3 Schedulers
implementation "io.github.reactivecircus.blueprint:blueprint-threading-rx3:${blueprint_version}"

// Android UI extensions, utilities and widgets
implementation "io.github.reactivecircus.blueprint:blueprint-ui:${blueprint_version}"

// Android UI testing framework with Testing Robot DSL
implementation "io.github.reactivecircus.blueprint:blueprint-testing-robot:${blueprint_version}"

Snapshots of the development version are available in Sonatype's snapshots repository.

Samples

There are a couple of sample apps demonstrating how you may use Blueprint, one based on Kotlin Coroutines and the other one based on RxJava 2.

Overview

The following is a high-level overview of what each Blueprint artifact does. For details and sample usage please check the samples and the documentation (README.md) in each of the sub-projects.

Blueprint Interactor Coroutines

This artifact provides 2 base classes for building Interactors (use case in Clean Architecture):

  • SuspendingInteractor for single-response tasks
  • FlowInteractor for cold streams

Please check blueprint-interactor-coroutines for details.

Blueprint Threading Coroutines

This artifact provides a CoroutineDispatcherProvider API for encapsulating the threading behavior with Kotlin CoroutineDispatcher.

Please check blueprint-threading-coroutines for details.

Blueprint Interactor RxJava 2

This artifact provides 3 base classes for building Interactors (use case in Clean Architecture):

  • SingleInteractor for single-response (with result) tasks
  • CompletableInteractor for single-response (no result) tasks
  • ObservableInteractor for cold streams

Please check blueprint-interactor-rx2 for details.

Blueprint Threading RxJava 2

This artifact provides a SchedulerProvider API for encapsulating the threading behavior with RxJava 2 Schedulers.

Please check blueprint-threading-rx2 for details.

Blueprint Interactor RxJava 3

This artifact provides 3 base classes for building Interactors (use case in Clean Architecture):

  • SingleInteractor for single-response (with result) tasks
  • CompletableInteractor for single-response (no result) tasks
  • ObservableInteractor for cold streams

Please check blueprint-interactor-rx3 for details.

Blueprint Threading RxJava 3

This artifact provides a SchedulerProvider API for encapsulating the threading behavior with RxJava 3 Schedulers.

Please check blueprint-threading-rx3 for details.

Blueprint UI

This artifact provides convenient Kotlin extensions and widgets for working with the Android UI toolkit.

Please check blueprint-ui for details.

Blueprint Testing Robot

This artifact provides a UI testing framework and Testing Robot DSL for authoring structured, readable, and framework-agnostic UI tests.

Please check blueprint-testing-robot for details.

License

Copyright 2019 Yang Chen

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.