-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathpublish_bintray.gradle
41 lines (39 loc) · 1.11 KB
/
publish_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
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
def siteUrl = 'https://github.com/alibaba/atlas'
// 项目的主页
def gitUrl = 'https://github.com/alibaba/atlas'
// Git仓库的url
task sourcesJar(type: Jar) {
from('src/main/java') {
include '**'
}
classifier = 'sources'
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}
Properties properties = new Properties()
def file = project.rootProject.file('local.properties')
if (file.exists()) {
properties.load(file.newDataInputStream())
}
bintray {
user = project.hasProperty('BINTRAY_USER') ? BINTRAY_USER : properties.getProperty("bintray.user")
key = project.hasProperty('BINTRAY_APIKEY') ? BINTRAY_APIKEY : properties.getProperty("bintray.apikey")
publications = ['MyPublication']
pkg {
repo = "maven"
name = project.name //发布到JCenter上的项目名字
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}