apply plugin: 'com.android.library'
apply plugin: 'checkstyle'
apply from: "../extra/checkstyle/checkstyle_android_library.gradle"
apply plugin: 'com.github.dcendents.android-maven'

group = libraryGroup
version = libraryVersion

android {
    compileSdkVersion compileSdk
    buildToolsVersion buildTools

    defaultConfig {
        minSdkVersion minSdk
        targetSdkVersion targetSdk
    }

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile libraries.appCompat

    compile project(':flowr-annotations')
    // Test
    testCompile testLibraries.hamcrest
    testCompile testLibraries.junit
    testCompile testLibraries.mockito
}

// build a jar with source files
task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

task javadoc(type: Javadoc) {
    failOnError  false
    source = android.sourceSets.main.java.sourceFiles
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    classpath += configurations.compile
}

// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}
