-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupload_bintray.gradle
More file actions
125 lines (108 loc) · 3.02 KB
/
upload_bintray.gradle
File metadata and controls
125 lines (108 loc) · 3.02 KB
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
124
125
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'signing'
apply plugin: 'maven'
group = GROUP
version = LIB_VERSION
project.archivesBaseName = LIB_ARTIFACT
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
ext {
pomFilePath = "${project.buildDir.absolutePath}/tmp/pom.xml"
pomFile = file(pomFilePath)
}
configurations {
pom
}
artifacts {
archives jar
archives sourceJar
archives javadocJar
if (pomFile.exists()) {
pom pomFile
}
}
task signJars(type: Sign, dependsOn: [jar, javadocJar, sourceJar]) {
sign configurations.archives
}
task signPom(type: Sign) {
sign configurations.pom
}
if (project.ext.pomFile.exists()) {
task preparePublication(dependsOn: [signJars, signPom])
} else {
task preparePublication(dependsOn: signJars)
}
def getSignatureFiles = {
def allFiles = project.tasks.signJars.signatureFiles.collect{it}
def signedSources = allFiles.find{ it.name.contains('-sources') }
def signedJavadoc = allFiles.find{ it.name.contains('-javadoc') }
def signedJar = (allFiles - [signedSources, signJars])[0]
return [
[archive: signedSources, classifier: 'sources', extension: 'jar.asc'],
[archive: signedJavadoc, classifier: 'javadoc', extension: 'jar.asc'],
[archive: signedJar, classifier: 'null', extension: 'jar.asc']
]
}
def getPomSignature = {
return project.tasks.signPom.signatureFiles.collect{ it }[0]
}
install {
repositories.mavenInstaller {
// generates POM.xml with proper parameters
pom {
project {
packaging POM_PACKAGING
name LIB_ARTIFACT // #CONFIG# // project title
url SITE_URL
licenses {
license {
name LICENCE_NAME
url LICENCE_URL
distribution LICENCE_DIST
}
}
developers {
developer {
id DEVELOPER_ID
name DEVELOPER_NAME
email DEVELOPER_EMAIL
}
}
organization {
name ORGANIZATION_NAME
url ORGANIZATION_URL
}
scm {
connection GIT_URL
developerConnection ISSUE_URL
url SITE_URL
}
}
}
}
}
bintray {
user = bintrayUser
key = bintrayAPIKey
configurations = ['archives']
pkg {
repo = "maven"
name = LIB_ARTIFACT
desc = LIB_DES
websiteUrl = SITE_URL
vcsUrl = GIT_URL
issueTrackerUrl = ISSUE_URL
licenses = ["Apache-2.0"]
labels = 'Groovy'
publicDownloadNumbers = true
publish = true
}
}