Skip to content

Commit

Permalink
Publish to personal maven repo via SSH
Browse files Browse the repository at this point in the history
  • Loading branch information
nparry committed Jan 15, 2012
1 parent b1e1a94 commit d1482ce
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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))

Expand All @@ -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))

Expand All @@ -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.

27 changes: 27 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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.