-
Notifications
You must be signed in to change notification settings - Fork 14
/
publish.gradle
89 lines (83 loc) · 2.38 KB
/
publish.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
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
def description = "Provides Kotlin Coroutines suspendable await() extensions for okhttp3.Call"
def githubId = "gildor/kotlin-coroutines-okhttp"
def repoWeb = "https://github.com/${githubId}"
def repoVcs = "${repoWeb}.git"
def issueTracker = "${repoWeb}/issues"
def tags = ['okhttp', 'kotlin', 'coroutines']
def licenseId = "Apache-2.0"
def licenseName = "The Apache Software License, Version 2.0"
def licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.txt"
def releaseTag = "v${project.version}"
// Create the pom configuration:
def pomConfig = {
developers {
developer {
name "Andrey Mischenko"
email "[email protected]"
organizationUrl "https://github.com/gildor"
}
}
scm {
url repoWeb
connection "scm:git:${repoVcs}"
developerConnection "scm:git:${repoVcs}"
tag releaseTag
}
issueManagement {
system "GitHub Issues"
url issueTracker
}
licenses {
license {
name licenseName
url licenseUrl
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
Publication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', description)
root.appendNode('url', repoWeb)
root.children().last() + pomConfig
}
}
}
}
bintray {
user = project.properties['bintray.user']
key = project.properties['bintray.key']
publications = ['Publication']
pkg {
repo = project.properties['bintray.repo'] ?: 'maven'
name = project.name
desc = description
githubRepo = githubId
githubReleaseNotesFile = 'CHANGELOG.md'
websiteUrl = repoWeb
issueTrackerUrl = "${repoWeb}/issues"
vcsUrl = repoVcs
licenses = [licenseId]
labels = tags
version {
name = project.version
vcsTag = releaseTag
}
}
}