1

The Scrooge SBT plugin has the option to include Thrift IDL files from library dependencies (jar files). Often these jar files already contain the generated sources. If I include a Thrift IDL, I don't want to generate these sources again. Otherwise they will be duplicated.

shared.thift

namespace java me.shared

struct Foo {
  1: string id
}

shared.jar

me
  shared
    Foo.scala
shared.thrift

So when my project depends on shared.jar and I include shared.thrift in another Thrift IDL file, I don't want Scrooge to generate Foo.scala again. What's the most straight-forward way to archive this?

reikje
  • 2,850
  • 2
  • 24
  • 44

1 Answers1

1

It was actually straight-forward.

scroogeThriftSources in Compile ~= { sources: Seq[File] =>
  sources filter { case file =>
    !file.getName.contains("shared.thrift")
  }
}
reikje
  • 2,850
  • 2
  • 24
  • 44