apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
    compileSdkVersion 24



    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"

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

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

}

// 打包源码jar
task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}
//编译groovy代码时采用 UTF-8
tasks.withType(GroovyCompile) {
    groovyOptions.encoding = "MacRoman"
}

//编译JAVA文件时采用UTF-8
tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

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

// 打包文档jar
task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}


dependencies {
    implementation 'com.android.support:support-v4:24.2.1'
}

