-
Notifications
You must be signed in to change notification settings - Fork 5
/
bintrayUpload.gradle
112 lines (94 loc) · 3.28 KB
/
bintrayUpload.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
ext {
bintrayRepo = 'maven' //创建的仓库名
bintrayName = 'mvvm'//在bintray网站中项目中填写的名称
publishedGroupId = 'com.gomeos.mvvm'//一般为包名
libraryName = 'mvvm'//library名字需要和本地的lib module一致
artifact = 'mvvm'//同上
libraryDescription = 'activitystarter project.'//项目描述
libraryVersion = '1.0.0'//项目版本号,只需要在每次更新的时候填写
developerId = 'gomeos'//开发者Id
developerName = 'gomeos'//开发者名称
developerEmail = 'gomeos@126.com'//邮箱
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ['Apache-2.0']
siteUrl = 'https://github.com/gomeos/AndroidMVVM' // 项目的主页
gitUrl = 'https://github.com/gomeos/AndroidMVVM.git' // Git仓库的url
}
version = libraryVersion
group = publishedGroupId // Maven Group ID for the artifact
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
// Add your description here
name libraryName
description libraryDescription
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
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
}
//当前要上传的lib名字,随着module名字不同需要进行更改
tasks.getByPath(":mvvm:javadoc").enabled = false
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 = bintrayRepo
name = bintrayName
desc = libraryDescription
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
// Optional. The passphrase for GPG signing'
// gpg {
// sign = true //Determines whether to GPG sign the files. The default is false
// passphrase = properties.getProperty("bintray.gpg.password")
//}
}
}
}
javadoc { //jav doc采用utf-8编码否则会报“GBK的不可映射字符”错误
options {
encoding "UTF-8"
charSet 'UTF-8'
}
}