Skip to content

Commit

Permalink
codegen: Don't test scala2-only generator traits.
Browse files Browse the repository at this point in the history
CirceJsonCodecModels and MonocleLensesModels are removed from CodeGeneration
  • Loading branch information
nafg committed Dec 8, 2023
1 parent 2e80eca commit d0a76d3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 25 deletions.
5 changes: 1 addition & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ lazy val `test-codegen` =
.settings(
publish / skip := true,
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value),
scalacOptions += "-Ymacro-annotations",
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % slickVersion,
"io.circe" %% "circe-generic" % "0.14.5",
"dev.optics" %% "monocle-macro" % "3.2.0"
"com.typesafe.slick" %% "slick" % slickVersion
)
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package entity
import slick.additions.entity.Lookup, io.circe.generic.JsonCodec,
monocle.macros.Lenses
@JsonCodec @Lenses case class ColorsRow(name: String)
object ColorsRow
@JsonCodec @Lenses case class PeopleRow(
import slick.additions.entity.Lookup
case class ColorsRow(name: String)
case class PeopleRow(
first: String,
last: String,
city: String = "New York",
Expand All @@ -28,4 +26,3 @@ object ColorsRow
col23: Option[Int] = None,
col24: Option[Int] = None
)
object PeopleRow
10 changes: 0 additions & 10 deletions slick-additions-codegen/src/test/resources/entity/package.scala

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package slick.additions.codegen

import slick.additions.codegen.extra.circe.CirceJsonCodecModelsCodeGenerator
import slick.additions.codegen.extra.monocle.MonocleLensesModelsCodeGenerator


case class CodeGeneration(generator: BaseCodeGenerator, rules: GenerationRules) {
def pkgName = rules.packageName
val filename: String = s"${pkgName}/${rules.container}.scala"
Expand All @@ -19,7 +15,7 @@ object CodeGeneration
new TestGenerationRules("TableModules", "entity") with EntityGenerationRules
),
CodeGeneration(
new KeylessModelsCodeGenerator with MonocleLensesModelsCodeGenerator with CirceJsonCodecModelsCodeGenerator,
new KeylessModelsCodeGenerator,
new TestGenerationRules("Models", "entity") with EntityGenerationRules
)
)
Expand Down

0 comments on commit d0a76d3

Please sign in to comment.