2019-08-23 23:26:31 +00:00
|
|
|
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
|
2019-06-13 08:03:45 +00:00
|
|
|
import org.jetbrains.dokka.gradle.DokkaTask
|
2020-08-07 13:51:27 +00:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
|
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
|
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 {
|
2020-08-07 13:51:27 +00:00
|
|
|
base
|
2020-08-26 18:52:18 +00:00
|
|
|
id("com.github.ben-manes.versions") version Versions.versionsPlugin
|
2020-08-07 13:51:27 +00:00
|
|
|
|
2020-08-26 18:52:18 +00:00
|
|
|
kotlin("multiplatform") version Versions.kotlin apply false
|
|
|
|
id("kotlinx.benchmark") version Versions.kotlinBenchmark apply false
|
|
|
|
id("net.researchgate.release") version Versions.releasePlugin apply false
|
|
|
|
id("org.jetbrains.dokka") version Versions.dokka apply false
|
|
|
|
id("org.jetbrains.kotlin.plugin.allopen") version Versions.kotlin apply false
|
2018-09-24 21:13:47 +00:00
|
|
|
}
|
|
|
|
|
2020-06-05 15:26:40 +00:00
|
|
|
tasks.withType<DependencyUpdatesTask> {
|
|
|
|
rejectVersionIf {
|
2020-08-26 18:42:18 +00:00
|
|
|
listOf("alpha", "beta", "rc", "cr", "m", "eap", "pr", "dev").any {
|
2020-06-05 15:26:40 +00:00
|
|
|
candidate.version.contains(it, ignoreCase = true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-12 23:19:50 +00:00
|
|
|
allprojects {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
jcenter()
|
2020-05-11 09:41:00 +00:00
|
|
|
maven("https://dl.bintray.com/kotlin/kotlinx")
|
2019-06-12 23:19:50 +00:00
|
|
|
}
|
2018-09-24 21:13:47 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
subprojects {
|
|
|
|
plugins.withType<MavenPublishPlugin> {
|
|
|
|
apply(plugin = "net.researchgate.release")
|
|
|
|
apply(plugin = "org.gradle.signing")
|
2020-05-11 09:41:00 +00:00
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
val afterReleaseBuild by tasks.existing(DefaultTask::class)
|
|
|
|
val publish by tasks.existing(Task::class)
|
2020-05-11 09:41:00 +00:00
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
afterReleaseBuild {
|
|
|
|
dependsOn(publish)
|
2020-06-05 15:26:40 +00:00
|
|
|
}
|
2018-09-24 21:13:47 +00:00
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
plugins.withType<KotlinMultiplatformPluginWrapper> {
|
|
|
|
apply(plugin = "org.jetbrains.dokka")
|
2019-08-23 23:26:31 +00:00
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
val dokka by tasks.existing(DokkaTask::class) {
|
|
|
|
outputFormat = "javadoc"
|
|
|
|
outputDirectory = "$buildDir/docs/javadoc"
|
2020-06-05 15:26:40 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
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)
|
2020-06-05 15:26:40 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
configure<KotlinMultiplatformExtension> {
|
2020-08-28 15:29:43 +00:00
|
|
|
explicitApi()
|
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
jvm {
|
|
|
|
mavenPublication {
|
|
|
|
artifact(javadocJar.get())
|
|
|
|
}
|
2020-02-12 14:32:53 +00:00
|
|
|
}
|
2020-06-05 15:26:40 +00:00
|
|
|
}
|
2020-08-07 13:51:27 +00:00
|
|
|
}
|
2020-02-12 14:32:53 +00:00
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
configure<PublishingExtension> {
|
|
|
|
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
|
|
|
|
}
|
2020-02-12 14:32:53 +00:00
|
|
|
}
|
2020-06-05 15:26:40 +00:00
|
|
|
}
|
2020-02-12 14:32:53 +00:00
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
publications.withType<MavenPublication> {
|
|
|
|
pom {
|
|
|
|
name.set(project.name)
|
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
name.set("Michael Bull")
|
|
|
|
url.set("https://www.michael-bull.com")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contributors {
|
|
|
|
contributor {
|
|
|
|
name.set("Kevin Herron")
|
|
|
|
url.set("https://github.com/kevinherron")
|
|
|
|
}
|
|
|
|
|
|
|
|
contributor {
|
|
|
|
name.set("Markus Padourek")
|
|
|
|
url.set("https://github.com/Globegitter")
|
|
|
|
}
|
|
|
|
|
|
|
|
contributor {
|
|
|
|
name.set("Tristan Hamilton")
|
|
|
|
url.set("https://github.com/Munzey")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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:55:22 +00:00
|
|
|
}
|
2020-06-05 15:26:40 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 13:51:27 +00:00
|
|
|
configure<SigningExtension> {
|
|
|
|
useGpgCmd()
|
|
|
|
sign(publications)
|
2020-02-12 14:32:53 +00:00
|
|
|
}
|
|
|
|
}
|
2018-11-01 18:39:17 +00:00
|
|
|
}
|
2018-09-24 21:13:47 +00:00
|
|
|
}
|