-
Notifications
You must be signed in to change notification settings - Fork 0
/
bintray.gradle
123 lines (101 loc) · 3.06 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Create a file named local.properties in the root directory, add it to .gitignore.
// Add the following properties to local.properties:
// bintray.user=Bintray username
// bintray.apikey=Bintray API key
// bintray.gpg.password=Password for the GPG key
// Run the publishing/bintrayUpload task to upload the artifacts to Bintray.
ext {
bintrayRepo = rootProject.name
bintrayName = rootProject.name
publishedGroupId = group
artifactId = rootProject.name
libraryName = rootProject.name
libraryDescription = 'Library for parsing Estonian personal identification codes.'
siteUrl = 'https://github.com/vladislavgoltjajev/java-isikukood'
gitUrl = 'https://github.com/vladislavgoltjajev/java-isikukood.git'
libraryVersion = version
developerId = 'vladislavg'
developerName = 'Vladislav Goltjajev'
developerEmail = 'vladislav.goltjajev@gmail.com'
licenseName = 'The MIT License'
licenseUrl = 'https://opensource.org/licenses/MIT'
allLicenses = ['MIT']
}
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
}
def pomConfig = {
licenses {
license {
name licenseName
url licenseUrl
distribution 'repo'
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
url 'https://github.com/vladislavgoltjajev/java-isikukood'
}
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
artifact sourcesJar {
classifier 'sources'
}
artifact javadocJar {
classifier 'javadoc'
}
groupId publishedGroupId
artifactId artifactId
version libraryVersion
pom.withXml {
def root = asNode()
root.appendNode('description', libraryDescription)
root.appendNode('name', libraryName)
root.appendNode('url', siteUrl)
root.children().last() + pomConfig
}
}
}
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty('bintray.user')
key = properties.getProperty('bintray.apikey')
publications = ['mavenPublication']
pkg {
repo = bintrayName
name = bintrayRepo
licenses = allLicenses
vcsUrl = gitUrl
publicDownloadNumbers = true
version {
name = libraryVersion
desc = libraryVersion
released = new Date()
gpg {
sign = true
passphrase = properties.getProperty('bintray.gpg.password')
}
}
}
}