From bf3aaee77bfe7af1816600406bb585a66f5c722c Mon Sep 17 00:00:00 2001 From: Michael Bull Date: Sun, 22 Oct 2017 00:59:16 +0100 Subject: [PATCH] Move to new package name --- README.md | 11 ++- build.gradle | 17 ++--- gradle.properties | 4 +- gradle/publish.gradle | 67 ------------------- .../michaelbull}/result/And.kt | 2 +- .../michaelbull}/result/Get.kt | 2 +- .../michaelbull}/result/Iterable.kt | 2 +- .../michaelbull}/result/Map.kt | 2 +- .../michaelbull}/result/On.kt | 2 +- .../michaelbull}/result/Or.kt | 2 +- .../michaelbull}/result/Result.kt | 2 +- .../michaelbull}/result/ResultIterator.kt | 2 +- .../michaelbull}/result/Unwrap.kt | 2 +- .../michaelbull}/result/AndTest.kt | 2 +- .../michaelbull}/result/GetTest.kt | 2 +- .../michaelbull}/result/IterableTest.kt | 2 +- .../michaelbull}/result/MapTest.kt | 2 +- .../michaelbull}/result/OnTest.kt | 2 +- .../michaelbull}/result/OrTest.kt | 2 +- .../michaelbull}/result/ResultIteratorTest.kt | 2 +- .../michaelbull}/result/UnwrapTest.kt | 2 +- 21 files changed, 32 insertions(+), 101 deletions(-) delete mode 100644 gradle/publish.gradle rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/And.kt (96%) rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/Get.kt (98%) rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/Iterable.kt (99%) rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/Map.kt (98%) rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/On.kt (90%) rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/Or.kt (95%) rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/Result.kt (97%) rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/ResultIterator.kt (98%) rename src/main/kotlin/com/{mikebull94 => github/michaelbull}/result/Unwrap.kt (98%) rename src/test/kotlin/com/{mikebull94 => github/michaelbull}/result/AndTest.kt (96%) rename src/test/kotlin/com/{mikebull94 => github/michaelbull}/result/GetTest.kt (98%) rename src/test/kotlin/com/{mikebull94 => github/michaelbull}/result/IterableTest.kt (99%) rename src/test/kotlin/com/{mikebull94 => github/michaelbull}/result/MapTest.kt (98%) rename src/test/kotlin/com/{mikebull94 => github/michaelbull}/result/OnTest.kt (96%) rename src/test/kotlin/com/{mikebull94 => github/michaelbull}/result/OrTest.kt (95%) rename src/test/kotlin/com/{mikebull94 => github/michaelbull}/result/ResultIteratorTest.kt (98%) rename src/test/kotlin/com/{mikebull94 => github/michaelbull}/result/UnwrapTest.kt (98%) diff --git a/README.md b/README.md index f053337..6d9cbbd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # kotlin-result +[![Release](https://jitpack.io/v/com.github.michaelbull/kotlin-result.svg)](https://jitpack.io/#com.github.michaelbull/kotlin-result) [![Build Status](https://travis-ci.org/michaelbull/kotlin-result.svg?branch=master)](https://travis-ci.org/michaelbull/kotlin-result) [![License](https://img.shields.io/github/license/michaelbull/kotlin-result.svg)](https://github.com/michaelbull/kotlin-result/blob/master/LICENSE) + [`Result`][result] is a monad for modelling success ([`Ok`][result-ok]) or failure ([`Error`][result-error]) operations. @@ -36,16 +38,13 @@ Improvements on the existing solutions include: ## Installation -This project is available in the [Maven Central Repository][maven-central] -repository. The artifacts are signed with my personal [GPG key][gpg]. - ```groovy repositories { - mavenCentral() + maven { url "https://jitpack.io" } } dependencies { - compile 'com.mikebull94.kotlin-result:kotlin-result:1.0.0' + compile 'com.github.michaelbull:kotlin-result:1.0.0' } ``` @@ -72,8 +71,6 @@ This project is available under the terms of the ISC license. See the [result]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L10 [result-ok]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L15 [result-error]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L31 -[maven-central]: http://search.maven.org/ -[gpg]:https://www.michael-bull.com/gpg.asc [unit-tests]: https://github.com/michaelbull/kotlin-result/tree/master/src/test/kotlin/com/mikebull94/result [wiki]: https://github.com/michaelbull/kotlin-result/wiki [wiki-elm]: https://github.com/michaelbull/kotlin-result/wiki/Elm diff --git a/build.gradle b/build.gradle index 5271a3c..aaf421f 100644 --- a/build.gradle +++ b/build.gradle @@ -12,15 +12,11 @@ buildscript { } } -ext { - gradleDir = "$rootDir/gradle" -} - apply plugin: 'kotlin' +apply plugin: 'maven-publish' apply plugin: 'org.jetbrains.dokka' apply plugin: 'org.junit.platform.gradle.plugin' apply plugin: 'net.researchgate.release' -apply from: "$gradleDir/publish.gradle" description = 'A Result monad for modelling success or failure operations.' @@ -63,7 +59,12 @@ task sourcesJar(type: Jar) { from sourceSets.main.allSource } -artifacts { - archives javadocJar - archives sourcesJar +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifact javadocJar + artifact sourcesJar + } + } } diff --git a/gradle.properties b/gradle.properties index 5b0b03e..ddb2389 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -group=com.mikebull94.kotlin-result -version=1.0.0-SNAPSHOT +group=com.github.michaelbull.kotlin-result +version=0.0.0-SNAPSHOT dokkaVersion=0.9.15 gradleReleaseVersion=2.6.0 diff --git a/gradle/publish.gradle b/gradle/publish.gradle deleted file mode 100644 index 4340a69..0000000 --- a/gradle/publish.gradle +++ /dev/null @@ -1,67 +0,0 @@ -apply plugin: 'maven' -apply plugin: 'signing' - -ext.isSnapshot = version.endsWith('-SNAPSHOT') -ext.isCI = System.getenv('CI') != null - -if (!isCI) { - signing { - sign configurations.archives - } -} - -uploadArchives { - repositories { - mavenDeployer { - if (isSnapshot || isCI) { - repository(url: "file://~/.m2/repository") - } else { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - } - } - } -} - -rootProject.tasks.afterReleaseBuild.dependsOn tasks.uploadArchives - -afterEvaluate { - tasks.uploadArchives.repositories.mavenDeployer.pom.project { - groupId = project.group - artifactId = project.name - version = project.version - packaging = 'jar' - - name = project.name - description = project.description - inceptionYear = 2017 - url = 'https://github.com/michaelbull/kotlin-result' - - scm { - connection = 'scm:git:https://github.com/michaelbull/kotlin-result' - developerConnection = 'scm:git:git@github.com:michaelbull/kotlin-result.git' - url = 'https://github.com/michaelbull/kotlin-result' - } - - licenses { - license { - name = 'ISC License' - url = 'http://opensource.org/licenses/isc-license.txt' - } - } - - developers { - developer { - name = 'Michael Bull' - url = 'https://www.michael-bull.com' - } - } - } -} diff --git a/src/main/kotlin/com/mikebull94/result/And.kt b/src/main/kotlin/com/github/michaelbull/result/And.kt similarity index 96% rename from src/main/kotlin/com/mikebull94/result/And.kt rename to src/main/kotlin/com/github/michaelbull/result/And.kt index cd80e59..591ea8c 100644 --- a/src/main/kotlin/com/mikebull94/result/And.kt +++ b/src/main/kotlin/com/github/michaelbull/result/And.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result /** * - Rust: [Result.and](https://doc.rust-lang.org/std/result/enum.Result.html#method.and) diff --git a/src/main/kotlin/com/mikebull94/result/Get.kt b/src/main/kotlin/com/github/michaelbull/result/Get.kt similarity index 98% rename from src/main/kotlin/com/mikebull94/result/Get.kt rename to src/main/kotlin/com/github/michaelbull/result/Get.kt index 4212afd..ab200f4 100644 --- a/src/main/kotlin/com/mikebull94/result/Get.kt +++ b/src/main/kotlin/com/github/michaelbull/result/Get.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result /** * - Elm: [Result.toMaybe](http://package.elm-lang.org/packages/elm-lang/core/latest/Result#toMaybe) diff --git a/src/main/kotlin/com/mikebull94/result/Iterable.kt b/src/main/kotlin/com/github/michaelbull/result/Iterable.kt similarity index 99% rename from src/main/kotlin/com/mikebull94/result/Iterable.kt rename to src/main/kotlin/com/github/michaelbull/result/Iterable.kt index 739f4ef..c141e6d 100644 --- a/src/main/kotlin/com/mikebull94/result/Iterable.kt +++ b/src/main/kotlin/com/github/michaelbull/result/Iterable.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result /** * Accumulates value starting with [initial] value and applying [operation] from left to right to diff --git a/src/main/kotlin/com/mikebull94/result/Map.kt b/src/main/kotlin/com/github/michaelbull/result/Map.kt similarity index 98% rename from src/main/kotlin/com/mikebull94/result/Map.kt rename to src/main/kotlin/com/github/michaelbull/result/Map.kt index 553c46e..9a3a201 100644 --- a/src/main/kotlin/com/mikebull94/result/Map.kt +++ b/src/main/kotlin/com/github/michaelbull/result/Map.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result /** * Maps a [Result][Result] to [Result][Result] by applying a function to a contained diff --git a/src/main/kotlin/com/mikebull94/result/On.kt b/src/main/kotlin/com/github/michaelbull/result/On.kt similarity index 90% rename from src/main/kotlin/com/mikebull94/result/On.kt rename to src/main/kotlin/com/github/michaelbull/result/On.kt index c99b281..9e5c437 100644 --- a/src/main/kotlin/com/mikebull94/result/On.kt +++ b/src/main/kotlin/com/github/michaelbull/result/On.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result /** * Calls a [callback] if the [Result] is [Ok]. diff --git a/src/main/kotlin/com/mikebull94/result/Or.kt b/src/main/kotlin/com/github/michaelbull/result/Or.kt similarity index 95% rename from src/main/kotlin/com/mikebull94/result/Or.kt rename to src/main/kotlin/com/github/michaelbull/result/Or.kt index aab6baf..9f764a7 100644 --- a/src/main/kotlin/com/mikebull94/result/Or.kt +++ b/src/main/kotlin/com/github/michaelbull/result/Or.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result /** * - Rust: [Result.or](https://doc.rust-lang.org/std/result/enum.Result.html#method.or) diff --git a/src/main/kotlin/com/mikebull94/result/Result.kt b/src/main/kotlin/com/github/michaelbull/result/Result.kt similarity index 97% rename from src/main/kotlin/com/mikebull94/result/Result.kt rename to src/main/kotlin/com/github/michaelbull/result/Result.kt index ac3d972..8c9ace0 100644 --- a/src/main/kotlin/com/mikebull94/result/Result.kt +++ b/src/main/kotlin/com/github/michaelbull/result/Result.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result /** * [Result] is a type that represents either success ([Ok]) or failure ([Error]). diff --git a/src/main/kotlin/com/mikebull94/result/ResultIterator.kt b/src/main/kotlin/com/github/michaelbull/result/ResultIterator.kt similarity index 98% rename from src/main/kotlin/com/mikebull94/result/ResultIterator.kt rename to src/main/kotlin/com/github/michaelbull/result/ResultIterator.kt index aa7209f..af11cdf 100644 --- a/src/main/kotlin/com/mikebull94/result/ResultIterator.kt +++ b/src/main/kotlin/com/github/michaelbull/result/ResultIterator.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result /** * Creates an [Iterator] over the possibly contained [value][Ok.value]. diff --git a/src/main/kotlin/com/mikebull94/result/Unwrap.kt b/src/main/kotlin/com/github/michaelbull/result/Unwrap.kt similarity index 98% rename from src/main/kotlin/com/mikebull94/result/Unwrap.kt rename to src/main/kotlin/com/github/michaelbull/result/Unwrap.kt index 19c056c..58cb8de 100644 --- a/src/main/kotlin/com/mikebull94/result/Unwrap.kt +++ b/src/main/kotlin/com/github/michaelbull/result/Unwrap.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result class UnwrapException(message: String) : Exception(message) diff --git a/src/test/kotlin/com/mikebull94/result/AndTest.kt b/src/test/kotlin/com/github/michaelbull/result/AndTest.kt similarity index 96% rename from src/test/kotlin/com/mikebull94/result/AndTest.kt rename to src/test/kotlin/com/github/michaelbull/result/AndTest.kt index 61d30ad..49c4af7 100644 --- a/src/test/kotlin/com/mikebull94/result/AndTest.kt +++ b/src/test/kotlin/com/github/michaelbull/result/AndTest.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result import com.natpryce.hamkrest.assertion.assertThat import com.natpryce.hamkrest.equalTo diff --git a/src/test/kotlin/com/mikebull94/result/GetTest.kt b/src/test/kotlin/com/github/michaelbull/result/GetTest.kt similarity index 98% rename from src/test/kotlin/com/mikebull94/result/GetTest.kt rename to src/test/kotlin/com/github/michaelbull/result/GetTest.kt index 3fef724..0db6d73 100644 --- a/src/test/kotlin/com/mikebull94/result/GetTest.kt +++ b/src/test/kotlin/com/github/michaelbull/result/GetTest.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result import com.natpryce.hamkrest.assertion.assertThat import com.natpryce.hamkrest.equalTo diff --git a/src/test/kotlin/com/mikebull94/result/IterableTest.kt b/src/test/kotlin/com/github/michaelbull/result/IterableTest.kt similarity index 99% rename from src/test/kotlin/com/mikebull94/result/IterableTest.kt rename to src/test/kotlin/com/github/michaelbull/result/IterableTest.kt index e14b9ea..84c71d2 100644 --- a/src/test/kotlin/com/mikebull94/result/IterableTest.kt +++ b/src/test/kotlin/com/github/michaelbull/result/IterableTest.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result import com.natpryce.hamkrest.Matcher import com.natpryce.hamkrest.assertion.assertThat diff --git a/src/test/kotlin/com/mikebull94/result/MapTest.kt b/src/test/kotlin/com/github/michaelbull/result/MapTest.kt similarity index 98% rename from src/test/kotlin/com/mikebull94/result/MapTest.kt rename to src/test/kotlin/com/github/michaelbull/result/MapTest.kt index 30642e0..ca10f77 100644 --- a/src/test/kotlin/com/mikebull94/result/MapTest.kt +++ b/src/test/kotlin/com/github/michaelbull/result/MapTest.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result import com.natpryce.hamkrest.Matcher import com.natpryce.hamkrest.assertion.assertThat diff --git a/src/test/kotlin/com/mikebull94/result/OnTest.kt b/src/test/kotlin/com/github/michaelbull/result/OnTest.kt similarity index 96% rename from src/test/kotlin/com/mikebull94/result/OnTest.kt rename to src/test/kotlin/com/github/michaelbull/result/OnTest.kt index 4d5617a..18cee51 100644 --- a/src/test/kotlin/com/mikebull94/result/OnTest.kt +++ b/src/test/kotlin/com/github/michaelbull/result/OnTest.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result import com.natpryce.hamkrest.assertion.assertThat import com.natpryce.hamkrest.equalTo diff --git a/src/test/kotlin/com/mikebull94/result/OrTest.kt b/src/test/kotlin/com/github/michaelbull/result/OrTest.kt similarity index 95% rename from src/test/kotlin/com/mikebull94/result/OrTest.kt rename to src/test/kotlin/com/github/michaelbull/result/OrTest.kt index 08310ca..32a0899 100644 --- a/src/test/kotlin/com/mikebull94/result/OrTest.kt +++ b/src/test/kotlin/com/github/michaelbull/result/OrTest.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result import com.natpryce.hamkrest.assertion.assertThat import com.natpryce.hamkrest.equalTo diff --git a/src/test/kotlin/com/mikebull94/result/ResultIteratorTest.kt b/src/test/kotlin/com/github/michaelbull/result/ResultIteratorTest.kt similarity index 98% rename from src/test/kotlin/com/mikebull94/result/ResultIteratorTest.kt rename to src/test/kotlin/com/github/michaelbull/result/ResultIteratorTest.kt index 4f789c3..bb57d0e 100644 --- a/src/test/kotlin/com/mikebull94/result/ResultIteratorTest.kt +++ b/src/test/kotlin/com/github/michaelbull/result/ResultIteratorTest.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result import com.natpryce.hamkrest.assertion.assertThat import com.natpryce.hamkrest.equalTo diff --git a/src/test/kotlin/com/mikebull94/result/UnwrapTest.kt b/src/test/kotlin/com/github/michaelbull/result/UnwrapTest.kt similarity index 98% rename from src/test/kotlin/com/mikebull94/result/UnwrapTest.kt rename to src/test/kotlin/com/github/michaelbull/result/UnwrapTest.kt index b972a82..0a693b8 100644 --- a/src/test/kotlin/com/mikebull94/result/UnwrapTest.kt +++ b/src/test/kotlin/com/github/michaelbull/result/UnwrapTest.kt @@ -1,4 +1,4 @@ -package com.mikebull94.result +package com.github.michaelbull.result import com.natpryce.hamkrest.assertion.assertThat import com.natpryce.hamkrest.equalTo