-
Notifications
You must be signed in to change notification settings - Fork 1
/
bintray.gradle
94 lines (80 loc) · 2.45 KB
/
bintray.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
// 应用插件
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
def baseUrl = 'https://github.com/stanhe'
def siteUrl = baseUrl
def gitUrl = "${baseUrl}/AutoAddVersionCode"
def issueUrl = "${baseUrl}/AutoAddVersionCode/issues"
install {
repositories {
mavenInstaller {
// This generates POM.xml with proper paramters
pom.project {
//添加项目描述
name 'Gradle Plugin for Android'
url siteUrl
//设置开源证书信息
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
//添加开发者信息
developers {
developer {
name 'stanhe'
email 'hshl4314@gmail.com'
}
}
scm {
connection gitUrl
developerConnection baseUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from 'src/main/groovy'
exclude 'META-INF'
classifier = 'sources' //classifier add the suffix to the file. autoaddversioncode-1.0.3-sources.jar
}
task versionJar(type: Jar) {
from 'src/main/groovy'
exclude 'META-INF'
}
groovydoc {
includePrivate = true
source = 'src/main/groovy'
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
from groovydoc.destinationDir
classifier = 'javadoc'
}
artifacts {
archives sourcesJar
archives versionJar
archives groovydocJar
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
//配置上传Bintray相关信息
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = 'maven' // 上传到中央仓库的名称
name = 'AutoAddVerionCode' // 上传到jcenter 的项目名称
desc = 'Auto add gradle versionCode when release' // 项目描述
websiteUrl = siteUrl
issueTrackerUrl = issueUrl
vcsUrl = gitUrl
labels = ['gradle', 'plugin']
licenses = ['Apache-2.0']
publish = true
publicDownloadNumbers = true
}
}