-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. gitignore changes 3. changes in gradle to use jacoco multi-module
- Loading branch information
1 parent
ddeb4b0
commit 755cd52
Showing
91 changed files
with
134 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
|
||
/out | ||
/build | ||
/*/out/ | ||
/*/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,137 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
kotlin("jvm") version "1.3.40" apply false | ||
jacoco | ||
kotlin("jvm") version "1.3.40" | ||
|
||
id("org.jetbrains.dokka") version "0.9.16" apply false | ||
jacoco | ||
id("org.jetbrains.dokka") version "0.9.16" | ||
`maven-publish` | ||
signing | ||
|
||
} | ||
|
||
allprojects { | ||
apply(plugin = "jacoco") | ||
|
||
group = "io.github.rybalkinsd" | ||
version = "0.11.0-SNAPSHOT" | ||
|
||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
} | ||
|
||
val notToPublish = listOf("kohttp-test") | ||
|
||
subprojects { | ||
apply(plugin = "kotlin") | ||
apply(plugin = "org.jetbrains.dokka") | ||
apply(plugin = "maven-publish") | ||
apply(plugin = "signing") | ||
|
||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
val sourceSets = the<SourceSetContainer>() | ||
|
||
val sourcesJar = task<Jar>("sourcesJar") { | ||
from(this.source) | ||
classifier = "sources" | ||
sourceSets { | ||
getByName("main").java.srcDirs("src/main/kotlin") | ||
getByName("test").java.srcDirs("src/main/kotlin") | ||
} | ||
|
||
// val dokkaJar by tasks | ||
|
||
// val dokkaJar = task<Jar>("dokkaJar") { | ||
// group = JavaBasePlugin.DOCUMENTATION_GROUP | ||
// from(tasks.dokka) | ||
// classifier = "javadoc" | ||
// } | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("kohttp") { | ||
from(components["java"]) | ||
artifacts { | ||
artifact(sourcesJar) | ||
// artifact(dokkaJar) | ||
} | ||
if (project.name !in notToPublish) { | ||
apply(plugin = "org.jetbrains.dokka") | ||
apply(plugin = "maven-publish") | ||
apply(plugin = "signing") | ||
|
||
pom { | ||
name.set("Kotlin http dsl") | ||
description.set("Kotlin http dsl based on okhttp") | ||
url.set("https://github.com/rybalkinsd/kohttp") | ||
organization { | ||
name.set("io.github.rybalkinsd") | ||
url.set("https://github.com/rybalkinsd") | ||
} | ||
licenses { | ||
license { | ||
name.set("Apache License 2.0") | ||
url.set("https://github.com/rybalkinsd/kohttp/blob/master/LICENSE") | ||
} | ||
val sourcesJar = task<Jar>("sourcesJar") { | ||
from(sourceSets["main"].allSource) | ||
classifier = "sources" | ||
} | ||
|
||
val dokkaJar = task<Jar>("dokkaJar") { | ||
group = JavaBasePlugin.DOCUMENTATION_GROUP | ||
classifier = "javadoc" | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("kohttp") { | ||
from(components["java"]) | ||
artifacts { | ||
artifact(sourcesJar) | ||
artifact(dokkaJar) | ||
} | ||
scm { | ||
|
||
pom { | ||
name.set("Kotlin http dsl") | ||
description.set("Kotlin http dsl based on okhttp") | ||
url.set("https://github.com/rybalkinsd/kohttp") | ||
connection.set("scm:git:git://github.com/rybalkinsd/kohttp.git") | ||
developerConnection.set("scm:git:ssh://git@github.com:rybalkinsd/kohttp.git") | ||
} | ||
developers { | ||
developer { | ||
name.set("Sergey") | ||
organization { | ||
name.set("io.github.rybalkinsd") | ||
url.set("https://github.com/rybalkinsd") | ||
} | ||
licenses { | ||
license { | ||
name.set("Apache License 2.0") | ||
url.set("https://github.com/rybalkinsd/kohttp/blob/master/LICENSE") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/rybalkinsd/kohttp") | ||
connection.set("scm:git:git://github.com/rybalkinsd/kohttp.git") | ||
developerConnection.set("scm:git:ssh://git@github.com:rybalkinsd/kohttp.git") | ||
} | ||
developers { | ||
developer { | ||
name.set("Sergey") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
credentials { | ||
val nexusUsername: String? by project | ||
val nexusPassword: String? by project | ||
username = nexusUsername | ||
password = nexusPassword | ||
} | ||
repositories { | ||
maven { | ||
credentials { | ||
val nexusUsername: String? by project | ||
val nexusPassword: String? by project | ||
username = nexusUsername | ||
password = nexusPassword | ||
} | ||
|
||
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/") | ||
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl | ||
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/") | ||
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign(publishing.publications["kohttp"]) | ||
signing { | ||
sign(publishing.publications["kohttp"]) | ||
} | ||
} | ||
|
||
} | ||
|
||
|
||
tasks.withType<JacocoReport> { | ||
val containers = subprojects.map { it.the<SourceSetContainer>()["main"] } | ||
|
||
val output = containers.flatMap { it.output } | ||
val sources = containers.flatMap { it.allSource.srcDirs } | ||
|
||
val exec = subprojects.flatMap { it.tasks } | ||
.filter { it is Test } | ||
.flatMap { files(it) } | ||
.filter { it.exists() && it.name.endsWith(".exec") } | ||
|
||
//tasks.withType<JacocoReport> { | ||
// reports { | ||
// xml.isEnabled = true | ||
// xml.destination = File("$buildDir/reports/jacoco/report.xml") | ||
// html.isEnabled = false | ||
// } | ||
//} | ||
|
||
additionalSourceDirs.setFrom(sources) | ||
sourceDirectories.setFrom(sources) | ||
classDirectories.setFrom(output) | ||
executionData.setFrom(exec) | ||
|
||
reports { | ||
xml.isEnabled = true | ||
xml.destination = File("$buildDir/reports/jacoco/report.xml") | ||
html.isEnabled = false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
dependencies { | ||
implementation(kotlin("stdlib-jdk8")) | ||
api(project(":kohttp-core")) | ||
api(project(":kohttp")) | ||
|
||
val jacksonVersion = "2.9.9" | ||
api(jackson("core"), "jackson-databind", jacksonVersion) | ||
implementation(jackson("module"), "jackson-module-kotlin", jacksonVersion) | ||
|
||
testImplementation(kotlin("test-junit")) | ||
testImplementation("org.assertj:assertj-core:3.12.2") | ||
|
||
} | ||
|
||
fun jackson(pack: String) = "com.fasterxml.jackson.$pack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...ybalkinsd/kohttp/ext/ResponseExtKtTest.kt → ...d/kohttp/jackson/ext/ResponseExtKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/dsl/HttpDeleteDslKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/dsl/HttpGetDslKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/dsl/HttpMultipartDslTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/dsl/HttpPatchDslKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/dsl/HttpPostDslKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/dsl/HttpPutDslKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/dsl/UploadDslKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/dsl/async/UploadAsyncDslTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/ext/FileAsyncExtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/ext/FileExtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/ext/UriAsyncExtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
kohttp-test/src/test/kotlin/io/github/rybalkinsd/kohttp/ext/UriExtKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.