diff --git a/README.md b/README.md index d968af5..adad286 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,6 @@ Improvements on the existing solutions include: - Feature parity with Result types from other languages including Elm, Haskell, & Rust -- [Multiplatform][multiplatform] project support - Lax constraints on `value`/`error` nullability - Lax constraints on the `error` type's inheritance (does not inherit from `Exception`) @@ -208,7 +207,6 @@ This project is available under the terms of the ISC license. See the [swalschin-rop]: https://fsharpforfunandprofit.com/rop/ [wiki]: https://github.com/michaelbull/kotlin-result/wiki [unit-tests]: https://github.com/michaelbull/kotlin-result/tree/master/src/test/kotlin/com/github/michaelbull/result -[multiplatform]: https://kotlinlang.org/docs/reference/multiplatform.html [example]: https://github.com/michaelbull/kotlin-result/tree/master/example/src/main/kotlin/com/github/michaelbull/result/example [swalschin-example]: https://github.com/swlaschin/Railway-Oriented-Programming-Example [ktor]: http://ktor.io/ diff --git a/build.gradle b/build.gradle index 02ebbfb..15e07f1 100644 --- a/build.gradle +++ b/build.gradle @@ -6,19 +6,18 @@ buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion" } } plugins { id 'com.github.ben-manes.versions' version '0.20.0' - id 'net.researchgate.release' version '2.7.0' id 'com.jfrog.bintray' version '1.8.4' + id 'net.researchgate.release' version '2.7.0' + id 'org.jetbrains.dokka' version '0.9.17' } -apply plugin: 'kotlin-platform-common' +apply plugin: 'kotlin' apply plugin: 'maven-publish' -apply plugin: 'org.jetbrains.dokka' description = 'A Result monad for modelling success or failure operations.' @@ -27,9 +26,21 @@ repositories { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" + + testImplementation "junit:junit:$junitVersion" testImplementation "org.jetbrains.kotlin:kotlin-test-common:$kotlinVersion" testImplementation "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlinVersion" + testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion" + testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion" +} + +compileKotlin { + kotlinOptions.jvmTarget = "1.8" +} + +compileTestKotlin { + kotlinOptions.jvmTarget = "1.8" } dokka { @@ -56,6 +67,7 @@ task sourcesJar(type: Jar) { publishing { publications { mavenJava(MavenPublication) { + from components.java artifact javadocJar artifact sourcesJar } diff --git a/example/build.gradle b/example/build.gradle index c258ab9..44e486e 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -5,17 +5,17 @@ mainClassName = 'io.ktor.server.netty.DevelopmentEngine' repositories { mavenCentral() - maven { url "http://dl.bintray.com/kotlin/ktor" } - maven { url "https://dl.bintray.com/kotlin/kotlinx" } + maven { url = "http://dl.bintray.com/kotlin/ktor" } + maven { url = "https://dl.bintray.com/kotlin/kotlinx" } } dependencies { - compile project(":jvm") - compile "ch.qos.logback:logback-classic:$logbackVersion" - compile "io.ktor:ktor-server-core:$ktorVersion" - compile "io.ktor:ktor-server-netty:$ktorVersion" - compile "io.ktor:ktor-gson:$ktorVersion" - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" + implementation project(":") + implementation "ch.qos.logback:logback-classic:$logbackVersion" + implementation "io.ktor:ktor-server-core:$ktorVersion" + implementation "io.ktor:ktor-server-netty:$ktorVersion" + implementation "io.ktor:ktor-gson:$ktorVersion" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" } compileKotlin { diff --git a/gradle.properties b/gradle.properties index 78a1612..d4db251 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,5 @@ group=com.michael-bull.kotlin-result version=1.0.9-SNAPSHOT -dokkaVersion=0.9.17 -hamkrestVersion=1.6.0.0 junitVersion=4.12 kotlinVersion=1.2.70 diff --git a/js/build.gradle b/js/build.gradle deleted file mode 100644 index ee037f6..0000000 --- a/js/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -apply plugin: 'kotlin-platform-js' - -repositories { - mavenCentral() -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion" - expectedBy project(":") - - testImplementation "org.jetbrains.kotlin:kotlin-test-js:$kotlinVersion" -} diff --git a/jvm/build.gradle b/jvm/build.gradle deleted file mode 100644 index f455925..0000000 --- a/jvm/build.gradle +++ /dev/null @@ -1,36 +0,0 @@ -apply plugin: 'kotlin-platform-jvm' - -repositories { - mavenCentral() -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - expectedBy project(":") - - testImplementation "junit:junit:$junitVersion" - testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion" - testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion" -} - -compileKotlin { - kotlinOptions { - freeCompilerArgs = [ "-Xjsr305=strict" ] - jvmTarget = "1.8" - } -} - -compileTestKotlin { - kotlinOptions { - freeCompilerArgs = [ "-Xjsr305=strict" ] - jvmTarget = "1.8" - } -} - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - } - } -} diff --git a/settings.gradle b/settings.gradle index e7bb3bf..31220da 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,5 @@ rootProject.name = 'kotlin-result' -include 'example', 'js', 'jvm' +include 'example' enableFeaturePreview('STABLE_PUBLISHING')