sbtthrift

Include .thrift File from External Repository


I have an Sbt project "A" with an A.thrift file. I need to include a B.thrift file in the definition of the A.thrift file. The problem is that the B.thrift file resides in an external repository / Sbt project "B". What would be the best way to do it?


Solution

  • There are two things that I needed to do to solve this. First, I needed to add Compile / scroogePublishThrift := true and Compile / scroogeThriftSourceFolder := file('path/to/the/thrift/files') configuration to the "B" Sbt project to include raw thrift files as sources to the jar. Second, I needed to add Compile / scroogeThriftDependencies := Seq("projectB_2.12") (where "projectB_2" is the GroupId of the project "B") in the "A" sbt project to set a dependency on the "B" project.