Skip to content

Commit

Permalink
Small fixes in design and build.sbt
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszKubuszok committed Apr 19, 2024
1 parent 2c1124b commit 36902e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ The simplified version of how the code above works:
new Bar(
transformerInto.source.a,
transformerInto.source.b,
transformerInto.td.runtimDataStore(0).asInstanceOf[Double]
transformerInto.td.runtimeDataStore(0).asInstanceOf[Double]
)
}
```
4. since there might be many overrides in `td.runtimDataStore(0)` and the macro needs to know which field override is on
4. since there might be many overrides in `td.runtimeDataStore(0)` and the macro needs to know which field override is on
which position, **DSL needs to remember somehow what each index in the vector overrides**. For that purpose there
exist `TransformerCfg`, a phantom type (a type used only in compile time) which acts as a type-level list where each
such information could be prepended. (You can think of it as of a tuple, which never get instantiated and only exist
Expand Down Expand Up @@ -73,7 +73,7 @@ Transformer.define[Foo, Bar].withFieldConst(_.c, 3.0).buildTransformer
def transform(src: Foo): Bar = new Bar(
src.a,
src.b,
transformerDefinition.runtimDataStore(0).asInstanceOf[Double]
transformerDefinition.runtimeDataStore(0).asInstanceOf[Double]
)
}
}
Expand Down
11 changes: 6 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import com.jsuereth.sbtpgp.PgpKeys.publishSigned
import com.typesafe.tools.mima.core.{Problem, ProblemFilters}
import commandmatrix.extra.*
import sbtprotoc.ProtocPlugin.ProtobufConfig

// Used to configure the build so that it would format on compile during development
// but not on CI.
Expand Down Expand Up @@ -211,7 +212,7 @@ val dependencies = Seq(
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) =>
Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided,
compilerPlugin("org.typelevel" % "kind-projector" % "0.13.3" cross CrossVersion.full)
)
case _ => Seq.empty
Expand Down Expand Up @@ -430,7 +431,7 @@ lazy val chimneyCats = projectMatrix
libraryDependencies += "org.typelevel" %%% "cats-core" % "2.10.0" % Provided,
libraryDependencies += "org.typelevel" %%% "cats-laws" % "2.10.0" % Test
)
.dependsOn(chimney % "test->test;compile->compile")
.dependsOn(chimney % s"$Test->$Test;$Compile->$Compile")

lazy val chimneyJavaCollections = projectMatrix
.in(file("chimney-java-collections"))
Expand All @@ -456,7 +457,7 @@ lazy val chimneyJavaCollections = projectMatrix
}
}
)
.dependsOn(chimney % "test->test;compile->compile")
.dependsOn(chimney % s"$Test->$Test;$Compile->$Compile")

lazy val chimneyProtobufs = projectMatrix
.in(file("chimney-protobufs"))
Expand Down Expand Up @@ -495,9 +496,9 @@ lazy val chimneyProtobufs = projectMatrix
Compile / PB.targets := Seq(scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"),
Test / PB.protoSources += PB.externalSourcePath.value,
Test / PB.targets := Seq(scalapb.gen() -> (Test / sourceManaged).value / "scalapb"),
libraryDependencies += "com.thesamet.scalapb" %%% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
libraryDependencies += "com.thesamet.scalapb" %%% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % ProtobufConfig
)
.dependsOn(chimney % "test->test;compile->compile")
.dependsOn(chimney % s"$Test->$Test;$Compile->$Compile")

lazy val benchmarks = projectMatrix
.in(file("benchmarks"))
Expand Down

0 comments on commit 36902e2

Please sign in to comment.