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

android {
    def ext = rootProject.ext
    compileSdkVersion ext.compileSdkVersion

    defaultConfig {
        minSdkVersion ext.minLibSdkVersion
        targetSdkVersion ext.targetSdkVersion
        versionCode ext.versionCode
        versionName ext.versionName
    }
    buildTypes {
        release {
            consumerProguardFiles 'proguard-rules.pro'
        }

        lintOptions {
            abortOnError false
        }
    }

    //以下为配置library注释在打包jar后保留

    // 打包源码jar
    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
    }
    // 打包文档jar
    task javadocJar(type: Jar, dependsOn: javadoc) {
        classifier = 'javadoc'
        from javadoc.destinationDir
    }
    artifacts {
        archives sourcesJar
        archives javadocJar
    }
    dependencies {
        api project(':widget-core')
    }
}