Skip to content

Commit

Permalink
publish version 0.6 release
Browse files Browse the repository at this point in the history
 - depends on Datomisca 0.6 release
 - update and tidy samples for new release
  • Loading branch information
dwhjames committed Nov 18, 2013
1 parent a177b26 commit 279db91
Show file tree
Hide file tree
Showing 26 changed files with 110 additions and 179 deletions.
28 changes: 6 additions & 22 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object PlayDatomiscaBuild extends Build {

lazy val buildSettings = Defaults.defaultSettings ++ Seq (
organization := "com.pellucid",
version := "0.5.2",
version := "0.6",
scalaVersion := "2.10.2",
scalacOptions ++= Seq(
"-deprecation",
Expand All @@ -35,7 +35,6 @@ object PlayDatomiscaBuild extends Build {
lazy val playDatomicsaSettings =
buildSettings ++
bintray.Plugin.bintraySettings ++
//Publish.settings ++
Seq(
name := "play-datomisca",
shellPrompt := CustomShellPrompt.customPrompt,
Expand All @@ -53,17 +52,17 @@ object Dependencies {

object V {
// compile
val datomic = "0.8.4020.26"
val datomisca = "0.5.1"
val play = "2.2.0"
val datomic = "0.8.4260"
val datomisca = "0.6"
val play = "2.2.1"

// test
val junit = "4.8"
val specs2 = "2.0"
val specs2 = "2.3.4"
}

object Compile {
val datomic = "com.datomic" % "datomic-pro" % V.datomic % "provided" exclude("org.slf4j", "slf4j-nop") exclude("org.jboss.netty", "netty")
val datomic = "com.datomic" % "datomic-free" % V.datomic % "provided" exclude("org.slf4j", "slf4j-nop") exclude("org.jboss.netty", "netty")
val datomisca = "com.pellucid" %% "datomisca" % V.datomisca
val play = "com.typesafe.play" %% "play" % V.play % "provided"
}
Expand Down Expand Up @@ -110,18 +109,3 @@ object CustomShellPrompt {

}
}

/*object Publish {
lazy val settings = Seq(
publishMavenStyle := true,
publishTo <<= version { v: String =>
val localPublishRepo = "../datomisca-repo/"
if (v.trim endsWith "SNAPSHOT")
Some(Resolver.file("snapshots", new File(localPublishRepo + "/snapshots")))
else
Some(Resolver.file("releases", new File(localPublishRepo + "/releases")))
}
)
}*/
18 changes: 9 additions & 9 deletions samples/0-play-datomic-sample/app/Global.scala
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import play.api._

import play.modules.datomisca._
import scala.concurrent.Await
import scala.concurrent.duration.Duration

import play.api.{Application, GlobalSettings}
import play.api.Play.current
import play.api.libs.concurrent.Execution.Implicits.defaultContext

import datomisca._
import play.modules.datomisca._

import scala.concurrent._
import scala.concurrent.util._
import java.util.concurrent.TimeUnit._
import scala.concurrent.duration.Duration

object Global extends GlobalSettings {
import play.api.Play.current

override def onStart(app: Application){
val uri = DatomicPlugin.uri("mem")
Expand Down Expand Up @@ -37,7 +38,6 @@ object Global extends GlobalSettings {
stupid
)

implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext
implicit val conn = Datomic.connect(uri)
val fut = Datomic.transact(schema) map { tx =>
println("bootstrapped data")
Expand All @@ -52,4 +52,4 @@ object Global extends GlobalSettings {

play.Logger.info("deleted DB:" + Datomic.deleteDatabase(uri))
}
}
}
20 changes: 6 additions & 14 deletions samples/0-play-datomic-sample/app/controllers/Application.scala
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
package controllers

import play.api._
import play.api.mvc._

import play.api.Play.current
import scala.concurrent._
import scala.concurrent.util._
import java.util.concurrent.TimeUnit._
import scala.concurrent.duration.Duration
import scala.util.{Try, Success, Failure}
import play.api.mvc.{Action, Controller}
import play.api.libs.concurrent.Execution.Implicits.defaultContext

import datomisca._
import Datomic._
import play.modules.datomisca._


object Application extends Controller {
def index = Action { Async {
def index = Action.async {
val uri = DatomicPlugin.uri("mem")
implicit val conn = Datomic.connect(uri)

val person = new Namespace("person") {
val character = Namespace("person.character")
}

implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext

Datomic.transact(
Entity.add(DId(Partition.USER))(
person / "name" -> "toto",
Expand All @@ -49,9 +41,9 @@ object Application extends Controller {
]
""")

Datomic.q(query, database, DLong(45L))
Datomic.q(query, conn.database, DLong(45L))
} map { l =>
Ok(l.toString)
}
}}
}
}
11 changes: 4 additions & 7 deletions samples/0-play-datomic-sample/project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ object ApplicationBuild extends Build {

val appName = "play-datomisca-sample"
val appVersion = "1.0-SNAPSHOT"
val datomicVersion = "0.8.4020.26"
val playDatomiscaVersion = "0.5.2"
val datomicVersion = "0.8.4260"
val playDatomiscaVersion = "0.6"

val appDependencies = Seq(
"com.pellucid" %% "play-datomisca" % playDatomiscaVersion,
Expand All @@ -17,11 +17,8 @@ object ApplicationBuild extends Build {

val main = play.Project(appName, appVersion, appDependencies).settings(
resolvers ++= Seq(
Resolver.file("local repository", file("/Users/pvo/.ivy2/local"))(Resolver.ivyStylePatterns),
"clojars" at "https://clojars.org/repo",
"couchbase" at "http://files.couchbase.com/maven2",
"datomisca-repo snapshots" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/snapshots",
"datomisca-repo releases" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/releases"
"Pellucid Bintray" at "http://dl.bintray.com/content/pellucid/maven",
"clojars" at "https://clojars.org/repo"
)
)

Expand Down
2 changes: 1 addition & 1 deletion samples/0-play-datomic-sample/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ logLevel := Level.Warn
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")
18 changes: 9 additions & 9 deletions samples/1-play-datomic-getting-started/app/Global.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import play.api._

import play.modules.datomisca._
import datomisca._

import scala.concurrent._
import scala.concurrent.util._
import java.util.concurrent.TimeUnit._
import scala.concurrent.Await
import scala.concurrent.duration.Duration
import scala.io.Source

import play.api.{Application, GlobalSettings}
import play.api.libs.concurrent.Execution.Implicits.defaultContext

import datomisca._
import play.modules.datomisca._


object Global extends GlobalSettings {
import play.api.Play.current

Expand All @@ -24,7 +25,6 @@ object Global extends GlobalSettings {
println("schema:"+schema)

schema.map{ schema =>
implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext
implicit val conn = Datomic.connect(uri)
val fut = Datomic.transact(schema) flatMap { tx =>
play.Logger.info("bootstrapped schema")
Expand All @@ -51,4 +51,4 @@ object Global extends GlobalSettings {

play.Logger.info("deleted DB:" + Datomic.deleteDatabase(uri))
}
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
package controllers

import play.api._
import play.api.mvc._
import scala.language.reflectiveCalls
import scala.concurrent.Future
import scala.io.Source

import play.api.Play.current
import scala.concurrent._
import scala.concurrent.util._
import java.util.concurrent.TimeUnit._
import scala.concurrent.duration.Duration
import scala.util.{Try, Success, Failure}
import scala.io.Source
import play.api.mvc.{Action, Controller}
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import play.api.libs.json.Json

import datomisca._

import play.modules.datomisca._

import play.api.libs.json._
import play.api.libs.json.Json

import scala.language.reflectiveCalls

object Application extends Controller {
implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext

val community = new Namespace("community") {
val tpe = new Namespace("community.type")
Expand Down Expand Up @@ -584,4 +576,4 @@ object Application extends Controller {

}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[

{:district/region :region/e, :db/id #db/id[:db.part/user -1000001], :district/name "East"}
{:db/id #db/id[:db.part/user -1000002], :neighborhood/name "Capitol Hill", :neighborhood/district #db/id[:db.part/user -1000001]}
{:community/category ["15th avenue residents"], :community/orgtype :community.orgtype/community, :community/type :community.type/email-list, :db/id #db/id[:db.part/user -1000003], :community/name "15th Ave Community", :community/url "http://groups.yahoo.com/group/15thAve_Community/", :community/neighborhood #db/id[:db.part/user -1000002]}
Expand Down Expand Up @@ -449,4 +449,3 @@
{:district/region :region/sw, :db/id #db/id[:db.part/user -1000448], :district/name "Delridge"}
{:db/id #db/id[:db.part/user -1000449], :neighborhood/name "Delridge", :neighborhood/district #db/id[:db.part/user -1000448]}
{:community/category ["environmental conservation"], :community/orgtype :community.orgtype/community, :community/type :community.type/website, :db/id #db/id[:db.part/user -1000450], :community/name "Nature Consortium", :community/url "http://www.naturec.org", :community/neighborhood #db/id[:db.part/user -1000449]}
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[

{:district/region :region/se, :db/id #db/id[:db.part/user -1000451], :district/name "Greater Duwamish"}
{:db/id #db/id[:db.part/user -1000452], :neighborhood/name "Beacon Hill", :neighborhood/district #db/id[:db.part/user -1000451]}
{:community/category ["community members"], :community/orgtype :community.orgtype/community, :community/type :community.type/email-list, :db/id #db/id[:db.part/user -1000453], :community/name "nbeaconhillneighbors", :community/url "http://groups.yahoo.com/group/nbeaconhillneighbors/", :community/neighborhood #db/id[:db.part/user -1000452]}
Expand Down Expand Up @@ -323,4 +323,3 @@
{:district/region :region/se, :db/id #db/id[:db.part/user -1000772], :district/name "Southeast"}
{:db/id #db/id[:db.part/user -1000773], :neighborhood/name "Jackson Place", :neighborhood/district #db/id[:db.part/user -1000772]}
{:community/category ["neighborhood-issues" "neighborhood-planning"], :community/orgtype :community.orgtype/community, :community/type :community.type/website, :db/id #db/id[:db.part/user -1000774], :community/name "Jackson Place Community Council", :community/url "http://www.jacksonplace.org", :community/neighborhood #db/id[:db.part/user -1000773]}
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[

;; community

{:db/id #db/id[:db.part/db]
Expand Down Expand Up @@ -102,4 +102,3 @@
[:db/add #db/id[:db.part/user] :db/ident :region/sw]
[:db/add #db/id[:db.part/user] :db/ident :region/w]
[:db/add #db/id[:db.part/user] :db/ident :region/nw]
]
11 changes: 4 additions & 7 deletions samples/1-play-datomic-getting-started/project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ object ApplicationBuild extends Build {

val appName = "play-datomisca-getting-started"
val appVersion = "1.0-SNAPSHOT"
val datomicVersion = "0.8.4020.26"
val playDatomiscaVersion = "0.5.2"
val datomicVersion = "0.8.4260"
val playDatomiscaVersion = "0.6"

val appDependencies = Seq(
"com.pellucid" %% "play-datomisca" % playDatomiscaVersion,
Expand All @@ -17,11 +17,8 @@ object ApplicationBuild extends Build {

val main = play.Project(appName, appVersion, appDependencies).settings(
resolvers ++= Seq(
Resolver.file("local repository", file("/Users/pvo/.ivy2/local"))(Resolver.ivyStylePatterns),
"clojars" at "https://clojars.org/repo",
"Couchbase" at "http://files.couchbase.com/maven2/",
"datomisca-repo snapshots" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/snapshots",
"datomisca-repo releases" at "https://github.com/pellucidanalytics/datomisca-repo/raw/master/releases"
"Pellucid Bintray" at "http://dl.bintray.com/content/pellucid/maven",
"clojars" at "https://clojars.org/repo"
),
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked")
)
Expand Down
2 changes: 1 addition & 1 deletion samples/1-play-datomic-getting-started/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ logLevel := Level.Warn
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")
17 changes: 8 additions & 9 deletions samples/2-play-datomic-person-dog/app/Global.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import play.api._

import play.modules.datomisca._
import datomisca._

import scala.concurrent._
import scala.concurrent.util._
import java.util.concurrent.TimeUnit._
import scala.concurrent.Await
import scala.concurrent.duration.Duration

import play.api.{Application, GlobalSettings}
import play.api.libs.concurrent.Execution.Implicits.defaultContext

import datomisca._
import play.modules.datomisca._

import models._

object Global extends GlobalSettings {
Expand All @@ -18,7 +18,6 @@ object Global extends GlobalSettings {

play.Logger.info("created DB:" + Datomic.createDatabase(uri))

implicit val ctx = play.api.libs.concurrent.Execution.Implicits.defaultContext
implicit val conn = Datomic.connect(uri)

// TODO : here we should verify first that schema is not already in DB
Expand All @@ -41,4 +40,4 @@ object Global extends GlobalSettings {

play.Logger.info("deleted DB:" + Datomic.deleteDatabase(uri))
}
}
}
Loading

0 comments on commit 279db91

Please sign in to comment.