Skip to content

Latest commit

 

History

History
174 lines (111 loc) · 6.92 KB

README.md

File metadata and controls

174 lines (111 loc) · 6.92 KB

Blueprint

CI Maven Central Android API 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.18.0"

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 doing async work with Kotlin CoroutineDispatcher
implementation "io.github.reactivecircus.blueprint:blueprint-async-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 doing async work with RxJava 2 Schedulers
implementation "io.github.reactivecircus.blueprint:blueprint-async-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 doing async work with RxJava 3 Schedulers
implementation "io.github.reactivecircus.blueprint:blueprint-async-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-shot tasks
  • FlowInteractor for cold streams

Please check blueprint-interactor-coroutines for details.

Blueprint Async Coroutines

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

Please check blueprint-async-coroutines for details.

Blueprint Interactor RxJava 2

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

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

Please check blueprint-interactor-rx2 for details.

Blueprint Async RxJava 2

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

Please check blueprint-async-rx2 for details.

Blueprint Interactor RxJava 3

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

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

Please check blueprint-interactor-rx3 for details.

Blueprint Async RxJava 3

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

Please check blueprint-async-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.