Home

Awesome

fat-aar-plugin

Download

This is a gradle plugin that helps to output fat aar from android library. I am inspired by android-fat-aar. And aim to make more flexible and functional. It's convenient to sdk developer(developer that provide a single aar library).

It works with the android gradle plugin, the android plugin's version of the development is 2.2.3, other revision is not tested actually. Commit an issue as you encounter some compatibility.

Essentially, fat-aar-plugin makes a hack way, to collect resources, jar files and something others in embedded dependencies, into the bundled output aar. Click here to know more about AAR.

[Features]

Getting Started

Step 1: Apply plugin

Add snippet below to your root build script file:

buildscript {
    repositories {
        maven {
            url  "http://dl.bintray.com/vigidroid/maven"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:xxx'
        classpath 'me.vigi:fat-aar-plugin:0.2.8'
    }
}

Add snippet below to the build.gradle of your android library:

apply plugin: 'me.vigi.fat-aar'

Step 2: Embed dependencies

change compile to embed while you want to embed the dependency in the library. Like this:

dependencies {
    // aar project
    embed project(':aar-lib')
    // java project
    embed project(':java-lib')
    // java dependency
    embed 'com.google.guava:guava:20.0'
    // aar dependency
    embed 'com.android.volley:volley:1.0.0'
  
    // other dependencies you don't want to embed in
    compile 'com.squareup.okhttp3:okhttp:3.6.0'
}

More usage see example.

About AAR File

AAR is a file format for android library. The file itself is a zip file that containing useful stuff in android. See anatomy of an aar file here.

support list for now:

Known Defects or Issues

Thanks

android-fat-aar