kotlin-result/build.gradle.kts

200 lines
5.2 KiB
Plaintext
Raw Normal View History

2019-08-23 23:26:31 +00:00
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.dokka.gradle.DokkaTask
2018-09-24 21:13:47 +00:00
2020-02-12 14:32:53 +00:00
val ossrhUsername: String? by ext
val ossrhPassword: String? by ext
2019-09-27 09:25:37 +00:00
2020-02-12 14:32:53 +00:00
description = "A Result monad for modelling success or failure operations."
2019-09-27 09:25:37 +00:00
2018-09-24 21:13:47 +00:00
plugins {
`maven-publish`
2020-02-12 14:32:53 +00:00
signing
kotlin("multiplatform") version "1.3.72"
2020-02-12 14:32:53 +00:00
id("org.jetbrains.dokka") version "0.10.1"
2020-04-16 09:37:06 +00:00
id("com.github.ben-manes.versions") version "0.28.0"
id("net.researchgate.release") version "2.8.1"
2020-06-04 18:11:51 +00:00
id("kotlinx.benchmark") version "0.2.0-dev-8"
id("org.jetbrains.kotlin.plugin.allopen") version "1.3.72"
2018-09-24 21:13:47 +00:00
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
listOf("alpha", "beta", "rc", "cr", "m", "eap", "pr").any {
candidate.version.contains(it, ignoreCase = true)
}
}
}
val dokka by tasks.existing(DokkaTask::class) {
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."
archiveClassifier.set("javadoc")
dependsOn(dokka)
from(dokka.get().outputDirectory)
}
allprojects {
repositories {
mavenCentral()
jcenter()
2020-05-11 09:41:00 +00:00
maven("https://dl.bintray.com/kotlin/kotlinx")
}
2018-09-24 21:13:47 +00:00
}
2020-05-11 09:41:00 +00:00
allOpen {
annotation("org.openjdk.jmh.annotations.State")
annotation("org.openjdk.jmh.annotations.BenchmarkMode")
}
sourceSets.create("benchmark")
2020-05-11 09:41:00 +00:00
benchmark {
targets {
register("jvmBenchmark")
2020-05-11 09:41:00 +00:00
}
}
kotlin {
jvm {
withJava()
2020-05-11 09:41:00 +00:00
mavenPublication {
artifact(javadocJar.get())
}
2018-09-24 21:13:47 +00:00
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
2019-08-23 23:26:31 +00:00
}
}
sourceSets {
all {
languageSettings.apply {
useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
}
}
2018-09-24 21:13:47 +00:00
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
}
}
2018-09-24 21:13:47 +00:00
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val jvmMain by getting {
dependencies {
implementation(kotlin("stdlib-jdk8"))
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin("test-junit"))
implementation(kotlin("test"))
}
}
val jvmBenchmark by getting {
dependsOn(jvmMain)
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:0.2.0-dev-8")
}
}
}
2018-09-24 21:13:47 +00:00
}
publishing {
2020-02-12 14:32:53 +00:00
repositories {
maven {
if (project.version.toString().endsWith("SNAPSHOT")) {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
} else {
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
publications.withType<MavenPublication> {
pom {
name.set(project.name)
description.set(project.description)
url.set("https://github.com/michaelbull/kotlin-result")
inceptionYear.set("2017")
licenses {
license {
name.set("ISC License")
url.set("https://opensource.org/licenses/isc-license.txt")
2020-02-12 14:32:53 +00:00
}
}
2020-02-12 14:32:53 +00:00
developers {
developer {
name.set("Michael Bull")
url.set("https://www.michael-bull.com")
2020-02-12 14:32:53 +00:00
}
}
2020-02-12 14:32:53 +00:00
contributors {
contributor {
name.set("Kevin Herron")
url.set("https://github.com/kevinherron")
}
contributor {
name.set("Markus Padourek")
url.set("https://github.com/Globegitter")
2020-02-12 14:32:53 +00:00
}
contributor {
name.set("Tristan Hamilton")
url.set("https://github.com/Munzey")
2020-02-12 14:32:53 +00:00
}
}
2020-02-12 14:32:53 +00:00
scm {
connection.set("scm:git:https://github.com/michaelbull/kotlin-result")
developerConnection.set("scm:git:git@github.com:michaelbull/kotlin-result.git")
url.set("https://github.com/michaelbull/kotlin-result")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/michaelbull/kotlin-result/issues")
}
ciManagement {
system.set("GitHub")
url.set("https://github.com/michaelbull/kotlin-result/actions?query=workflow%3Aci")
2020-02-12 14:32:53 +00:00
}
}
}
2018-09-24 21:13:47 +00:00
}
2020-02-12 14:32:53 +00:00
signing {
useGpgCmd()
sign(publishing.publications)
2018-09-24 21:13:47 +00:00
}
2020-02-12 14:32:53 +00:00
tasks.afterReleaseBuild {
dependsOn(tasks.publish)
2018-09-24 21:13:47 +00:00
}