sbt / sbt-buildinfo

I know this because build.sbt knows this.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Have to run compile twice after clean to generate BuildInfo.scala

mrt181 opened this issue · comments

If i run

$ sbt clean compile

I always get

[info] Compiling 80 Scala sources to C:\cygwin64\home\username\sourcecode\myproject\target\scala-2.12\classes...
[error] source file 'C:\cygwin64\home\username\sourcecode\myproject\target\scala-2.12\src_managed\main\sbt-buildinfo\BuildInfo.scala' could not be found
[error] one error found
[error] (compile:compileIncremental) Compilation failed

But if I follow it up with
$ sbt compile
I get success

[info] Compiling 80 Scala sources to C:\cygwin64\home\username\sourcecode\myproject\target\scala-2.12\classes...
[success] Total time: 38 s, completed 07-Jun-2017 22:15:32

I had this issue, but then figured out it was because of an sbt-protoc bug (thesamet/sbt-protoc#6) which cleans the src-managed folder completely and blows away the sbt-buildinfo generated source before compile kicks in... It's been fixed in sbt-protoc but if you need to use the same version, it can be fixed by telling it to generate to a sub-folder. Mentioning it here in case it's relevant to your issues above...