Scalaxb v1.5.0 Release Notes

Release Date: 2017-03-10 // about 7 years ago
  • ๐Ÿ’ฅ breaking changes

    • ๐Ÿ›  Fixes name clashes in typeclass instance by prefixing full package name. #385 by @anatoliykmetyuk
    • 0๏ธโƒฃ The default value for using varargs is set to false.
    • ๐Ÿ‘€ sbt-scalaxb is now an auto plugin. See below.

    ๐Ÿ› bug fixes

    โœจ enhancements

    • โž• Adds --mutable option to generate mutable case classes. See below.
    • ๐Ÿ‘‰ Uses type attribute to convert xs:any. #389 by @anatoliykmetyuk
    • โž• Adds --autopackages option to pick package names automatically. #391 by @anatoliykmetyuk
    • โž• Adds --visitor option to generate a Visitor for traversing over the generated case classes. #392 by @anatoliykmetyuk

    sbt-scalaxb changes

    ๐Ÿ”Œ sbt-scalaxb for scalaxb 1.5.0 is changed to an auto plugin.
    Instead of adding scalaxbSettings and defining sourceGenerators in Compile,
    ๐Ÿ”Œ enable ScalaxbPlugin instead. All other setting/task keys will be prefixed with "scalaxb".
    ๐Ÿ“ฆ For example, packageName will now be called scalaxbPackageName.

    Before:

    import ScalaxbKeys._
    lazy val root = (project in file(".")).
      settings(
        name := "foo-project").
      settings(scalaxbSettings).
      settings(
        sourceGenerators in Compile += (scalaxb in Compile).taskValue,
        packageName in (Compile, scalaxb) := "generated"
        // packageNames in (Compile, scalaxb) := Map(uri("http://something/") -> "something"),
        // logLevel in (Compile, scalaxb) := Level.Debug
      )
    

    After:

    lazy val root = (project in file(".")).
      enablePlugins(ScalaxbPlugin).
      settings(
        name := "foo-project",
        scalaxbPackageName in (Compile, scalaxb) := "generated"
        // scalaxbAutoPackages in (Compile, scalaxb) := true
      )
    

    #405 by @eed3si9n

    mutable case class

    scalaxb 1.5.0 adds an option to generate mutable case classes.

    case class Address(var name: String,
      var street: String,
      var city: String)
    

    In sbt-scalaxb, this can be enabled as:

    lazy val root = (project in file(".")).
      enablePlugins(ScalaxbPlugin).
      settings(
        name := "foo-project",
        scalaxbPackageName in (Compile, scalaxb) := "generated",
        scalaxbGenerateMutable in (Compile, scalaxb) := true
      )
    

    #390 by @AndreVanDelft