Permalink
Browse files

Publish to personal maven repo via SSH

  • Loading branch information...
nparry committed Jan 15, 2012
1 parent b1e1a94 commit d1482ceda30b99554c040a7cd9e1d9b7b956948a
Showing with 35 additions and 7 deletions.
  1. +8 −7 README.md
  2. +27 −0 build.sbt
@@ -7,6 +7,8 @@ the JVM. The parser is written in Scala.
A JSON schema validator is also included, so you can validate JSON values against
your Orderly definitions.
Prebuilt jars/POMs/etc are published at http://repository.nparry.com/releases/com/nparry/orderly_2.9.1/
This implementation uses the same test suite as the reference implementation to
help ensure consistent behavior. If you find a case that produces different
output, please let me know and I will add it to the test suite.
@@ -24,20 +26,20 @@ From Java:
import com.nparry.orderly.api.*;
import com.nparry.orderly.*;
import java.util.List;
OrderlyFaactory factory = new DefaultOrderlyFactory();
Orderly orderly = factory.getOrderly("integer {0,100};");
List<Violation> noProblems = orderly.getViolations("50");
List<Violation> notAllowed = orderly.getViolations("200");
From Scala:
import com.nparry.orderly._
import net.liftweb.json.JsonAST._
val orderly = Orderly("integer {0,100};")
val noProblems = orderly.validate(JInt(50))
val notAllowed = orderly.validate(JInt(200))
@@ -50,10 +52,10 @@ An example of usage via the Scala console:
"minimum":0,
"maximum":100
}
scala> val noProblems = orderly.validate(JInt(50))
noProblems: List[com.nparry.orderly.Violation] = List()
scala> val notAllowed = orderly.validate(JInt(200))
notAllowed: List[com.nparry.orderly.Violation] = List(Violation(List(),200 is greater than maximum allowed value))
@@ -64,5 +66,4 @@ TODOs
* Enhance Java APIs to use an actual Java JSON library.
* Improve error messages for the parser and the validator.
* The JSON schema validator needs some work.
* Provide prebuilt jars with a Maven POM.
@@ -4,7 +4,34 @@ name := "orderly"
version := "1.0.1"
description := "An implementation of Orderly JSON (http://orderly-json.org/) for use on the JVM"
libraryDependencies ++= Seq(
"net.liftweb" %% "lift-json" % "2.4",
"org.scala-tools.testing" %% "specs" % "1.6.9" % "test"
)
publishMavenStyle := true
publishTo <<= (version) { version: String =>
val repoInfo = if (version.trim.endsWith("SNAPSHOT"))
( "nparry snapshots" -> "/home/nparry/repository.nparry.com/snapshots" )
else
( "nparry releases" -> "/home/nparry/repository.nparry.com/releases" )
val user = System.getProperty("user.name")
val keyFile = (Path.userHome / ".ssh" / "id_rsa").asFile
Some(Resolver.ssh(
repoInfo._1,
"repository.nparry.com",
repoInfo._2) as(user, keyFile))
}
pomExtra :=
<licenses>
<license>
<name>BSD license</name>
<url>http://www.opensource.org/licenses/bsd-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>

0 comments on commit d1482ce

Please sign in to comment.