apply plugin: 'com.android.library'

android {
    compileSdkVersion androidExt['compileSdkVersion']
    buildToolsVersion androidExt['buildToolsVersion']

    defaultConfig {
        minSdkVersion androidExt['minSdkVersion']
        targetSdkVersion androidExt['targetSdkVersion']
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testCompile 'junit:junit:4.12'
}


//task to copy library to libs
task copyLibrary(type: Copy) {

    from('build/outputs/aar/library-debug.aar')
    into('../app/libs')
    ///Rename the aar
    rename('library-debug.aar', 'plugin-library.aar')
}

copyLibrary.dependsOn(build)
