3

I was able to include scrooge in my SBT project (the scrooge-sbt-plugin in my plugins.sbt as well as the library dependencies in my build.sbt), but I haven't been able to figure out how to execute scrooge from the commandline as listed here http://twitter.github.io/scrooge/CommandLine.html.

anshumans
  • 4,045
  • 2
  • 18
  • 25
  • Is there a reason you don't want to use the plugin? It's better supported than the CLI. – Travis Brown Jul 03 '14 at 20:36
  • I plan on using the plugin primarily. I just wanted to quickly see the generated code for some thrift files outside of a SBT project. I thought I'd ask since I saw info at the above link about the commandline options, but nothing on how to get it working, and google didn't show anything meaningful. – anshumans Jul 03 '14 at 20:44
  • 1
    I've filed [an issue about this](https://github.com/twitter/scrooge/issues/131). In the meantime you can grab the Scrooge source and point `sbt "project scrooge-generator" "runMain com.twitter.scrooge.Main ..."` at your Thrift files. – Travis Brown Jul 03 '14 at 20:47

1 Answers1

4

A bit late to the party.

@partycoder was indeed right, however a bit more may help those who like myself aren't too sure.

Assuming your *.thrift files are located in src/main/thrift simply running sbt scrooge-gen will pick up the files and deposit them in target/src_managed/.

If your *.thrift files are not located in src/main/thrift and perhaps in src/main/resources/thrift, you can setscroogeThriftSourceFolder in you build.sbt using this example:

scroogeThriftSourceFolder in Compile <<= baseDirectory {
  base => base / "src/main/resources/thrift/"
}

This setting and others can be found here.