@@ -9,7 +9,7 @@ import scala.util.control.NoStackTrace
99
1010lazy val V =
1111 new {
12- val protobuf = " 3.15 .6"
12+ val protobuf = " 3.25 .6"
1313 val protoc =
1414 " 3.17.3" // the oldest protoc version with Apple M1 support, see https://github.com/scalapb/ScalaPB/issues/1024#issuecomment-860126568
1515 val coursier = " 2.1.9"
@@ -107,6 +107,31 @@ lazy val agent = project
107107 " Premain-Class" -> " com.sourcegraph.semanticdb_javac.SemanticdbAgent"
108108 )
109109 )
110+
111+ import kotlin .Keys ._
112+ lazy val kotlincPlugin = project
113+ .in(file(" semanticdb-kotlinc" ))
114+ .enablePlugins(KotlinPlugin )
115+ .settings(
116+ kotlinVersion := " 2.0.21" ,
117+ kotlincJvmTarget := " 1.8" ,
118+ kotlinLib(" stdlib" ),
119+ kotlinLib(" compiler-embeddable" ),
120+ // the source generator that sbt-protoc adds only includes java and scala files
121+ Compile / sourceGenerators +=
122+ (Compile / PB .generate)
123+ .map(
124+ _.filter { file =>
125+ file.getName.endsWith(" .kt" )
126+ }
127+ )
128+ .taskValue,
129+ (Compile / PB .protoSources) :=
130+ Seq ((semanticdb / Compile / sourceDirectory).value / " protobuf" ),
131+ (Compile / PB .targets) :=
132+ Seq (PB .gens.kotlin(V .protobuf) -> (Compile / sourceManaged).value)
133+ )
134+
110135lazy val gradlePlugin = project
111136 .in(file(" semanticdb-gradle-plugin" ))
112137 .settings(
0 commit comments