Skip to content
FrantisekGazo edited this page Dec 26, 2016 · 20 revisions

Android library for boilerplate destruction - "Just code what is worth coding"

  • Generates boilerplate code based on used annotations and lets you focus on what matters.
  • Generated code is fully traceable.
  • Everything is generated during compile time.
  • No reflection used!
  • Consists of modules.

Modules

This library is divided into several modules. Each module provides different annotation and support classes:

Special annotation:

Usage

##1. Create configuration file named blade.yaml in application directory with Blade modules you need: (or download from sample app)

modules:
  - arg
  - extra
  - mvp
  - parcel
  - state

When you change the file run gradle sync in order to refresh dependencies!

JSON format is still supported (as it was used by older versions). So if you want you can create blade.json instead.

{
    "modules": [
        "arg",
        "extra",
        "mvp",
        "parcel",
        "state"
    ]
}

##2. Apply Gradle plugin:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        // Add Blade plugin
        classpath 'eu.f3rog.blade:plugin:2.5.0'
    }
}

apply plugin: 'com.android.application'
// Apply Blade plugin
apply plugin: 'blade'

NOTE:

It is recommended to use android gradle plugin 2.2 or higher.

If you use older version of the android gradle plugin (min 1.5.0 is allowed) then you need to apply apt plugin. Read this for more information.

NOTE:

If you change used annotations - e.g. some field had some annotation and you add another or you remove some - please run a clean build after such changes.

Clone this wiki locally