From 36902e27968768f1317efa3e5dd4fdbf113efea2 Mon Sep 17 00:00:00 2001 From: Mateusz Kubuszok Date: Thu, 18 Apr 2024 12:53:22 +0200 Subject: [PATCH] Small fixes in design and build.sbt --- DESIGN.md | 6 +++--- build.sbt | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index b3626b57d..b4db72510 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -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 @@ -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] ) } } diff --git a/build.sbt b/build.sbt index 4242dc270..379c1337a 100644 --- a/build.sbt +++ b/build.sbt @@ -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. @@ -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 @@ -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")) @@ -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")) @@ -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"))