Search code examples
scalasbtsbt-pluginsbt-buildinfo

How can I ask sbt-buildinfo to run only at (re)load time and not compile time?


I use the sbt-buildinfo SBT plugin, which works great.

I would like to improve the following thing: currently, all values in the generated file can only change if the whole sbt project is reloaded, and thus not at every compile run. I would therefore like to prevent BuildInfo from being regenerated at compile time, and instead, directly generate it at project load time only.

Is this possible?


Solution

  • My bad. sbt-buildinfo is smarter than I am… It indeed doesn't regenerate the file if it doesn't need to. In my case, it was regenerating it because I ad added the BuildInfoOption.BuildTime option, which adds the build time to BuildInfo, and which causes the regeneration.