Code Monkey home page Code Monkey logo

sbt-avro's Introduction

sbt-avro

image

Overview

sbt-avro is a plugin for sbt-0.13 for generating the Java sources for Avro schemas and protocols. It tries to be clever in compiling schemas with referenced types before dependent ones.

Usage

Install the plugin

Add the plugin according to the sbt documentation.

For instance, add the following lines to the file project/plugins.sbt in your project directory:

addSbtPlugin("com.cavorite" % "sbt-avro-1-8" % "1.1.3")

Scope

All settings and tasks are in the avro scope. If you want to execute the generate task directly, just run avro:generate.

Settings

Name Name in shell Default Description
sourceDirectory source-directory src/main/avro Path containing *.avsc, *.avdl and *.avpr files.
javaSource java-source $sourceManaged/compiled_avro Path for the generated *.java files.
version version 1.8.2 Version of the Avro library should be used. A dependency to "org.apache.avro" % "avro-compiler" % "$version" is automatically added to libraryDependencies.
stringType string-type CharSequence Java type for string elements. Possible values: CharSequence (by default), Utf8 and String.

Example

For example, if you want to change the Java type of the string elements in the schema, you can add the following lines to your build.sbt file:

(stringType in AvroConfig) := "String"

Tasks

Name Name in shell Description
generate generate Compiles the Avro files. This task is automatically executed every time the project is compiled.

License

This program is distributed under the BSD license. See the file LICENSE for more details.

Credits

sbt-avro is maintained by the sbt Community. The initial code was based on a similar plugin: sbt-protobuf. Feel free to send your comments and bug reports.

Contributors

sbt-avro's People

Contributors

abhay-pradhan avatar ashwanthkumar avatar benmccann avatar cavorite avatar ch4mpy avatar dln avatar nevillelyh avatar philippus avatar przemekd avatar samschlegel avatar shishkin avatar sullis avatar timchan-lumoslabs avatar xuwei-k avatar

Watchers

 avatar

Forkers

llyjy21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.