-
Notifications
You must be signed in to change notification settings - Fork 8
/
public_maven_push.gradle
37 lines (33 loc) · 1.22 KB
/
public_maven_push.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
apply plugin: 'com.novoda.bintray-release'
this.tasks.whenTaskAdded {
if (it.name.equals("bintrayUpload")) {
it.dependsOn "assembleRelease"
}
}
ext.defineMavenPubish = this.&_defineMavenPubish
def _defineMavenPubish(String artifactName) {
loadConfig()
publish {
userOrg = this.project.bintrayUser//bintray用户名
repoName = this.repositoryname//要传到的maven的名字。你可能有多个maven,要传哪个写哪个。
groupId = this.group//jcenter上的路径
artifactId = artifactName//项目名称
publishVersion = this.version//版本号
desc = 'FrameMonitor framemonitor AndroidPerformanceMonitor'//描述,不重要
website = 'https://github.com/vip001/framemonitor'//网站,不重要;尽量模拟github上的地址
}
}
def loadConfig() {
Properties map = new Properties()
File configPath = new File(this.project.keyPath)
if (!configPath.exists()) {
ext.bintrayUser = ""
ext.bintrayKey = ""
return
}
InputStream stream = new FileInputStream(configPath)
map.load(stream)
stream.close()
ext.bintrayUser = map.getProperty("bintrayUser")
ext.bintrayKey = map.getProperty("bintrayKey")
}