apply plugin: 'com.android.library' apply plugin: 'com.jfrog.bintray' Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) version = rootProject.ext.CLIP_PATH_LAYOUT_VERSION //发布版本号 group = "com.yxf" //最终引用形式 android { compileSdkVersion 28 defaultConfig { minSdkVersion 19 targetSdkVersion 28 versionCode 1 versionName rootProject.ext.CLIP_PATH_LAYOUT_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } task javadoc(type: Javadoc) { failOnError false //必须添加以免出错 source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) } task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } artifacts { archives javadocJar archives sourcesJar } javadoc { options{ encoding "UTF-8" charSet 'UTF-8' author true version true links "http://docs.oracle.com/javase/7/docs/api" title "ClipPathLayoutJavaDoc" } }