标签:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:1.1.2‘
classpath ‘com.github.dcendents:android-maven-plugin:1.2‘
classpath ‘com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0‘
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: ‘com.github.dcendents.android-maven‘
apply plugin: ‘com.jfrog.bintray‘
def siteUrl = ‘https://github.com/linwoain/lin_library‘ // 项目的主页
def gitUrl = ‘https://github.com/linwoain/lin_library.git‘ // Git仓库的url
group = "com.linwoain.library"
// 项目的包名install {
repositories.mavenInstaller {
pom {
project {
packaging ‘aar‘
name ‘Android Utils‘ //项目描述
url siteUrl
licenses {
license {
name ‘The Apache Software License, Version 2.0‘
url ‘http://www.apache.org/licenses/LICENSE-2.0.txt‘
}
}
developers {
developer {
id ‘linwoain‘ //填写的一些基本信息
name ‘linwoain‘
email ‘lin@linwoain.com‘
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = ‘sources‘
}
task javadoc(type: Javadoc) {
options.encoding = ‘UTF-8‘
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 = "maven"
name = "Lin_library" //发布到JCenter上的项目名字
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
标签:
原文地址:http://www.cnblogs.com/linwoain/p/020a276b5754645bb2bd58101a6beb3b.html