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
4
4
import org.gradle.jvm.tasks.Jar
5
- import java.net.URL
6
5
import 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
13
7
14
8
plugins {
15
- id(" org.jetbrains.kotlin.jvm" ) version " 1.3.11"
16
- id(" com.jfrog.bintray" ) version " 1.8.4"
17
9
jacoco
18
10
`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"
20
14
}
21
15
22
16
group = " ru.gildor.coroutines"
23
- version = " 1.0 .0"
17
+ version = " 1.1 .0"
24
18
description = " Provides Kotlin Coroutines suspendable await() extensions for Retrofit Call"
25
19
26
20
repositories {
@@ -34,33 +28,33 @@ java {
34
28
35
29
dependencies {
36
30
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" )
39
33
testCompile(" junit:junit:4.12" )
40
34
}
41
35
42
36
/* Code coverage */
43
37
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
+ }
51
42
52
- /* KDoc */
43
+ test {
44
+ finalizedBy(jacocoTestReport)
45
+ }
53
46
54
- val dokka by tasks.getting( DokkaTask :: class ) {
55
- outputFormat = " javadoc"
56
- outputDirectory = " $buildDir /javadoc"
47
+ dokka {
48
+ outputFormat = " javadoc"
49
+ outputDirectory = " $buildDir /javadoc"
57
50
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
+ }
64
58
}
65
59
66
60
/* Publishing */
@@ -74,51 +68,49 @@ val licenseName = "The Apache Software License, Version 2.0"
74
68
val licenseUrl = " http://www.apache.org/licenses/LICENSE-2.0.txt"
75
69
val releaseTag = " v${project.version} "
76
70
77
- val sourcesJar by tasks.creating( Jar :: class ) {
71
+ val sources = tasks.register< Jar >( " sourcesJar " ) {
78
72
dependsOn(" classes" )
79
73
classifier = " sources"
80
74
from(sourceSets[" main" ].allSource)
81
75
}
82
76
83
- val javadocJar by tasks.creating( Jar :: class ) {
84
- dependsOn(dokka)
77
+ val javadoc = tasks.register< Jar >( " javadocJar " ) {
78
+ dependsOn(tasks. dokka)
85
79
classifier = " javadoc"
86
80
from(" $buildDir /javadoc" )
87
81
}
88
82
89
83
publishing {
90
84
publications {
91
- create (" MavenJava" , MavenPublication :: class .java ) {
85
+ register< MavenPublication > (" MavenJava" ) {
92
86
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" )
110
98
}
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)
122
114
}
123
115
}
124
116
}
@@ -154,18 +146,3 @@ bintray {
154
146
})
155
147
})
156
148
}
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