From 1167c31e6574574e904904299b617f21cef84194 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 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 480a4d3..0d50191 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,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", @@ -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(