Skip to content

Instantly share code, notes, and snippets.

@manuelbernhardt
Created May 7, 2015 06:06
Show Gist options
  • Save manuelbernhardt/09cbfa52e466d0cd7ae1 to your computer and use it in GitHub Desktop.
Save manuelbernhardt/09cbfa52e466d0cd7ae1 to your computer and use it in GitHub Desktop.
jOOQ integration in a `build.sbt` file
libraryDependencies ++= Seq(
"org.jooq" % "jooq" % "3.6.0",
"org.jooq" % "jooq-codegen-maven" % "3.6.0",
"org.jooq" % "jooq-meta" % "3.6.0"
)
val generateJOOQ = taskKey[Seq[File]]("Generate JooQ classes")
val generateJOOQTask = (sourceManaged, dependencyClasspath in Compile, runner in Compile, streams) map { (src, cp, r, s) =>
toError(r.run("org.jooq.util.GenerationTool", cp.files, Array("conf/authentication.xml"), s.log))
((src / "main/generated") ** "*.scala").get
}
generateJOOQ <<= generateJOOQTask
sourceGenerators in Compile <+= generateJOOQTask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment