forked from smartdevicelink/sdl_java_suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbintray.gradle
96 lines (83 loc) · 2.78 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
95
96
apply plugin: "com.jfrog.bintray"
apply plugin: 'maven-publish'
apply plugin: 'maven'
def siteUrl = 'https://github.com/smartdevicelink/sdl_java_suite' // Homepage URL of the library
def gitUrl = 'https://github.com/smartdevicelink/sdl_java_suite.git' // Git repository URL
def libDescription = 'SmartDeviceLink mobile library'
def libVersion = new File(projectDir.path, ('/../VERSION')).text.trim()
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
bintray {
Properties props = new Properties()
props.load(new FileInputStream("$projectDir/bintray.properties"))
// Authorization
user = props.getProperty("bintray.user")
key = props.getProperty("bintray.key")
version = libVersion
publications = ['mavenPublication']
pkg {
repo = props.getProperty("bintray.repo")
name = props.getProperty("bintray.package")
websiteUrl = siteUrl
vcsUrl = gitUrl
userOrg = props.getProperty("bintray.userorg")
licenses = ["BSD 3-Clause"]
publish = props.getProperty("bintray.publish") // Will upload to jCenter
version {
name = libVersion // Change to release version
desc = libDescription
released = new Date() // Will be the current date & time
vcsTag = libVersion // Should match git tag
}
}
}
def pomConfig = {
Properties props = new Properties()
props.load(new FileInputStream("$projectDir/bintray.properties"))
licenses {
license {
name 'BSD 3-Clause'
url 'https://opensource.org/licenses/BSD-3-Clause'
distribution "repo"
}
}
scm {
url siteUrl
}
}
publishing {
publications {
mavenPublication(MavenPublication) {
Properties props = new Properties()
props.load(new FileInputStream("$projectDir/bintray.properties"))
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
groupId props.getProperty("bintray.group")
artifactId props.getProperty("bintray.artifact")
version libVersion
pom.withXml {
def root = asNode()
root.appendNode('description', libDescription)
root.appendNode('name', props.getProperty("bintray.artifact"))
root.appendNode('url', siteUrl)
root.children().last() + pomConfig
}
}
}
}