IntelliJ not generating scala source from protobufs

415 views
Skip to first unread message

AR

unread,
Jun 21, 2017, 3:26:17 PM6/21/17
to ScalaPB
I have added the scalapb plugin

// Scala Protocol Buffers Compiler
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.8")

libraryDependencies += "com.trueaccord.scalapb" %% "compilerplugin" % "0.6.0-pre5"

build.sbt modifications
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
)


If I run 
sbt protoc-generate
or 
sbt compile 

from my project root, the protobuf scala source gets generated fine, is found by intellij, and all is good. Great. 

However, whenever I build my project in intellij, the scala source files do not get generated. 

Scala version : 2.11.8
Intellij scala plugin version 2016.3.9







AR

unread,
Jun 21, 2017, 5:40:19 PM6/21/17
to ScalaPB
I imported the project into IntelliJ and created a new SBT project btw. 

Nadav Samet

unread,
Jun 21, 2017, 5:50:04 PM6/21/17
to ScalaPB
This is an IntelliJ issue that impacts any SBT project that uses source generators (not just ScalaPB).

Based on this comment https://youtrack.jetbrains.com/issue/SCL-9301#comment=27-2041907 there is a solution for IntelliJ 2017.1

AR

unread,
Jun 22, 2017, 1:22:12 PM6/22/17
to ScalaPB
Thanks for the quick reply Nadav, I'll try out 2017.1 ASAP. 
Reply all
Reply to author
Forward
0 new messages