-
Notifications
You must be signed in to change notification settings - Fork 19
Fixing the travis ci scala version. Also everything work on scala 2.12.7 now, scalaz concurrency is gone replaced with fs2 tasks. #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GuyIncognito1986
wants to merge
25
commits into
beloglazov:master
Choose a base branch
from
GuyIncognito1986:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
816597b
Fixing the client warnings/errors, upgrading libraries, fixing tests …
e252837
Fixing the maybe stuff in requests, upgrading more libraries
0e31a24
Swithching from scalaz concurrency to fs2 task, fixing all dependent …
95b6836
fixing tests and test framework
152715f
Fixed most of the tests, these never could have passed in the first p…
fc80a3f
only 16 tests now broken, mostly query stuff
2b70490
dbInfo serialization/deserialization now works properly, 14 tests fai…
1841b5c
All tests outside query language now pass, WINZ
cb25343
All tests outside query language now pass, WINZ
cb55631
All tests outside query language now pass, WINZ
1e6e397
Deleting temp views and temp view tests as couchdb2 no longer support…
e245168
Deleting temp views and temp view tests as couchdb2 no longer support…
b5edd82
final sbt changes for release
cf7ef5d
adding stuff to publish to oss sonatype
50f3233
sonatype sbt changes for one click maven central release. WINZZZZZ
73b739d
Update README.md
GuyIncognito1986 bc6b32d
Update README.md
GuyIncognito1986 6240516
Update README.md
GuyIncognito1986 b0a8172
Update README.md
GuyIncognito1986 3248b0a
Update README.md
GuyIncognito1986 02f8845
removing static libs and more temp view redundant code, updating readme
e4074be
Updating readme
5137ec3
upgrading upickle to latest
82be691
reverting upickle update because of breaking changes in the serializer
8d57dd6
CHanging travis scala version
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| language: scala | ||
| scala: | ||
| - 2.11.8 | ||
| - 2.12.7 | ||
| jdk: | ||
| - oraclejdk8 | ||
| services: | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,5 @@ | ||
| # CouchDB-Scala | ||
|
|
||
| [](https://travis-ci.org/beloglazov/couchdb-scala) | ||
| [](https://gitter.im/beloglazov/couchdb-scala?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
| [](https://maven-badges.herokuapp.com/maven-central/com.ibm/couchdb-scala_2.11) | ||
| [](https://waffle.io/beloglazov/couchdb-scala) | ||
|
|
||
|
|
||
| This is a purely functional Scala client for | ||
| [CouchDB](http://couchdb.apache.org/). The design goals are compositionality, | ||
| expressiveness, type-safety, and ease of use. | ||
|
|
@@ -22,7 +16,7 @@ It's based on these awesome libraries: | |
| Add the following dependency to your SBT config: | ||
|
|
||
| ```Scala | ||
| libraryDependencies += "com.ibm" %% "couchdb-scala" % "0.7.2" | ||
| libraryDependencies += "io.github.guyincognito1986" %% "couchdb-scala" % "1.0.3.1" | ||
| ``` | ||
|
|
||
|
|
||
|
|
@@ -546,7 +540,12 @@ Here is a basic example of an application that stores a set of case class | |
| instances in a database, retrieves them back, and prints out afterwards: | ||
|
|
||
| ```Scala | ||
| import com.ibm.couchdb._ | ||
| import org.slf4j.LoggerFactory | ||
| import fs2.Task | ||
|
|
||
| object Basic extends App { | ||
| private val logger = LoggerFactory.getLogger(Basic.getClass) | ||
|
|
||
| // Define a simple case class to represent our data model | ||
| case class Person(name: String, age: Int) | ||
|
|
@@ -566,25 +565,33 @@ object Basic extends App { | |
| // Get an instance of the DB API by name and type mapping | ||
| val db = couch.db(dbName, typeMapping) | ||
|
|
||
| val actions = for { | ||
| // Delete the database or ignore the error if it doesn't exist | ||
| _ <- couch.dbs.delete(dbName).ignoreError | ||
| // Create a new database | ||
| _ <- couch.dbs.create(dbName) | ||
| // Insert documents into the database | ||
| _ <- db.docs.createMany(Seq(alice, bob, carl)) | ||
| // Retrieve all documents from the database and unserialize to Person | ||
| docs <- db.docs.getMany.includeDocs[Person].build.query | ||
| } yield docs.getDocsData | ||
|
|
||
| // Execute the actions and process the result | ||
| actions.attemptRun match { | ||
| // In case of an error (left side of Either), print it | ||
| case -\/(e) => println(e) | ||
| // In case of a success (right side of Either), print each object | ||
| case \/-(a) => a.map(println(_)) | ||
| typeMapping.get(classOf[Person]).foreach { mType => | ||
| val actions: Task[Seq[Person]] = for { | ||
| // Delete the database or ignore the error if it doesn't exist | ||
| _ <- couch.dbs.delete(dbName) | ||
| // Create a new database | ||
| _ <- couch.dbs.create(dbName) | ||
| // Insert documents into the database | ||
| _ <- db.docs.createMany(Seq(alice, bob, carl)) | ||
| // Retrieve all documents from the database and unserialize to Person | ||
| docs <- db.docs.getMany.includeDocs[Person].byTypeUsingTemporaryView(mType).build.query | ||
| } yield docs.getDocsData | ||
| couch.dbs.delete(dbName) | ||
| couch.dbs.create(dbName) | ||
| db.docs.createMany(Seq(alice, bob, carl)) | ||
| db.docs.getMany.includeDocs[Person].byTypeUsingTemporaryView(mType).build.query | ||
| // Execute the actions and process the result | ||
| actions.unsafeRunAsync(x => | ||
| try{ | ||
| x.map(ps => ps.foreach(p => logger.info(p.toString))) | ||
| () | ||
| } | ||
| catch{ | ||
| case e: Throwable => logger.error(e.toString) | ||
| } | ||
| ) | ||
| couch.client.client.shutdownNow() | ||
| } | ||
|
|
||
| } | ||
| ``` | ||
|
|
||
|
|
@@ -595,40 +602,12 @@ sbt "run-main com.ibm.couchdb.examples.Basic" | |
| ``` | ||
|
|
||
|
|
||
| ## Mailing list | ||
|
|
||
| Please feel free to join our mailing list, we welcome all questions and | ||
| suggestions: https://groups.google.com/forum/#!forum/couchdb-scala | ||
|
|
||
|
|
||
| ## Contributing | ||
|
|
||
| We welcome contributions, but request you follow these guidelines. Please raise | ||
| any bug reports on the project's [issue | ||
| tracker](https://github.com/beloglazov/couchdb-scala/issues). | ||
|
|
||
| In order for us to accept pull-requests, the contributor must first complete a | ||
| Contributor License Agreement (CLA). This clarifies the intellectual property | ||
| license granted with any contribution. It is for your protection as a | ||
| Contributor as well as the protection of IBM and its customers; it does not | ||
| change your rights to use your own Contributions for any other purpose. | ||
|
|
||
| You can download the CLAs here: | ||
|
|
||
| - [individual](cla/cla-individual.pdf) | ||
| - [corporate](cla/cla-corporate.pdf) | ||
|
|
||
| If you are an IBMer, please contact us directly as the contribution process is | ||
| slightly different. | ||
|
|
||
|
|
||
| ## Contributors | ||
|
|
||
| - Anton Semenov https://github.com/GuyIncognito1986 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cheeky. |
||
| - [Anton Beloglazov](http://beloglazov.info/) ([@beloglazov](https://github.com/beloglazov)) | ||
| - Ermyas Abebe ([@ermyas](https://github.com/ermyas)) | ||
|
|
||
|
|
||
| ## Copyright and license | ||
|
|
||
| © Copyright 2015 IBM Corporation, Google Inc. Distributed under the [Apache 2.0 | ||
| license](LICENSE). | ||
| Apache 2.0 license | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,86 +1,36 @@ | ||
| import xerial.sbt.Sonatype.SonatypeKeys._ | ||
|
|
||
| sonatypeSettings | ||
|
|
||
| profileName := "com.ibm.couchdb-scala" | ||
|
|
||
| organization := "com.ibm" | ||
|
|
||
| name := "couchdb-scala" | ||
|
|
||
| version := "0.8.0-SNAPSHOT" | ||
|
|
||
| scalaVersion := "2.11.8" | ||
|
|
||
| description := "A purely functional Scala client for CouchDB" | ||
|
|
||
| homepage := Some(url("https://github.com/beloglazov/couchdb-scala")) | ||
|
|
||
| version := "1.0.3.2" | ||
| scalaVersion := "2.12.7" | ||
| description := "A purely functional Scala client for CouchDB based on work by ibm guys (Anton Beloglazov and Ermyas Abebe)" | ||
| publishMavenStyle := true | ||
| licenses := Seq("The Apache Software License, Version 2.0" | ||
| -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")) | ||
| publishTo := sonatypePublishTo.value | ||
| sonatypeProfileName := "io.github.guyincognito1986" | ||
| test in assembly := {} | ||
| organization := "io.github.guyincognito1986" | ||
| import xerial.sbt.Sonatype._ | ||
| sonatypeProjectHosting := Some(GitHubHosting("guyincognito1986", "couchdb-scala", "[email protected]")) | ||
|
|
||
| libraryDependencies ++= Seq( | ||
| "org.scalaz" %% "scalaz-core" % "7.2.6", | ||
| "org.scalaz" %% "scalaz-effect" % "7.2.6", | ||
| "org.http4s" %% "http4s-core" % "0.14.6a", | ||
| "org.http4s" %% "http4s-client" % "0.14.6a", | ||
| "org.http4s" %% "http4s-blaze-client" % "0.14.6a", | ||
| "com.lihaoyi" %% "upickle" % "0.4.1", | ||
| "com.github.julien-truffaut" %% "monocle-core" % "1.2.2", | ||
| "com.github.julien-truffaut" %% "monocle-macro" % "1.2.2", | ||
| "org.log4s" %% "log4s" % "1.3.0", | ||
| "org.scalaz" %% "scalaz-core" % "7.2.26", | ||
| "org.scalaz" %% "scalaz-concurrent" % "7.2.26", | ||
| "org.scalaz" %% "scalaz-effect" % "7.2.26", | ||
| "org.http4s" %% "http4s-core" % "0.17.6", | ||
| "org.http4s" %% "http4s-client" % "0.17.6", | ||
| "org.http4s" %% "http4s-blaze-client" % "0.17.6", | ||
| "com.lihaoyi" %% "upickle" % "0.4.4", | ||
| "com.github.julien-truffaut" %% "monocle-core" % "1.3.2", | ||
| "com.github.julien-truffaut" %% "monocle-macro" % "1.3.2", | ||
| "org.log4s" %% "log4s" % "1.4.0", | ||
| "ch.qos.logback" % "logback-classic" % "1.1.7", | ||
| "org.specs2" %% "specs2" % "3.7" % "test", | ||
| "org.typelevel" %% "scalaz-specs2" % "0.3.0" % "test", | ||
| "org.scalacheck" %% "scalacheck" % "1.13.0" % "test", | ||
| "org.scalaz" %% "scalaz-scalacheck-binding" % "7.2.1" % "test" | ||
| "org.specs2" %% "specs2-core" % "3.8.9" % "test", | ||
| "org.typelevel" %% "scalaz-specs2" % "0.5.2" % "test", | ||
| "org.scalacheck" %% "scalacheck" % "1.14.0" % "test", | ||
| "org.scalaz" %% "scalaz-scalacheck-binding" % "7.2.26-scalacheck-1.14" % "test" | ||
| ) | ||
|
|
||
| scalacOptions ++= Seq( | ||
| "-deprecation", | ||
| "-encoding", "UTF-8", | ||
| "-feature", | ||
| "-language:existentials", | ||
| "-language:higherKinds", | ||
| "-language:implicitConversions", | ||
| "-language:postfixOps", | ||
| "-unchecked", | ||
| "-Xfatal-warnings", | ||
| "-Xlint", | ||
| "-Yno-adapted-args", | ||
| "-Ywarn-numeric-widen", | ||
| "-Ywarn-value-discard", | ||
| "-Xfuture", | ||
| "-Ywarn-unused-import" | ||
| ) | ||
|
|
||
| scalacOptions in (Compile, console) ~= (_ filterNot ( | ||
| List("-Ywarn-unused-import", "-Xfatal-warnings").contains(_))) | ||
|
|
||
| wartremover.wartremoverSettings | ||
|
|
||
| wartremover.wartremoverErrors in (Compile, compile) ++= Seq( | ||
| wartremover.Wart.Any, | ||
| wartremover.Wart.Any2StringAdd, | ||
| wartremover.Wart.EitherProjectionPartial, | ||
| wartremover.Wart.OptionPartial, | ||
| wartremover.Wart.Product, | ||
| wartremover.Wart.Serializable, | ||
| wartremover.Wart.ListOps | ||
| ) | ||
|
|
||
| lazy val compileScalastyle = taskKey[Unit]("compileScalastyle") | ||
|
|
||
| compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value | ||
|
|
||
| (compile in Compile) <<= (compile in Compile) dependsOn compileScalastyle | ||
|
|
||
| lazy val testScalastyle = taskKey[Unit]("testScalastyle") | ||
|
|
||
| testScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Test).toTask("").value | ||
|
|
||
| (test in Test) <<= (test in Test) dependsOn testScalastyle | ||
|
|
||
| testFrameworks := Seq(TestFrameworks.Specs2, TestFrameworks.ScalaCheck) | ||
|
|
||
| parallelExecution in Test := false | ||
|
|
@@ -94,22 +44,10 @@ initialCommands in console in Test := "import scalaz._, Scalaz._, scalacheck.Sca | |
|
|
||
| logBuffered := false | ||
|
|
||
| publishMavenStyle := true | ||
|
|
||
| publishArtifact in Test := false | ||
|
|
||
| pomExtra := { | ||
| <scm> | ||
| <connection>scm:git:[email protected]:beloglazov/couchdb-scala.git</connection> | ||
| <developerConnection>scm:git:[email protected]:beloglazov/couchdb-scala.git</developerConnection> | ||
| <url>https://github.com/beloglazov/couchdb-scala</url> | ||
| </scm> | ||
| <developers> | ||
| <developer> | ||
| <id>beloglazov</id> | ||
| <name>Anton Beloglazov</name> | ||
| <email>[email protected]</email> | ||
| <url>http://beloglazov.info</url> | ||
| </developer> | ||
| </developers> | ||
| } | ||
| assemblyMergeStrategy in assembly := { | ||
| case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard | ||
| case "reference.conf" => MergeStrategy.concat | ||
| case _ => MergeStrategy.last | ||
| } | ||
This file contains hidden or 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
This file contains hidden or 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 @@ | ||
| sbt.version=1.2.6 |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,13 +1,9 @@ | ||
| resolvers += Resolver.sonatypeRepo("releases") | ||
|
|
||
| addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.0-RC1") | ||
| addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "latest.integration") | ||
|
|
||
| addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.2") | ||
| addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "latest.integration") | ||
|
|
||
| addSbtPlugin("org.brianmckenna" % "sbt-wartremover" % "0.14") | ||
| addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1") | ||
|
|
||
| addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0") | ||
|
|
||
| addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") | ||
|
|
||
| addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.2.1") | ||
| addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "latest.integration") |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol