Module to convert avro schemas to scala classes with AvroHugger and mill build tool
File:
build.sc
// build.sc default imports
import mill._, mill.scalalib._
// This import the mill-avrohugger plugin
import $ivy.`com.chmist::com.chmist.mill.avrohugger:0.0.1`
import com.chmist.mill.avrohugger._
object project extends ScalaModule with AvroHuggerModule {
def scalaVersion = "2.12.7"
}
Use mill 0.3.6 or newer, to build the avro bundle.
$ mill project.compileAvro project.compileAvro Input files to compile: project/avro/tutorial/Person.avsc
To convert avro schemas, your module has to implement com.chmist.mill.avro.AvroHuggerModule
.
Configuration options
-
def avroHuggerVersion: T[String]
- The avrohugger version. By default it is 1.0.0-RC15 -
def avroSources: Sources
- The source folder for avro schemas. By default it isavro
.
Mill is still in active development, and has no stable API yet. Hence, not all mill-avrohugger versions work with every mill version.
The following table shows a matrix of compatible mill and mill-avrohugger versions.
mill-avrohugger | mill |
---|---|
0.0.1 |
0.3.6 |