Skip to content

Commit

Permalink
scalapb.gen(scala3Sources = true)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Dec 27, 2023
1 parent 93290b4 commit 1167c31
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ lazy val tests = crossProject(JVMPlatform)

lazy val testsJVM = tests.jvm

val scalapbScala3Sources = Def.setting(
scalaBinaryVersion.value match {
case "2.12" =>
false
case _ =>
true
}
)

val scalapbArgonaut = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("core"))
.enablePlugins(BuildInfoPlugin)
Expand Down Expand Up @@ -76,7 +85,10 @@ val scalapbArgonaut = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.jvmSettings(
(Test / PB.targets) := Seq(
PB.gens.java -> (Test / sourceManaged).value,
scalapb.gen(javaConversions = true) -> (Test / sourceManaged).value
scalapb.gen(
javaConversions = true,
scala3Sources = scalapbScala3Sources.value
) -> (Test / sourceManaged).value
),
libraryDependencies ++= Seq(
"com.github.scalaprops" %%% "scalaprops-shapeless" % "0.5.1" % "test",
Expand Down Expand Up @@ -109,7 +121,10 @@ val scalapbArgonaut = crossProject(JVMPlatform, JSPlatform, NativePlatform)
)
.platformsSettings(JSPlatform, NativePlatform)(
(Test / PB.targets) := Seq(
scalapb.gen(javaConversions = false) -> (Test / sourceManaged).value
scalapb.gen(
javaConversions = false,
scala3Sources = scalapbScala3Sources.value
) -> (Test / sourceManaged).value
)
)
.nativeSettings(
Expand Down

0 comments on commit 1167c31

Please sign in to comment.