|
| 1 | +apply plugin: 'com.android.library' |
| 2 | + |
| 3 | +apply plugin: 'com.github.dcendents.android-maven' |
| 4 | +apply plugin: 'com.jfrog.bintray' |
| 5 | + |
| 6 | +// This is the library version used when deploying the artifact |
| 7 | +version = "1.0.5.1" |
| 8 | + |
| 9 | +android { |
| 10 | + compileSdkVersion 10 |
| 11 | + buildToolsVersion "21.1.2" |
| 12 | + resourcePrefix "eventbus__" //这个随便填 |
| 13 | + |
| 14 | + defaultConfig { |
| 15 | + minSdkVersion 8 |
| 16 | + targetSdkVersion 9 |
| 17 | + } |
| 18 | + |
| 19 | + buildTypes { |
| 20 | + release { |
| 21 | + minifyEnabled false |
| 22 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' |
| 23 | + } |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +def siteUrl = 'https://github.com/bboyfeiyu/androideventbus' // 项目的主页 |
| 28 | +def gitUrl = 'https://github.com/bboyfeiyu/androideventbus.git' // Git仓库的url |
| 29 | +group = "org.simple" // Maven Group ID for the artifact,一般填你唯一的包名 |
| 30 | +install { |
| 31 | + repositories.mavenInstaller { |
| 32 | + // This generates POM.xml with proper parameters |
| 33 | + pom { |
| 34 | + project { |
| 35 | + packaging 'aar' |
| 36 | + // Add your description here |
| 37 | + name 'An lightweight android event bus library' //项目描述 |
| 38 | + url siteUrl |
| 39 | + // Set your license |
| 40 | + licenses { |
| 41 | + license { |
| 42 | + name 'The Apache Software License, Version 2.0' |
| 43 | + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 44 | + } |
| 45 | + } |
| 46 | + developers { |
| 47 | + developer { |
| 48 | + id 'bboyfeiyu' //填写的一些基本信息 |
| 49 | + name 'Mr.Simple' |
| 50 | + email 'bboyfeiyu@gmail.com' |
| 51 | + } |
| 52 | + } |
| 53 | + scm { |
| 54 | + connection gitUrl |
| 55 | + developerConnection gitUrl |
| 56 | + url siteUrl |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | + } |
| 61 | +} |
| 62 | +task sourcesJar(type: Jar) { |
| 63 | + from android.sourceSets.main.java.srcDirs |
| 64 | + classifier = 'sources' |
| 65 | +} |
| 66 | +task javadoc(type: Javadoc) { |
| 67 | + source = android.sourceSets.main.java.srcDirs |
| 68 | + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) |
| 69 | +} |
| 70 | +task javadocJar(type: Jar, dependsOn: javadoc) { |
| 71 | + classifier = 'javadoc' |
| 72 | + from javadoc.destinationDir |
| 73 | +} |
| 74 | +artifacts { |
| 75 | + archives javadocJar |
| 76 | + archives sourcesJar |
| 77 | +} |
| 78 | +Properties properties = new Properties() |
| 79 | +properties.load(project.rootProject.file('local.properties').newDataInputStream()) |
| 80 | +bintray { |
| 81 | + user = properties.getProperty("bintray.user") |
| 82 | + key = properties.getProperty("bintray.apikey") |
| 83 | + configurations = ['archives'] |
| 84 | + pkg { |
| 85 | + repo = "maven" |
| 86 | + name = "AndroidEventBus" //发布到JCenter上的项目名字 |
| 87 | + websiteUrl = siteUrl |
| 88 | + vcsUrl = gitUrl |
| 89 | + licenses = ["Apache-2.0"] |
| 90 | + publish = true |
| 91 | + } |
| 92 | +} |
0 commit comments