Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b93dd44
commit 80bd9dd
Showing
6 changed files
with
156 additions
and
123 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import com.jfrog.bintray.gradle.BintrayExtension | ||
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask | ||
import groovy.lang.Closure | ||
import org.gradle.api.internal.HasConvention | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
import org.jetbrains.dokka.gradle.DokkaTask | ||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet | ||
|
||
description = "A Result monad for modelling success or failure operations." | ||
|
||
plugins { | ||
`maven-publish` | ||
kotlin("jvm") version ("1.2.70") | ||
id("org.jetbrains.dokka") version ("0.9.17") | ||
id("com.github.ben-manes.versions") version ("0.20.0") | ||
id("com.jfrog.bintray") version ("1.8.4") | ||
id("net.researchgate.release") version ("2.7.0") | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | ||
|
||
testImplementation("junit:junit:4.12") | ||
testImplementation("org.jetbrains.kotlin:kotlin-test-common") | ||
testImplementation("org.jetbrains.kotlin:kotlin-test-annotations-common") | ||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit") | ||
testImplementation("org.jetbrains.kotlin:kotlin-test") | ||
} | ||
|
||
val SourceSet.kotlin: SourceDirectorySet | ||
get() = withConvention(KotlinSourceSet::class) { kotlin } | ||
|
||
val compileKotlin by tasks.existing(KotlinCompile::class) | ||
val compileTestKotlin by tasks.existing(KotlinCompile::class) | ||
val dokka by tasks.existing(DokkaTask::class) | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
dokka { | ||
kotlinTasks(closureOf<Any?> { emptyList() }) | ||
sourceDirs = sourceSets["main"].kotlin.srcDirs | ||
outputFormat = "javadoc" | ||
outputDirectory = "$buildDir/docs/javadoc" | ||
} | ||
|
||
val javadocJar by tasks.registering(Jar::class) { | ||
group = LifecycleBasePlugin.BUILD_GROUP | ||
description = "Assembles a jar archive containing the Javadoc API documentation." | ||
classifier = "javadoc" | ||
dependsOn(dokka.get()) | ||
from(dokka.get().outputDirectory) | ||
} | ||
|
||
val sourcesJar by tasks.registering(Jar::class) { | ||
group = LifecycleBasePlugin.BUILD_GROUP | ||
description = "Assembles a jar archive containing the main classes with sources." | ||
classifier = "sources" | ||
from(sourceSets["main"].allSource) | ||
} | ||
|
||
publishing { | ||
publications { | ||
register("mavenJava", MavenPublication::class) { | ||
from(components["java"]) | ||
artifact(javadocJar.get()) | ||
artifact(sourcesJar.get()) | ||
} | ||
} | ||
} | ||
|
||
bintray { | ||
user = project.findProperty("bintrayUser")?.toString() ?: "" | ||
key = project.findProperty("bintrayKey")?.toString() ?: "" | ||
setPublications("mavenJava") | ||
|
||
pkg(closureOf<BintrayExtension.PackageConfig> { | ||
repo = "maven" | ||
name = "kotlin-result" | ||
vcsUrl = "git@github.com:michaelbull/kotlin-result.git" | ||
setLicenses("ISC") | ||
}) | ||
} | ||
|
||
val build by tasks.existing | ||
val generatePomFileForMavenJavaPublication by tasks.existing(GenerateMavenPom::class) | ||
val bintrayUpload by tasks.existing(BintrayUploadTask::class) | ||
|
||
bintrayUpload { | ||
dependsOn(build) | ||
dependsOn(generatePomFileForMavenJavaPublication) | ||
dependsOn(sourcesJar) | ||
dependsOn(javadocJar) | ||
} | ||
|
||
val afterReleaseBuild by tasks.existing | ||
|
||
afterReleaseBuild { | ||
dependsOn(bintrayUpload) | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.Coroutines | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
application | ||
kotlin("jvm") | ||
} | ||
|
||
application { | ||
mainClassName = "io.ktor.server.netty.DevelopmentEngine" | ||
} | ||
|
||
repositories { | ||
maven(url = "http://dl.bintray.com/kotlin/ktor") | ||
maven(url = "https://dl.bintray.com/kotlin/kotlinx") | ||
} | ||
|
||
dependencies { | ||
implementation(project(":")) | ||
implementation(kotlin("stdlib-jdk8")) | ||
implementation("ch.qos.logback:logback-classic:${ext["logbackVersion"]}") | ||
implementation("io.ktor:ktor-server-core:${ext["ktorVersion"]}") | ||
implementation("io.ktor:ktor-server-netty:${ext["ktorVersion"]}") | ||
implementation("io.ktor:ktor-gson:${ext["ktorVersion"]}") | ||
} | ||
|
||
val compileKotlin by tasks.existing(KotlinCompile::class) | ||
val compileTestKotlin by tasks.existing(KotlinCompile::class) | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
kotlin { | ||
experimental.coroutines = Coroutines.ENABLE | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
enableFeaturePreview("STABLE_PUBLISHING") | ||
|
||
rootProject.name = "kotlin-result" | ||
|
||
include("example") |