buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    defaultPublishConfig 'release'
    publishNonDefault true
    productFlavors {
        library {
        }
    }
    buildTypes {
        release {
            minifyEnabled false
        }
        debug {
            minifyEnabled false
        }
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    mavenLocal()
    jcenter()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../../example-redux/node_modules/react-native/android"
    }
}

allprojects { p ->
    p.tasks.whenTaskAdded { task ->
        if (task.name.toLowerCase().contains('lint')) {
            task.enabled = false;
        }
    }
}

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.aurelhubert:ahbottomnavigation:1.3.3"
    compile "com.android.support:appcompat-v7:23.0.1"
    compile 'com.android.support:design:23.1.1'
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile 'com.balysv.materialmenu:material-menu-toolbar:1.5.4'

    testCompile "junit:junit:4.12"
    testCompile "org.robolectric:robolectric:3.1.1"
    testCompile 'org.assertj:assertj-core:3.5.2'
}

task unit(dependsOn: 'testLibraryDebugUnitTest') << {
    println 'Finished running unit all tests'
    println 'report at file://' + tasks.testLibraryDebugUnitTest.outputs.files.last().absolutePath + '/index.html'
}