-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbintray-plugin-upload.gradle
75 lines (66 loc) · 1.84 KB
/
bintray-plugin-upload.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
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
install {
repositories {
mavenInstaller {
pom.project {
name POM_NAME
url GIT_URL
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
}
}
developers {
developer {
name POM_DEVELOPER_NAME
email POM_DEVELOPER_EMAIL
}
}
scm {
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
url POM_SCM_URL
}
}
}
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar
archives sourcesJar
}
bintray {
Properties properties = new Properties()
File propertyFile = new File(rootDir.getAbsolutePath() + "/local.properties")
properties.load(propertyFile.newDataInputStream())
user = getBintrayUserProperty(properties)
key = getBintrayApiKeyProperty(properties)
configurations = ['archives']
pkg {
repo = 'maven'
name = project.name
desc = POM_DESCRIPTION
websiteUrl = GIT_URL
issueTrackerUrl = ISSUE_URL
vcsUrl = GIT_URL
labels = bintray_labels
licenses = ['Apache-2.0']
publish = true
}
}
def getBintrayUserProperty(Properties properties) {
return properties.get('BINTRAY_USER', "")
}
def getBintrayApiKeyProperty(Properties properties) {
return properties.get('BINTRAY_APIKEY', "")
}