Skip to content

Commit

Permalink
Version 1.1.0 (#49)
Browse files Browse the repository at this point in the history
- [Retrofit 2.5.0](https://github.com/square/retrofit/blob/parent-2.5.0/CHANGELOG.md#version-250-2018-11-18)
- [kotlinx.coroutines 1.1.1](https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.1.1)
- Compiled against Kotlin 1.3.21
- Fixed javadoc and source code jars. Thanks to @erikhuizinga for contribution #47
- Gradle 5.2.1
- Update publishing config to new DSL
  • Loading branch information
gildor committed Feb 11, 2019
1 parent ae75654 commit 80abaa2
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 85 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## Version 1.1.0 (2019-02-12)

- [Retrofit 2.5.0](https://github.com/square/retrofit/blob/parent-2.5.0/CHANGELOG.md#version-250-2018-11-18)
- [kotlinx.coroutines 1.1.1](https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.1.1)
- Compiled against Kotlin 1.3.21
- Fixed javadoc and source code jars. Thanks to @erikhuizinga for contribution #47

## Version 1.0.0 (2018-12-19)

- kotlinx.coroutines 1.0.1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Download the [JAR](https://bintray.com/gildor/maven/kotlin-coroutines-retrofit#f
Gradle:

```groovy
compile 'ru.gildor.coroutines:kotlin-coroutines-retrofit:1.0.0'
compile 'ru.gildor.coroutines:kotlin-coroutines-retrofit:1.1.0'
```

Maven:
Expand All @@ -28,7 +28,7 @@ Maven:
<dependency>
<groupId>ru.gildor.coroutines</groupId>
<artifactId>kotlin-coroutines-retrofit</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</dependency>
```

Expand Down
137 changes: 57 additions & 80 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.BintrayExtension.*
import groovy.util.Node
import com.jfrog.bintray.gradle.BintrayExtension.MavenCentralSyncConfig
import com.jfrog.bintray.gradle.BintrayExtension.PackageConfig
import com.jfrog.bintray.gradle.BintrayExtension.VersionConfig
import org.gradle.jvm.tasks.Jar
import java.net.URL
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.LinkMapping
import org.jetbrains.kotlin.builtins.isNumberedFunctionClassFqName
import org.jetbrains.kotlin.gradle.dsl.Coroutines
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
import java.net.URL

plugins {
id("org.jetbrains.kotlin.jvm") version "1.3.11"
id("com.jfrog.bintray") version "1.8.4"
jacoco
`maven-publish`
id("org.jetbrains.dokka") version "0.9.16"
id("org.jetbrains.kotlin.jvm") version "1.3.21"
id("com.jfrog.bintray") version "1.8.4"
id("org.jetbrains.dokka") version "0.9.17"
}

group = "ru.gildor.coroutines"
version = "1.0.0"
version = "1.1.0"
description = "Provides Kotlin Coroutines suspendable await() extensions for Retrofit Call"

repositories {
Expand All @@ -34,33 +28,33 @@ java {

dependencies {
compile("org.jetbrains.kotlin:kotlin-stdlib")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1")
compile("com.squareup.retrofit2:retrofit:2.4.0")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1")
compile("com.squareup.retrofit2:retrofit:2.5.0")
testCompile("junit:junit:4.12")
}

/* Code coverage */

val jacocoTestReport by tasks.getting(JacocoReport::class) {
reports.xml.isEnabled = true
}

val test by tasks.getting {
finalizedBy(jacocoTestReport)
}
tasks {
jacocoTestReport {
reports.xml.isEnabled = true
}

/* KDoc */
test {
finalizedBy(jacocoTestReport)
}

val dokka by tasks.getting(DokkaTask::class) {
outputFormat = "javadoc"
outputDirectory = "$buildDir/javadoc"
dokka {
outputFormat = "javadoc"
outputDirectory = "$buildDir/javadoc"

externalDocumentationLink(delegateClosureOf<DokkaConfiguration.ExternalDocumentationLink.Builder> {
url = URL("https://square.github.io/okhttp/3.x/okhttp/")
})
externalDocumentationLink(delegateClosureOf<DokkaConfiguration.ExternalDocumentationLink.Builder> {
url = URL("https://square.github.io/retrofit/2.x/retrofit/")
})
externalDocumentationLink(delegateClosureOf<DokkaConfiguration.ExternalDocumentationLink.Builder> {
url = URL("https://square.github.io/okhttp/3.x/okhttp/")
})
externalDocumentationLink(delegateClosureOf<DokkaConfiguration.ExternalDocumentationLink.Builder> {
url = URL("https://square.github.io/retrofit/2.x/retrofit/")
})
}
}

/* Publishing */
Expand All @@ -74,51 +68,49 @@ 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 sourcesJar by tasks.creating(Jar::class) {
val sources = tasks.register<Jar>("sourcesJar") {
dependsOn("classes")
classifier = "sources"
from(sourceSets["main"].allSource)
}

val javadocJar by tasks.creating(Jar::class) {
dependsOn(dokka)
val javadoc = tasks.register<Jar>("javadocJar") {
dependsOn(tasks.dokka)
classifier = "javadoc"
from("$buildDir/javadoc")
}

publishing {
publications {
create("MavenJava", MavenPublication::class.java) {
register<MavenPublication>("MavenJava") {
from(components["java"])
artifact(sourcesJar)
artifact(javadocJar)
pom.withXml {
NodeScope(asNode()) {
"name" to project.name
"description" to project.description.toString()
"url" to repoWeb
"developers" {
"developer" {
"name" to "Andrey Mischenko"
"email" to "git@gildor.ru"
"organizationUrl" to "https://github.com/gildor"
}
}
"issueManagement" {
"system" to "GitHub Issues"
"url" to "$repoWeb/issues"
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("git@gildor.ru")
organizationUrl.set("https://github.com/gildor")
}
"scm" {
"url" to repoWeb
"connection" to "scm:git:$repoVcs"
"developerConnection" to "scm:git:$repoVcs"
"tag" to releaseTag
}
"licenses" {
"license" {
"name" to licenseName
"url" to licenseUrl
}
}
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)
}
}
}
Expand Down Expand Up @@ -154,18 +146,3 @@ bintray {
})
})
}

/**
* Helper DSL to define Pom
*/
class NodeScope(private val node: Node, block: NodeScope.() -> Unit) {
init {
block()
}
infix fun String.to(value: String) {
node.appendNode(this, value)
}
operator fun String.invoke(block: NodeScope.() -> Unit) {
node.appendNode(this).apply { NodeScope(this, block) }
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# suppress inspection "UnusedProperty" for whole file
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down

0 comments on commit 80abaa2

Please sign in to comment.