Name: sbt-avro4s
Owner: SalesforceIQ
Description: Sbt plugin for avro4s
Created: 2016-09-20 20:45:09.0
Updated: 2016-09-20 20:45:11.0
Pushed: 2016-09-07 22:12:48.0
Homepage: null
Size: 29
Language: Scala
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Sbt plugin to use avro4s to generate case classes from avro schemas
project/plugins.sbt
add this line:SbtPlugin("com.sksamuel.avro4s" % "sbt-avro4s" % "1.0.0")
sbt-avro4s | avro4s ———- | ——- 1.0.0 | ?1.6.1 0.91.0 | 1.2.2
By default sbt-avro4s will look for *.avsc
files in src/main/resources/avro/
.
So put your schema files there and run:
avro2Class
or a depended task like:
compile:managedSources
The case classes will get generated in target/scala-2.10/src_managed/main/avro/
.
Also see src/sbt-test/avro2Class
for examples.
Option | Description —————————————-|—————————————- avroDirectoryName | Recurrent directory name used for lookup and output avroFileEnding | File ending of avro files, used for lookup and output resourceDirectory in avro2Class | Input directory for the avro2Class task sourceManaged in avro2Class | Output directory for the avro2Class task
Task | Description —————————————-|—————————————- avro2Class | Generate case classes from avro files; is a source sourceGenerator
To run all the sbt plugin test:
scripted
To run the B
test of the test group A
:
scripted A/B
e.g. :
scripted avro2Class/simple