Permalink
Browse files

Convert to SBT 0.12 to get GPG signing working, publish for 2.10

  • Loading branch information...
1 parent bb7b15d commit 945046a3111abfdfff6acd846b8a2b8006940aa7 @dchenbecker committed Oct 31, 2012
View
@@ -14,3 +14,5 @@ project/plugins/src_managed
*.ipr
*.iws
.idea/
+/z_local.sbt
+/TAGS
View
@@ -1,6 +1,6 @@
import sbt._
import Keys._
-import com.jsuereth.pgp.sbtplugin.PgpKeys._
+import com.typesafe.sbt.pgp.PgpKeys._
object ScalaJPABuild extends Build {
val fullSettings: Seq[Project.Setting[_]] = Seq(
@@ -10,41 +10,38 @@ object ScalaJPABuild extends Build {
version := "1.4",
- crossScalaVersions := Seq("2.8.0", "2.8.1", "2.9.0", "2.9.0-1", "2.9.1", "2.9.2"),
+ crossScalaVersions := Seq("2.8.0", "2.8.1", "2.9.0", "2.9.0-1", "2.9.1", "2.9.2", "2.10.0-RC1"),
resolvers ++= Seq(
"Jboss Public Repository" at "http://repository.jboss.org/nexus/content/groups/public-jboss/",
"Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
"Maven Repo 1" at "http://repo1.maven.org/maven2/",
"Guiceyfruit" at "http://guiceyfruit.googlecode.com/svn/repo/releases/",
- "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
+ "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
+ "sbt-plugin-releases" at "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"
),
- libraryDependencies <<= (scalaVersion) { sv => {
+ libraryDependencies <++= (scalaVersion) { sv => {
val specsVersion = sv match {
- case "2.8.0" => "1.6.5"
- case "2.8.1" => "1.6.7"
- case "2.9.0" | "2.9.0-1" => "1.6.8"
- case _ => "1.6.9"
+ case "2.8.0" | "2.8.1" | "2.8.2" | "2.9.0" => "1.5"
+ case "2.9.0-1" => "1.8.2"
+ case _ => "1.12.2"
}
- val specsScalaVersion = sv match {
- case "2.9.2" => "specs_2.9.1"
- case other => "specs_" + other
- }
-
Seq(
"javax.persistence" % "persistence-api" % "1.0" % "provided",
"geronimo-spec" % "geronimo-spec-jta" % "1.0-M1" % "provided",
"com.h2database" % "h2" % "1.3.152" % "test",
"org.hibernate" % "hibernate-entitymanager" % "3.4.0.GA" % "test",
- "org.scala-tools.testing" % specsScalaVersion % specsVersion % "test",
+ if (sv == "2.10.0-RC1") {
+ "org.specs2" % "specs2_2.10.0-RC1" % "1.13-SNAPSHOT" % "test"
+ } else {
+ "org.specs2" %% "specs2" % specsVersion % "test"
+ },
"ch.qos.logback" % "logback-classic" % "0.9.27" % "test"
)
}},
- useGpg := true,
-
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
@@ -57,6 +54,8 @@ object ScalaJPABuild extends Build {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
+ credentials += Credentials(Path.userHome / ".ivy2" / "sonatype.credentials"),
+
publishArtifact in Test := false,
pomExtra :=
@@ -1 +1 @@
-sbt.version=0.11.3
+sbt.version=0.12.1
View
@@ -1,3 +1 @@
-resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
-
-addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")
+addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.7")
@@ -56,7 +56,7 @@ class ScalaQuery[A](val query: Query) {
/**
* Returns the results of the query as a Seq[A]
*/
- def getResultList() = JavaConversions.asBuffer[A](query.getResultList.asInstanceOf[java.util.List[A]])
+ def getResultList() = new JavaConversions.JListWrapper[A](query.getResultList.asInstanceOf[java.util.List[A]]) // JListWrapper used directly to accomodate 2.8.0 -> 2.8.1 changes
/**
* Returns a single result of the query as an Option. If more than one
@@ -17,7 +17,7 @@
package org.scala_libs.jpa
package test
-import org.specs.Specification
+import org.specs2.mutable.Specification
/**
* A simple EM defined in our test/resources
@@ -26,20 +26,18 @@ object ThreadEM extends LocalEMF("test") with ThreadLocalEM
class ScalaJPASpecs extends Specification {
"The 'test' LocalEMF instance" should {
- shareVariables()
-
+ sequential
val myInstance = new MyItem
myInstance.id = 42
myInstance.name = "Fred"
myInstance.description = "Some guy"
-
"Persist a new instance" in {
- ThreadEM.contains(myInstance) mustBe false
+ ThreadEM.contains(myInstance) mustEqual false
ThreadEM.persistAndFlush(myInstance)
- ThreadEM.contains(myInstance) mustBe true
+ ThreadEM.contains(myInstance) mustEqual true
}
"Retrieve an instance using a raw query" in {
@@ -57,11 +55,11 @@ class ScalaJPASpecs extends Specification {
}
"Remove an instance" in {
- ThreadEM.contains(myInstance) mustBe true
+ ThreadEM.contains(myInstance) mustEqual true
ThreadEM.removeAndFlush(myInstance)
- ThreadEM.contains(myInstance) mustBe false
+ ThreadEM.contains(myInstance) mustEqual false
}
}
-}
+}

0 comments on commit 945046a

Please sign in to comment.