title: Slick code generator with Postgres in Play Framework
body: <p>I'm new to Scala and Slick.
  Trying to use code generator example from here <a href="https://github.com/slick/slick-codegen-example" rel="nofollow">https://github.com/slick/slick-codegen-example</a> and change it to Postgres driver.
  Here is my code in Build.Scala file:</p>
  
  <pre><code>import sbt._
  import Keys._
  import Tests._
  
  
      object myBuild extends Build {
        val slickVersion = "3.0.2"
  
        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",
              "org.postgresql" % "postgresql" % "9.4-1201-jdbc41"
            ),
            slick &lt;&lt;= slickCodeGenTask, // register manual sbt command
            sourceGenerators in Compile &lt;+= 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) =&gt;
          val outputDir = (dir / "slick").getPath // place generated files in sbt's managed sources folder
          val url = "jdbc:postgresql://localhost:5432/db'" // connection info
          val jdbcDriver = "org.postgresql.Driver"
          val slickDriver = "slick.driver.PostgresDriver"
          val pkg = "dao"
          val user="postgres"
          val password="pass"
          toError(r.run("slick.codegen.SourceCodeGenerator", cp.files, Array(slickDriver, jdbcDriver, url, outputDir, pkg, user, password), s.log))
          val fname = outputDir + "/dao/Tables.scala"
          Seq(file(fname))
        }
      }
  </code></pre>
  
  <p>The only things I change were drivers and login, password. As I understand it should generate code each time I run </p>
  
  <blockquote>
    <p>activator run</p>
  </blockquote>
  
  <p>but it doesn't generate any code. Also, how it can be run manually?</p>