Created
June 28, 2018 13:11
-
-
Save xuwei-k/4c333a9c9ba99773a6282a69005455ee to your computer and use it in GitHub Desktop.
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