-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpublishing.gradle
80 lines (64 loc) · 1.8 KB
/
publishing.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
if (!gradle.startParameter.taskNames.contains('release')) {
println "Not a release build, setting version to ${project.version}-SNAPSHOT"
project.version += '-SNAPSHOT'
}
tasks.create('release') {
doLast {
println "Releasing $version"
}
}
/* Add the generated pom.xml file into the JAR */
model {
tasks.jar {
into("META-INF/maven/${project.group}/${project.name}") {
from generatePomFileForMavenJavaPublication
rename 'pom-default.xml', 'pom.xml'
}
}
}
tasks.create('sourcesJar', Jar) {
description = 'Assembles a jar archive containing the sources.'
classifier = 'sources'
group = 'build'
from sourceSets.main.allSource
}
tasks.create('javadocJar', Jar) {
description = 'Assembles a jar archive containing the javadocs.'
classifier = 'javadoc'
group = 'build'
from tasks.javadoc
}
project.publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact tasks.sourcesJar
artifact tasks.javadocJar
}
}
}
plugins.withId('com.jfrog.bintray') {
bintray.publications = ['mavenJava']
}
bintray {
user = project.bintray_user
key = project.bintray_key
dryRun = Boolean.valueOf(project.bintray_dryrun as String)
pkg {
repo = project.bintray_repo
name = project.name
desc = project.description
websiteUrl = project.home_url
licenses = ['MIT']
labels = (project.bintray_labels as String).split ','
vcsUrl = project.scm_url
issueTrackerUrl = project.issues_url
publicDownloadNumbers = true
}
pkg.version {
name = project.version
released = new Date()
vcsTag = project.version
}
}
tasks['release'].dependsOn tasks.bintrayUpload