use flatbuffers java from sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.sys.process.Process | |
scalaVersion := "2.12.6" | |
libraryDependencies ++= Seq( | |
"com.google.flatbuffers" % "flatbuffers-java" % "1.9.0" | |
) | |
sourceGenerators in Compile += Def.task { | |
val files = (file("src/main/fbs") ** "*.fbs").get.map(_.getAbsolutePath).toList | |
val out = (sourceManaged in Compile).value | |
val args = "flatc" :: "--java" :: "-o" :: out.getAbsolutePath :: files | |
Process(args).! | |
(out ** "*.java").get | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment