Permalink
Browse files

More seed tasks.

  • Loading branch information...
1 parent 43a43a4 commit 7557814d055921cb77304ce403f7954fdc56edbd @maxlinc maxlinc committed Mar 22, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 project/seed.scala
View
@@ -13,8 +13,10 @@ object SeedBuild extends Build {
val hwsettings = Defaults.defaultSettings
val seed = TaskKey[Unit]("seed", "Seeds Neo4J data")
val unseed = TaskKey[Unit]("unseed", "Remove Neo4J data")
+ val reseed = TaskKey[Unit]("reseed", "Unseed and then seed Neo4J data")
val seedTask = seed := {
+ println("Seeding Neo4J")
val neo: GraphDatabaseService = new EmbeddedGraphDatabase("var/graphdb")
var first: Node = null
var second: Node = null
@@ -39,13 +41,18 @@ object SeedBuild extends Build {
}
val unseedTask = unseed := {
+ println("Unseeding Neo4J")
var d: File = new File("var/graphdb")
d.listFiles.foreach { f => f.delete }
d.delete
}
+
+ // This doesn't actually reseed, just unseed. Need to depend on both.
+ val reseedTask = reseed <<= unseed
+
lazy val project = Project(
"project",
file("."),
- settings = hwsettings ++ Seq(seedTask, unseedTask))
+ settings = hwsettings ++ Seq(seedTask, unseedTask, reseedTask))
}

0 comments on commit 7557814

Please sign in to comment.