-
Notifications
You must be signed in to change notification settings - Fork 94
/
maven.gradle
82 lines (73 loc) · 2.67 KB
/
maven.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
//这个是和你bintray上面创建的package(项目)是对应的
//定义版本标识
def siteUrl = 'https://github.com/icechao/KlineChart'// #CONFIG# // project homepage
def gitUrl = 'https://github.com/icechao/KlineChart.git'// #CONFIG# // project git
// 加载本地配置
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
group = properties.getProperty("bintray.group")
version = properties.getProperty("bintray.version")
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
description properties.getProperty("bintray.desc")
name 'klinechart'
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer { // 可默认,开发者信息
id 'YOUR_ID'
name 'icechao'
email properties.getProperty("bintray.email")
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
}
task androidJavadocsJar(type: Jar) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = properties.getProperty("bintray.repo") //发布到Bintray的那个仓库里,默认账户有四个库,我们这里上传到maven库
name = properties.getProperty("bintray.name") //需更改,这个名字就是你在Bintray上创建Package的名字,这里会查询,如果此包不存在就会创建一个。
userOrg = user //组织名称 organization
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}