Skip to content

Doc my Gradle - fixed

Compare
Choose a tag to compare
@pauxus pauxus released this 19 Nov 08:28
· 29 commits to master since this release

New in this rc

New Features

  • New Field Type: BUILDER: Getters are protected or private in model, but dsl methods are public
  • Compatibility with Groovy 3 and 4. KlumAST is currently still built with Groovy 2.4 (for compatibility with Jenkins). Tests are run with Groovy 3 and 4 as well.
  • Replace basic jackson transformation with a dedicated (beta) JacksonModule (see Jackson Integration)).
  • First steps for Layer3 models. (see Layer3)
  • Split model creation into distinct phases (see #156, #155,#187 and Model Phases)
  • New Phases:
    • PostTree: is run after the model is completely realized (#280
    • AutoCreate: automatic creation of null fields (#275
    • Owner: Sets owners and calls owner methods (#284)
    • AutoLink: Links fields to other fields in the model (#275
    • Defaults: sets default values (#196
    • Validate: Validation of the model
  • In addition to lifecycle methods, fields of type Closure can now be used to define model provided (instead of schema provided) lifecycle methods. These closures will be executed in their respective Lifecycle phases.
  • default implementation: by providing the attribute defaultImpl on either @DSL or @Field, one can allow the creation of non-polymorphic field methods even for interfaces and abstract types. (see Default Implementations)
  • Creator methods have been moved to a separate creator class (see #76), creator methods on the model class have been deprecated (see Migration).
  • Custom creator classes can be provided (see Factory Classes)
  • Methods of creator classes (including custom creators) are included in collection factories (see #300 and Factory Classes)
  • Creator class also supports creating templates from scripts (files or URLS) (see Templates and #322)
  • Switch annotation validation to KlumCast Framework (see #312))
  • Generate Documentation for almost all generated methods via AnnoDocimal (see #197))
  • Gradle Plugin for easier project setup

Improvements

  • Creator classes also support methods creating multiple instances at once (see #319)
  • CopyFrom now creates deep clones (see #36)
  • boolean fields are never validated (makes no sense), Boolean fields are evaluated against not null, not against Groovy Truth (i.e. the field must have an explicit value assigned) (see #223)
  • Provide @Required as an alternative to an empty @Validate annotation (see #221)
  • EnumSet fields are now supported. Note that for enum sets a copy of the underlying set is returned as opposed to a readonly instance. (see #249)
  • Converter methods are now honored for Alternatives methods as well. (see #270)
  • @Validate now can be placed on classes. This effectively replaces @Validate(option=Validation.Option.VALIDATE_UNMARKED), which is internally converted to the new format (see #276). The @Validation annotation is deprecated.
  • Sanity check: Key Fields must not have @Owner or @Field annotations.

Deprecations (see Migration):

  • The @Validation annotation is deprecated. Use @Validate on class level instead.
  • creator methods on the model class have been deprecated.
  • Breaking changes ((see Migration)
  • it is a compile error to place the @Validate annotation on a boolean field.
  • KlumAST is split into different modules, klum-ast-compile is compile-time only,
    klum-ast-runtime is needed for runtime as well. This completes
    the changes started in 1.2.0
  • In order for the serialization in jackson to work, the new klum-ast-jackson module needs to be included in the project (see Jackson Integration))))
  • The naming of virtual fields is changed, now the virtual field
    is identical to the method name (previously, the first element of the camel
    cased method name was removed).
  • methods named doValidate are no longer considered Validate methods by default.
  • Static Type Checking for Configuration Scripts does not (yet) work under Groovy 3
  • The @Validation annotation is deprecated, any use except for @Validate(option=Validation.Option.VALIDATE_UNMARKED) will have no effect.
  • Previously, only public methods were checked for illegal write access. This has been changed to include all visibilities. Protected methods that are conceptually write access methods must now also be annotated with @Mutator, otherwise a compile error is thrown.
  • The generated validate() method is now deprecated, use KlumInstanceProxy.validate() instead. This means that creating own validate methods is legal again.
  • Owner fields are now set in a later phase, meaning that they are not yet set when apply closures are resolved. This logic must be moved to a later phase (postTree), for example using lifecycle closures.
  • Default values are no longer a modification of the getter but rather explicitly set during the 'default' phase. This might result in subtle differences in the behavior, especially when using a non-template as template / target for
    copyFrom. Make sure to create template instances with Create.Template if you want to use them as templates.

##Fixes

  • since rc.32
  • since rc.31
    • Don't copy Overrides annotation to RW delegation methods (see #40)
  • since rc.13
    • Fix polymorphic virtual setters (see #250)
    • Converter methods should honor default values (see #268)
  • since rc.12
    • More fixes to nested generics (see #248)
  • since rc.11
    • Converter methods not working for maps of DSL objects (see #242)
    • Created class is invalid if field type is generic and contains generic factories (like List.of) (see #243)
    • Default delegate failed if delegate was a getter instead of a real field (see #244)
    • apply did not accept a Map only call (see #241)
  • since rc.9
    • Handling of key fields in hierarchies (see #238)
  • since rc.5
    • Visibility for creator methods was wrong (see #232)