From 3c5bda2a786746b5da34edcbd80c750d013b7ff4 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Wed, 27 Dec 2023 08:38:13 +0900 Subject: [PATCH] scalapb.gen(scala3Sources = true) --- build.sbt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 480a4d3..d882c62 100644 --- a/build.sbt +++ b/build.sbt @@ -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) @@ -76,7 +85,7 @@ 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", @@ -109,7 +118,7 @@ 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(