1- import com.jfrog.bintray.gradle.BintrayExtension
2- import com.jfrog.bintray.gradle.BintrayExtension.*
3- import groovy.util.Node
1+ import com.jfrog.bintray.gradle.BintrayExtension.MavenCentralSyncConfig
2+ import com.jfrog.bintray.gradle.BintrayExtension.PackageConfig
3+ import com.jfrog.bintray.gradle.BintrayExtension.VersionConfig
44import org.gradle.jvm.tasks.Jar
5- import java.net.URL
65import org.jetbrains.dokka.DokkaConfiguration
7- import org.jetbrains.dokka.gradle.DokkaTask
8- import org.jetbrains.dokka.gradle.LinkMapping
9- import org.jetbrains.kotlin.builtins.isNumberedFunctionClassFqName
10- import org.jetbrains.kotlin.gradle.dsl.Coroutines
11- import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
12- import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
6+ import java.net.URL
137
148plugins {
15- id(" org.jetbrains.kotlin.jvm" ) version " 1.3.11"
16- id(" com.jfrog.bintray" ) version " 1.8.4"
179 jacoco
1810 `maven- publish`
19- id(" org.jetbrains.dokka" ) version " 0.9.16"
11+ id(" org.jetbrains.kotlin.jvm" ) version " 1.3.21"
12+ id(" com.jfrog.bintray" ) version " 1.8.4"
13+ id(" org.jetbrains.dokka" ) version " 0.9.17"
2014}
2115
2216group = " ru.gildor.coroutines"
23- version = " 1.0 .0"
17+ version = " 1.1 .0"
2418description = " Provides Kotlin Coroutines suspendable await() extensions for Retrofit Call"
2519
2620repositories {
@@ -34,33 +28,33 @@ java {
3428
3529dependencies {
3630 compile(" org.jetbrains.kotlin:kotlin-stdlib" )
37- compile(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0 .1" )
38- compile(" com.squareup.retrofit2:retrofit:2.4 .0" )
31+ compile(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1 .1" )
32+ compile(" com.squareup.retrofit2:retrofit:2.5 .0" )
3933 testCompile(" junit:junit:4.12" )
4034}
4135
4236/* Code coverage */
4337
44- val jacocoTestReport by tasks.getting(JacocoReport ::class ) {
45- reports.xml.isEnabled = true
46- }
47-
48- val test by tasks.getting {
49- finalizedBy(jacocoTestReport)
50- }
38+ tasks {
39+ jacocoTestReport {
40+ reports.xml.isEnabled = true
41+ }
5142
52- /* KDoc */
43+ test {
44+ finalizedBy(jacocoTestReport)
45+ }
5346
54- val dokka by tasks.getting( DokkaTask :: class ) {
55- outputFormat = " javadoc"
56- outputDirectory = " $buildDir /javadoc"
47+ dokka {
48+ outputFormat = " javadoc"
49+ outputDirectory = " $buildDir /javadoc"
5750
58- externalDocumentationLink(delegateClosureOf<DokkaConfiguration .ExternalDocumentationLink .Builder > {
59- url = URL (" https://square.github.io/okhttp/3.x/okhttp/" )
60- })
61- externalDocumentationLink(delegateClosureOf<DokkaConfiguration .ExternalDocumentationLink .Builder > {
62- url = URL (" https://square.github.io/retrofit/2.x/retrofit/" )
63- })
51+ externalDocumentationLink(delegateClosureOf<DokkaConfiguration .ExternalDocumentationLink .Builder > {
52+ url = URL (" https://square.github.io/okhttp/3.x/okhttp/" )
53+ })
54+ externalDocumentationLink(delegateClosureOf<DokkaConfiguration .ExternalDocumentationLink .Builder > {
55+ url = URL (" https://square.github.io/retrofit/2.x/retrofit/" )
56+ })
57+ }
6458}
6559
6660/* Publishing */
@@ -74,51 +68,49 @@ val licenseName = "The Apache Software License, Version 2.0"
7468val licenseUrl = " http://www.apache.org/licenses/LICENSE-2.0.txt"
7569val releaseTag = " v${project.version} "
7670
77- val sourcesJar by tasks.creating( Jar :: class ) {
71+ val sources = tasks.register< Jar >( " sourcesJar " ) {
7872 dependsOn(" classes" )
7973 classifier = " sources"
8074 from(sourceSets[" main" ].allSource)
8175}
8276
83- val javadocJar by tasks.creating( Jar :: class ) {
84- dependsOn(dokka)
77+ val javadoc = tasks.register< Jar >( " javadocJar " ) {
78+ dependsOn(tasks. dokka)
8579 classifier = " javadoc"
8680 from(" $buildDir /javadoc" )
8781}
8882
8983publishing {
9084 publications {
91- create (" MavenJava" , MavenPublication :: class .java ) {
85+ register< MavenPublication > (" MavenJava" ) {
9286 from(components[" java" ])
93- artifact(sourcesJar)
94- artifact(javadocJar)
95- pom.withXml {
96- NodeScope (asNode()) {
97- " name" to project.name
98- " description" to project.description.toString()
99- " url" to repoWeb
100- " developers" {
101- " developer" {
102- " name" to " Andrey Mischenko"
103- 104- " organizationUrl" to " https://github.com/gildor"
105- }
106- }
107- " issueManagement" {
108- " system" to " GitHub Issues"
109- " url" to " $repoWeb /issues"
87+ artifact(sources.get())
88+ artifact(javadoc.get())
89+ pom {
90+ name.set(project.name)
91+ description.set(project.description)
92+ url.set(repoWeb)
93+ developers {
94+ developer {
95+ name.set(" Andrey Mischenko" )
96+ 97+ organizationUrl.set(" https://github.com/gildor" )
11098 }
111- " scm" {
112- " url" to repoWeb
113- " connection" to " scm:git:$repoVcs "
114- " developerConnection" to " scm:git:$repoVcs "
115- " tag" to releaseTag
116- }
117- " licenses" {
118- " license" {
119- " name" to licenseName
120- " url" to licenseUrl
121- }
99+ }
100+ issueManagement {
101+ system.set(" GitHub Issues" )
102+ url.set(" $repoWeb /issues" )
103+ }
104+ scm {
105+ url.set(repoWeb)
106+ connection.set(" scm:git:$repoVcs " )
107+ developerConnection.set(" scm:git:$repoVcs " )
108+ tag.set(releaseTag)
109+ }
110+ licenses {
111+ license {
112+ name.set(licenseName)
113+ url.set(licenseUrl)
122114 }
123115 }
124116 }
@@ -154,18 +146,3 @@ bintray {
154146 })
155147 })
156148}
157-
158- /* *
159- * Helper DSL to define Pom
160- */
161- class NodeScope (private val node : Node , block : NodeScope .() -> Unit ) {
162- init {
163- block()
164- }
165- infix fun String.to (value : String ) {
166- node.appendNode(this , value)
167- }
168- operator fun String.invoke (block : NodeScope .() -> Unit ) {
169- node.appendNode(this ).apply { NodeScope (this , block) }
170- }
171- }
0 commit comments