diff options
author | Anthony Pieter Holland <anthony.holland@gmail.com> | 2016-03-25 18:23:27 +0200 |
---|---|---|
committer | Anthony Pieter Holland <anthony.holland@gmail.com> | 2016-03-25 18:23:27 +0200 |
commit | 3df9e26bb9aa7b992dd704c72e34e0e28159f426 (patch) | |
tree | f12e27a5a3c47d645508a91abdb2eee3e37de9c4 /project/Build.scala | |
parent | 08831a9fb92242a4b1af2f5f3e12d560d36d6659 (diff) | |
download | slick-codegen-example-3df9e26bb9aa7b992dd704c72e34e0e28159f426.tar.gz slick-codegen-example-3df9e26bb9aa7b992dd704c72e34e0e28159f426.tar.bz2 slick-codegen-example-3df9e26bb9aa7b992dd704c72e34e0e28159f426.zip |
Updated library version for sbt, scala, slick, sl4j, h2 and the eclipse plugin to latest stable versions as of the time of this commit. Also has to remove prefix "scala." from val profile in Example.scala
Diffstat (limited to 'project/Build.scala')
-rw-r--r-- | project/Build.scala | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/project/Build.scala b/project/Build.scala deleted file mode 100644 index 17f055b..0000000 --- a/project/Build.scala +++ /dev/null @@ -1,40 +0,0 @@ -import sbt._ -import Keys._ -import Tests._ - -/** - * This is a simple sbt setup generating Slick code from the given - * database before compiling the projects code. - */ -object myBuild extends Build { - val slickVersion = "3.0.1" - - lazy val mainProject = Project( - id="main", - base=file("."), - settings = Project.defaultSettings ++ Seq( - scalaVersion := "2.11.6", - libraryDependencies ++= List( - "com.typesafe.slick" %% "slick" % slickVersion, - "com.typesafe.slick" %% "slick-codegen" % slickVersion, - "org.slf4j" % "slf4j-nop" % "1.7.12", - "com.h2database" % "h2" % "1.4.187" - ), - slick <<= slickCodeGenTask, // register manual sbt command - sourceGenerators in Compile <+= slickCodeGenTask // register automatic code generation on every compile, remove for only manual use - ) - ) - - // code generation task - lazy val slick = TaskKey[Seq[File]]("gen-tables") - lazy val slickCodeGenTask = (sourceManaged, dependencyClasspath in Compile, runner in Compile, streams) map { (dir, cp, r, s) => - val outputDir = (dir / "slick").getPath // place generated files in sbt's managed sources folder - val url = "jdbc:h2:mem:test;INIT=runscript from 'src/main/sql/create.sql'" // connection info for a pre-populated throw-away, in-memory db for this demo, which is freshly initialized on every run - val jdbcDriver = "org.h2.Driver" - val slickDriver = "slick.driver.H2Driver" - val pkg = "demo" - toError(r.run("slick.codegen.SourceCodeGenerator", cp.files, Array(slickDriver, jdbcDriver, url, outputDir, pkg), s.log)) - val fname = outputDir + "/demo/Tables.scala" - Seq(file(fname)) - } -} |