|
@@ -1,80 +1,28 @@
|
|
|
-// 这里添加下面两行代码。
|
|
|
-apply plugin: 'com.github.dcendents.android-maven'
|
|
|
-apply plugin: 'com.jfrog.bintray'
|
|
|
+apply plugin: 'maven-publish'
|
|
|
+apply plugin: 'maven'
|
|
|
|
|
|
-// 定义两个链接,下面会用到。
|
|
|
-def siteUrl = 'http://www.yanyis.space/yanyi/basepermission' // 项目主页。
|
|
|
-def gitUrl = 'http://www.yanyis.space/yanyi/basepermission.git' // Git仓库的url。
|
|
|
+Properties properties = new Properties()
|
|
|
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
|
+uploadArchives {
|
|
|
+ repositories {
|
|
|
+ mavenDeployer {
|
|
|
+ repository(url: properties.getProperty("POM_URL")) {
|
|
|
+ authentication(userName: properties.getProperty("nexus.user"), password: properties.getProperty("nexus.password"))
|
|
|
+ }
|
|
|
|
|
|
-group = "com.yanyi.benyanyi"// 唯一包名,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的com.ansen.http就是这里配置的。
|
|
|
-version = "1.0.9"//项目引用的版本号,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的1.0.1就是这里配置的。
|
|
|
-install {
|
|
|
- repositories.mavenInstaller {
|
|
|
- // This generates POM.xml with proper parameters
|
|
|
- pom {
|
|
|
- project {
|
|
|
- packaging 'aar'
|
|
|
- // Add your description here
|
|
|
- name '动态获取权限。'
|
|
|
- url siteUrl
|
|
|
- // Set your license
|
|
|
+ pom.groupId = properties.getProperty("POM_GROUP_ID")
|
|
|
+ pom.artifactId = properties.getProperty("POM_ATRIFACT_ID")
|
|
|
+ pom.version = properties.getProperty("POM_VERSION")
|
|
|
+
|
|
|
+ pom.project {
|
|
|
licenses {
|
|
|
license {
|
|
|
name 'The Apache Software License, Version 2.0'
|
|
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
|
}
|
|
|
}
|
|
|
- developers {
|
|
|
- developer {
|
|
|
- id 'benyanyi' //填写的一些基本信息
|
|
|
- name 'benyanyi'
|
|
|
- email 'git@yanyi.red'
|
|
|
- }
|
|
|
- }
|
|
|
- scm {
|
|
|
- connection gitUrl
|
|
|
- developerConnection gitUrl
|
|
|
- url siteUrl
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-task sourcesJar(type: Jar) {
|
|
|
- from android.sourceSets.main.java.srcDirs
|
|
|
- classifier = 'sources'
|
|
|
-}
|
|
|
-task javadoc(type: Javadoc) {
|
|
|
- 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
|
|
|
-}
|
|
|
-Properties properties = new Properties()
|
|
|
-properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
|
-bintray {
|
|
|
- user = properties.getProperty("bintray.user")
|
|
|
- key = properties.getProperty("bintray.apikey")
|
|
|
- configurations = ['archives']
|
|
|
- pkg {
|
|
|
- repo = "BasePermission"
|
|
|
- name = "PermissionHelper" //发布到JCenter上的项目名字
|
|
|
- websiteUrl = siteUrl
|
|
|
- vcsUrl = gitUrl
|
|
|
- licenses = ["Apache-2.0"]
|
|
|
- publish = true
|
|
|
- }
|
|
|
-}
|
|
|
-javadoc { //jav doc采用utf-8编码否则会报“GBK的不可映射字符”错误
|
|
|
- options{
|
|
|
- encoding "UTF-8"
|
|
|
- charSet 'UTF-8'
|
|
|
- }
|
|
|
-}
|
|
|
//gradlew bintrayUpload terminal中输入
|