-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle.kts
139 lines (124 loc) · 3.98 KB
/
build.gradle.kts
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import com.jfrog.bintray.gradle.BintrayExtension.*
import org.gradle.jvm.tasks.Jar
import org.jetbrains.dokka.DokkaConfiguration
import java.net.URL
plugins {
kotlin("jvm") version "1.3.21"
jacoco
`maven-publish`
id("com.jfrog.bintray") version "1.8.4"
id("org.jetbrains.dokka") version "0.9.17"
}
group = "ru.gildor.coroutines"
version = "1.0"
description = "Coroutine adapter for OkHttp Call"
repositories {
jcenter()
}
dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0")
api("com.squareup.okhttp3:okhttp:3.8.0")
testImplementation("junit:junit:4.12")
}
tasks {
jacocoTestReport {
reports {
xml.isEnabled = true
}
}
test {
finalizedBy(jacocoTestReport)
}
}
/* Publishing */
val githubId = "gildor/kotlin-coroutines-okhttp"
val repoWeb = "https://github.com/$githubId"
val repoVcs = "$repoWeb.git"
val tags = listOf("okhttp", "kotlin", "coroutines")
val licenseId = "Apache-2.0"
val licenseName = "The Apache Software License, Version 2.0"
val licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.txt"
val releaseTag = "v${project.version}"
val sources = tasks.register<Jar>("sourcesJar") {
dependsOn("classes")
archiveClassifier.set("sources")
from(sourceSets.main.map { it.allSource })
}
val javadoc = tasks.register<Jar>("javadocJar") {
dependsOn(tasks.dokka)
archiveClassifier.set("javadoc")
from("$buildDir/javadoc")
}
tasks.dokka {
outputFormat = "javadoc"
outputDirectory = "$buildDir/javadoc"
externalDocumentationLink(delegateClosureOf<DokkaConfiguration.ExternalDocumentationLink.Builder> {
url = URL("https://square.github.io/okhttp/3.x/okhttp/")
})
}
publishing {
publications {
register<MavenPublication>("MavenJava") {
from(components["java"])
artifact(sources.get())
artifact(javadoc.get())
pom {
name.set(project.name)
description.set(project.description)
url.set(repoWeb)
developers {
developer {
name.set("Andrey Mischenko")
email.set("[email protected]")
organizationUrl.set("https://github.com/gildor")
}
}
issueManagement {
system.set("GitHub Issues")
url.set("$repoWeb/issues")
}
scm {
url.set(repoWeb)
connection.set("scm:git:$repoVcs")
developerConnection.set("scm:git:$repoVcs")
tag.set(releaseTag)
}
licenses {
license {
name.set(licenseName)
url.set(licenseUrl)
}
}
}
}
}
}
bintray {
user = project.properties["bintray.user"]?.toString()
key = project.properties["bintray.key"]?.toString()
setPublications("MavenJava")
publish = true
pkg(delegateClosureOf<PackageConfig> {
repo = project.properties["bintray.repo"]?.toString() ?: "maven"
name = project.name
desc = description
githubRepo = githubId
githubReleaseNotesFile = "CHANGELOG.md"
websiteUrl = repoWeb
issueTrackerUrl = "$repoWeb/issues"
vcsUrl = repoVcs
setLicenses(licenseId)
setLabels(*tags.toTypedArray())
version(delegateClosureOf<VersionConfig> {
name = project.version.toString()
vcsTag = releaseTag
mavenCentralSync(delegateClosureOf<MavenCentralSyncConfig> {
sync = project.properties["sonatype.user"] != null
user = project.properties["sonatype.user"]?.toString()
password = project.properties["sonatype.password"]?.toString()
close = "true"
})
})
})
}