From e304f596aed58afef8199a1cfc6a7081a6091401 Mon Sep 17 00:00:00 2001 From: Vladimir Kostyukov Date: Thu, 4 Dec 2014 22:03:27 -0800 Subject: [PATCH] Finch.io 0.2.0 is here --- README.md | 28 ++++++++++++++++++++++++---- project/Build.scala | 15 ++++++++++++--- project/plugins.sbt | 2 ++ 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0f93cb68b..9b8f8dfc7 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,34 @@ building composable REST APIs. Its mission is to provide the developers simple and robust REST API building blocks being as close as possible to the Finagle bare metal API. +Modules +------- + +**Finch.io** uses multi-project structure and contains of the following _modules_: + +* `finch-core` - the core classes/functions +* `finch-json` - the lightweight and immutable JSON API +* `finch-demo` - the demo project +* `finch-jawn` - the [Jawn](https://github.com/non/jawn) library binding + +Installation +------------ +Every **Finch.io** module is published at Maven Central. Use the following _sbt_ snippet: + +```scala +libraryDependencies ++= Seq( + "com.github.finagle" %% "finch-module" % "0.2.0" +) + +``` + Quickstart ---------- ```scala -resolvers += "Finch.io" at "http://repo.konfettin.ru" - libraryDependencies ++= Seq( - "io" %% "finch" % "0.1.6" + "com.github.finagle" %% "finch-core" % "0.2.0", + "com.github.finagle" %% "finch-json" % "0.2.0" ) ``` @@ -19,7 +39,7 @@ libraryDependencies ++= Seq( def hello(name: String) = new Service[HttpRequest, HttpResponse] = { def apply(req: HttpRequest) = for { title <- OptionalParam("title")(req) - } yield Ok(s"Hello, ${title.getOrElse("")} $name!") + } yield Ok(Json.obj("greetings" -> s"Hello, ${title.getOrElse("")} $name!")) } val endpoint = new Endpoint[HttpRequest, HttpResponse] { diff --git a/project/Build.scala b/project/Build.scala index 6dcb68bb5..e892dd6bd 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1,5 +1,6 @@ import sbt._ import sbt.Keys._ +import com.typesafe.sbt.pgp.PgpKeys._ import scoverage.ScoverageSbtPlugin.instrumentSettings import CoverallsPlugin.coverallsSettings @@ -14,7 +15,7 @@ object Finch extends Build { ) lazy val buildSettings = Seq( - organization := "io", + organization := "com.github.finagle", version := "0.2.0", scalaVersion := "2.10.4" ) @@ -22,7 +23,15 @@ object Finch extends Build { lazy val publishSettings = Seq( publishMavenStyle := true, publishArtifact := true, - publishTo := Some(Resolver.file("localDirectory", file(Path.userHome.absolutePath + "/repo"))), + useGpg := true, + publishTo := { + val nexus = "https://oss.sonatype.org/" + if (isSnapshot.value) + Some("snapshots" at nexus + "content/repositories/snapshots") + else + Some("releases" at nexus + "service/local/staging/deploy/maven2") + }, + publishArtifact in Test := false, licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), homepage := Some(url("https://github.com/finagle/finch")), pomExtra := ( @@ -77,5 +86,5 @@ object Finch extends Build { id = "finch-jawn", base = file("finch-jawn"), settings = jawnSettings - ) dependsOn(core) + ) dependsOn core } diff --git a/project/plugins.sbt b/project/plugins.sbt index e40d7ac29..c2d91774e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,3 +8,5 @@ addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.2") addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "0.99.7.1") addSbtPlugin("com.sksamuel.scoverage" %% "sbt-coveralls" % "0.0.5") + +addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3")