diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/scala/CodegenPlugin.scala | 32 | ||||
-rw-r--r-- | src/main/scala/NamespacedCodegen.scala | 2 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/main/scala/CodegenPlugin.scala b/src/main/scala/CodegenPlugin.scala index 7b51fb8..c1b5acf 100644 --- a/src/main/scala/CodegenPlugin.scala +++ b/src/main/scala/CodegenPlugin.scala @@ -7,24 +7,26 @@ object CodegenPlugin extends AutoPlugin { type TableColumn = (String, String) object autoImport { - lazy val genTables = TaskKey[Seq[File]]("gen-tables") - lazy val uri = SettingKey[String]("uri for the database configuration") - lazy val pkg = SettingKey[String]("package in which to place generated code") - lazy val tablesFilename = SettingKey[String]("path for slick table models") - lazy val rowsFilename = SettingKey[String]("path for row case classes") - lazy val schemas = SettingKey[List[String]]("schemas and tables to process") - lazy val manualForeignKeys = SettingKey[Map[TableColumn, TableColumn]]("foreign key references to data models add manually") + lazy val codegen = TaskKey[Seq[File]]("generate slick database schema") + + lazy val codegenURI = SettingKey[String]("uri for the database configuration") + lazy val codegenPackage = SettingKey[String]("package in which to place generated code") + lazy val codegenTablesFile = SettingKey[String]("path for slick table models") + lazy val codegenRowsFile = SettingKey[String]("path for row case classes") + lazy val codegenSchemaWhitelist = SettingKey[List[String]]("schemas and tables to process") + lazy val codegenForeignKeys = SettingKey[Map[TableColumn, TableColumn]]("foreign key references to data models add manually") lazy val slickCodeGenTask = Def.task { - codegen.NamespacedCodegen.run( - new java.net.URI(uri.value), - pkg.value, - tablesFilename.value, - rowsFilename.value, - schemas.value, - manualForeignKeys.value) + NamespacedCodegen.run( + new java.net.URI(codegenURI.value), + codegenPackage.value, + codegenTablesFile.value, + codegenRowsFile.value, + codegenSchemaWhitelist.value, + codegenForeignKeys.value + ) - Seq(file(tablesFilename.value), file(rowsFilename.value)) + Seq(file(codegenTablesFile.value), file(codegenRowsFile.value)) } } } diff --git a/src/main/scala/NamespacedCodegen.scala b/src/main/scala/NamespacedCodegen.scala index 220f4f2..bdda76a 100644 --- a/src/main/scala/NamespacedCodegen.scala +++ b/src/main/scala/NamespacedCodegen.scala @@ -1,5 +1,3 @@ -package codegen - import slick.dbio.{NoStream, DBIOAction} import scala.concurrent.Await |