Skip to content
Newer
Older
100644 78 lines (51 sloc) 2.18 KB
a8e5c0d updating readme
mmcbride authored Jan 15, 2012
1 # Overview
2
3 Sbt-thrift is an sbt 0.11 plugin that adds a mixin for doing thrift code auto-generation during your
4
5 ## Building
6
7 Until standard-project is released as an sbt 0.11 plugin, you'll need
8 to publish local. So...
9
10 $sbt publish-local
11
12
13 ## Testing
14
15 There is a really crude scripted plugin. You can run it with
16
17 $sbt scripted
18
19 ## How it works
20
21 The plugin registers itself as a source generator for the compile
22 phase. Settings are added for both compile and test phases, so if you
23 have thrift files in src/test/thrift they'll get processed too.
24
25 ## Getting SbtThrift
26
27 See https://github.com/harrah/xsbt/wiki/Plugins for information on
28 adding plugins. In general, you'll need to add the following to your
29 project/plugins.sbt file:
30
31 addSbtPlugin("com.twitter" % "sbt-thrift % "11.0.0-SNAPSHOT")
32
33 ## Mixing in SbtThrift
34
35 ### Using a .sbt file
d4378fc 1.4.0-SNAPSHOT
Oliver Gould authored Apr 11, 2011
36
37 import com.twitter.sbt._
a8e5c0d updating readme
mmcbride authored Jan 16, 2012
38
39 seq(SbtThrift.newSettings: _*)
40
d4378fc 1.4.0-SNAPSHOT
Oliver Gould authored Apr 11, 2011
41
a8e5c0d updating readme
mmcbride authored Jan 16, 2012
42 ### Using a .scala build definition
43
44 import sbt._
45 import Keys._
46 import com.twitter.sbt._
3da5584 Merge branch 'multiple-scala-namespaces' of http://git.local.twitter.…
Oliver Gould authored Apr 14, 2011
47
a8e5c0d updating readme
mmcbride authored Jan 16, 2012
48 object Util extends Build {
49 lazy val root = Project(id = "util", base = file("."))
50 settings (SbtThrift.settings: _*)
d4378fc 1.4.0-SNAPSHOT
Oliver Gould authored Apr 11, 2011
51 }
52
a8e5c0d updating readme
mmcbride authored Jan 16, 2012
53 ## Settings Overview
54
55 * thrift-name - name of thrift binary to use. Usually "thrift", but
56 can be "thrift-finagle" if you want finagle bindings.
57 * thrift-platform - qualifier for the thrift binary to use calculated
58 from os.arch and os.name.
59 * thrift-bin - the File to use for thrift gen. Usually extracted from
60 the jar, but overridable with the SBT__THRIFT__BIN environment
61 variable
62 * thrift-sources-dir - where thrift source files are
63 * thrift-gen-langs - languages to emit. This is just for thrift gen.
64 It doesn't necessarily pass _all_ of these to sbt for compilation.
65 * thrift-compile-langs - languages to compile. Java/Scala only, unless
66 you extend stuff more
67 * thrift-include-folders - folders to search for thrift includes.
68 * thrift-sources - thrift files to process. Generated from
69 thrift-sources-dir
70 * thrift-output-dir - where to emit thrift files.
71 * thrift-is-dirty - should we re-gen thrift files
72 * thrift-gen - actually generate thrift
73
74 ## Where did scala thrift gen go?
75
76 See https://github.com/twitter/sbt-scrooge
77
Something went wrong with that request. Please try again.