Skip to content

Commit

Permalink
Version 0.10.0 (#36)
Browse files Browse the repository at this point in the history
- [Retrofit 2.4.0](https://github.com/square/retrofit/blob/parent-2.4.0/CHANGELOG.md#version-240-2018-03-14)
- [kotlinx.coroutines 0.22.5](https://github.com/Kotlin/kotlinx.coroutines/releases/tag/0.22.5)
- Compiled against Kotlin 1.2.40
- Migration of build.gradle to kotlin-dsl
- Gradle 4.7
- Published proper javadoc
  • Loading branch information
gildor committed Apr 25, 2018
1 parent 046ddc5 commit ffa0ee4
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 134 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## Version 0.10.0 (2017-04-26)

- [Retrofit 2.4.0](https://github.com/square/retrofit/blob/parent-2.4.0/CHANGELOG.md#version-240-2018-03-14)
- [kotlinx.coroutines 0.22.5](https://github.com/Kotlin/kotlinx.coroutines/releases/tag/0.22.5)
- Compiled against Kotlin 1.2.40
- Migration of build.gradle to kotlin-dsl
- Gradle 4.7
- Published proper javadoc

## Version 0.9.0 (2017-12-26)

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

```groovy
compile 'ru.gildor.coroutines:kotlin-coroutines-retrofit:0.9.0'
compile 'ru.gildor.coroutines:kotlin-coroutines-retrofit:0.10.0'
```

Maven:
Expand All @@ -23,7 +23,7 @@ Maven:
<dependency>
<groupId>ru.gildor.coroutines</groupId>
<artifactId>kotlin-coroutines-retrofit</artifactId>
<version>0.9.0</version>
<version>0.10.0</version>
</dependency>
```

Expand Down
34 changes: 0 additions & 34 deletions build.gradle

This file was deleted.

175 changes: 175 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.BintrayExtension.*
import groovy.util.Node
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

plugins {
id("org.jetbrains.kotlin.jvm") version "1.2.40"
id("com.jfrog.bintray") version "1.7.3"
jacoco
`maven-publish`
id("org.jetbrains.dokka") version "0.9.16"
}

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

repositories {
jcenter()
}

java {
targetCompatibility = JavaVersion.VERSION_1_6
sourceCompatibility = JavaVersion.VERSION_1_6
}

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

kotlin {
experimental.coroutines = Coroutines.ENABLE
}

/* Code coverage */

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

val test by tasks.getting {
finalizedBy(jacocoTestReport)
}

/* KDoc */

val dokka by tasks.getting(DokkaTask::class) {
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/")
})
}

/* Publishing */

val githubId = "gildor/kotlin-coroutines-retrofit"
val repoWeb = "https://github.com/$githubId"
val repoVcs = "$repoWeb.git"
val tags = listOf("retrofit", "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 sourcesJar by tasks.creating(Jar::class) {
dependsOn("classes")
classifier = "sources"
from(java.sourceSets["main"].allSource)
}

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

publishing {
publications {
create("MavenJava", MavenPublication::class.java) {
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"
}
"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
}
}
}
}
}
}
}

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"
})
})
})
}

/**
* 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) }
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
96 changes: 0 additions & 96 deletions publish.gradle

This file was deleted.

1 change: 0 additions & 1 deletion settings.gradle

This file was deleted.

1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "kotlin-coroutines-retrofit"

0 comments on commit ffa0ee4

Please sign in to comment.