From 0111e2d1efa13f4d9634b4bd6ebabcb0e4524956 Mon Sep 17 00:00:00 2001 From: Aurelijus Banelis Date: Wed, 9 Sep 2015 20:38:14 +0300 Subject: [PATCH] Settings for publishing to oss.sonatype.org Separated macros and core scarango driver projects. Added organisation as maven groupid. Added links to example projects and other documentation improvements. --- README.md | 47 ++++++++++++++++++++++----- project/Publish.scala | 4 ++- project/build.scala | 16 +++++---- scarango-macros/project/Publish.scala | 38 ++++++++++++++++++++++ scarango-macros/project/build.scala | 24 +++++++++----- 5 files changed, 105 insertions(+), 24 deletions(-) create mode 100644 scarango-macros/project/Publish.scala diff --git a/README.md b/README.md index 437710a..74f2359 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This driver is based on [ArangoDB](https://www.arangodb.com/) REST API and spray Stability --------- -**This is early alpha** +**This is early erly version**. Functionality, that is covered: * **Database**: Create, List, Remove, ~~by user~~, ~~with user data~~ * **Collection**: Create, ~~List~~, Read (status, type, ~~properties~~, ~~count~~, ~~statistics~~), Remove, ~~(un)laod~~, ~~truncate~~, ~~rotate~~, ~~rename~~ @@ -20,8 +20,35 @@ Stability * ~~Export, replicate~~ * Version, ~~WAL, System, Tasks, Log~~ -See [integration tests](src/test/scala/com/auginte/scarango/IntegrationTest.scala) -for details of covered functionality and usage examples +Usage +----- + +You may need to add the Sonatype nexus to your resolvers: + +```scala +resolvers += "Sonatype OOS" at ""https//oss.sonatype.org/content/groups/public" +``` + +sbt: +```scala +libraryDependencies += "com.auginte" % "scarango_2.11" % "0.2.3" +``` + +Maven: +```xml + + com.auginte + scarango_2.11 + 0.2.3 + sources + +``` + +Examples +-------- + +* Clone [Example project](https://github.com/aurelijusb/scarango-example) +* See [integration tests](src/test/scala/com/auginte/scarango/IntegrationTest.scala) Why another driver ------------------ @@ -31,14 +58,13 @@ This client/driver concentrates on faster/easier development of * Akka/spray based applications * Graph intensive applications -Meaning, not the coverage of newest API changes or fancy ORM. +*Development still in progress* Architecture concepts --------------------- * Interacting with ArangoDB via Scarango Actor (reuse open HTTP connection) * All operations/actor messages grouped into requests, response and error packages -* `request.groups` traits used for Functional grouping Similar projects ---------------- @@ -46,8 +72,8 @@ Similar projects * https://github.com/CharlesAHunt/proteus * https://github.com/sumito3478/scarango -Run ---- +Run/Develop driver itself +------------------------- Assuming, that ArangoDb is installed on http://127.0.0.1:8529 @@ -68,4 +94,9 @@ Test ``` sbt test -``` \ No newline at end of file +``` + +License +------- + +[Apache 2.0](LICENSE) \ No newline at end of file diff --git a/project/Publish.scala b/project/Publish.scala index 450e564..a32035c 100644 --- a/project/Publish.scala +++ b/project/Publish.scala @@ -7,6 +7,7 @@ object Publish { lazy val settings = Seq( licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), homepage := Some(url("http://scarango.auginte.com/")), + organization := "com.auginte", publishMavenStyle := true, publishArtifact in Test := false, @@ -19,8 +20,9 @@ object Publish { Some("releases" at nexus + "service/local/staging/deploy/maven2") }, + credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"), + pomExtra := - http://scarango.auginte.com/ git@github.com:aurelijusb/scarango.git scm:git@github.com:aurelijusb/scarango.git diff --git a/project/build.scala b/project/build.scala index 57ce860..3845791 100644 --- a/project/build.scala +++ b/project/build.scala @@ -3,7 +3,7 @@ import sbt._ object build extends sbt.Build { val buildName = "scarango" - val buildVersion = "0.2.1" + val buildVersion = "0.2.3" val buildScalaVersion = "2.11.7" val buildOptions = Seq("-feature", "-unchecked", "-deprecation", "-encoding", "utf8") @@ -17,25 +17,29 @@ object build extends sbt.Build { "io.spray" %% "spray-json" % "1.3.2", "io.spray" %% "spray-json" % "1.3.2", "org.scala-lang" % "scala-compiler" % buildScalaVersion, + "com.auginte" %% "scarango-macros" % "0.2.2", // See scarango-macros folder "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test" ) - lazy val commonSettings = Seq( + val scarangoAtSonatype = Seq( + "OSS" at "https//oss.sonatype.org/content/groups/public" + ) + + lazy val scarango = Seq( name := buildName, + description := "Scala driver for ArangoDB", version := buildVersion, scalaVersion := buildScalaVersion, scalacOptions := buildOptions, mainClass := Some("com.auginte.scarango.Main"), + resolvers ++= scarangoAtSonatype, libraryDependencies ++= buildDependencies, scalacOptions in(Compile, doc) ++= Seq("-diagrams"), spray.revolver.RevolverPlugin.Revolver.settings ) - lazy val scarangoMacros = RootProject(file("scarango-macros")) - lazy val scarangoLibrary = (project in file(".") - settings (commonSettings: _*) + settings (scarango: _*) settings (Publish.settings: _*) - dependsOn scarangoMacros ) } diff --git a/scarango-macros/project/Publish.scala b/scarango-macros/project/Publish.scala new file mode 100644 index 0000000..4c138b2 --- /dev/null +++ b/scarango-macros/project/Publish.scala @@ -0,0 +1,38 @@ +import sbt._ +import Keys._ + +object Publish { + val nexus = "https://oss.sonatype.org/" + + lazy val settings = Seq( + organization := "com.auginte", + licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), + homepage := Some(url("http://scarango.auginte.com/")), + + publishMavenStyle := true, + publishArtifact in Test := false, + pomIncludeRepository := (_ => false), + + publishTo <<= version { v => + if (v.trim endsWith "SNAPSHOT") + Some("snapshots" at nexus + "content/repositories/snapshots") + else + Some("releases" at nexus + "service/local/staging/deploy/maven2") + }, + + credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"), + + pomExtra := + + git@github.com:aurelijusb/scarango.git/scarango-macros + scm:git@github.com:aurelijusb/scarango.git/scarango-macros + + + + aurelijusb + Aurelijus Banelis + http://aurelijus.banelis.lt + + + ) +} \ No newline at end of file diff --git a/scarango-macros/project/build.scala b/scarango-macros/project/build.scala index bb21599..b1d39f9 100644 --- a/scarango-macros/project/build.scala +++ b/scarango-macros/project/build.scala @@ -3,7 +3,7 @@ import sbt._ object build extends sbt.Build { val buildName = "scarango-macros" - val buildVersion = "0.1" + val buildVersion = "0.2.2" val buildScalaVersion = "2.11.7" val buildOptions = Seq("-feature", "-unchecked", "-deprecation", "-encoding", "utf8") @@ -12,13 +12,19 @@ object build extends sbt.Build { "org.scala-lang" % "scala-compiler" % buildScalaVersion ) - lazy val scarangoLibrary = Project(id = buildName, base = file(".")) settings - ( - name := buildName, - version := buildVersion, - scalaVersion := buildScalaVersion, - scalacOptions := buildOptions, - libraryDependencies ++= buildDependencies, - scalacOptions in(Compile, doc) ++= Seq("-diagrams") + lazy val macrosSettings = Seq( + name := buildName, + version := buildVersion, + description := "Scala Macro part for scarango driver", + scalaVersion := buildScalaVersion, + scalacOptions := buildOptions, + libraryDependencies ++= buildDependencies, + scalacOptions in(Compile, doc) ++= Seq("-diagrams") + ) + + lazy val scarangoMacros = (project in file(".") + settings (macrosSettings: _*) + settings (Publish.settings: _*) ) + }