relateiq/sbt-avro4s

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

sbt-avro4s

Sbt plugin to use avro4s to generate case classes from avro schemas

Quickstart
SbtPlugin("com.sksamuel.avro4s" % "sbt-avro4s" % "1.0.0")
Version Compatibility

sbt-avro4s | avro4s ———- | ——- 1.0.0 | ?1.6.1 0.91.0 | 1.2.2

Generate scala classes from Avro schema files

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.

Settings

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

Tasks

Task | Description —————————————-|—————————————- avro2Class | Generate case classes from avro files; is a source sourceGenerator

Development
Testing

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

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.