-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbintray.gradle
More file actions
94 lines (91 loc) · 3.08 KB
/
bintray.gradle
File metadata and controls
94 lines (91 loc) · 3.08 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
version = "1.0.0" //版本号,以后每次更新library都得更改
def siteUrl = 'https://github.com/SmartCodeLab/SmartFloatLayout' //Homepage URL of the library
def gitUrl = 'https://github.com/SmartCodeLab/SmartFloatLayout.git' //Git repository url
def issueUrl = 'https://github.com/SmartCodeLab/SmartFloatLayout/issues' //issue url of the library
def linksUrl = 'https://github.com/SmartCodeLab/SmartFloatLayout/wiki'//links url of the
group = "com.smart.floatlayout" //组织
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'a widget of floatlayout for android'
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 'miaolingzi' //your user ID
name 'miaolingzi' //your name
email '645318955@qq.com' //your email
}
}
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))
options.encoding "UTF-8"
options.charSet 'UTF-8'
options.author true
options.version true
options.links linksUrl
failOnError false
}
//文档打包成jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
//拷贝javadoc文件
task copyDoc(type: Copy) {
from "${buildDir}/docs/"
into "docs"
}
//上传到jcenter所需要的源码文件
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" //发布到Bintray的哪个仓库
name = "SmartFloatLayout" //发布到Bintray上的名字
desc = "a widget of floatlayout for android" //项目描述
websiteUrl = siteUrl
vcsUrl = gitUrl
issueTrackerUrl = issueUrl
licenses = ["Apache-2.0"]
labels = ['android'] //标签
publish = true
publicDownloadNumbers = true
userOrg = "smartdev"
}
}