Skip to content

Latest commit

 

History

History
277 lines (258 loc) · 7.22 KB

migration_6.adoc

File metadata and controls

277 lines (258 loc) · 7.22 KB

Migration guide from 5.0 to 6.0

Default options are removed from the extension

Previously, it was possible to define default options for all executions. Now it’s mandatory to define all options for every execution.

Configuration options for each execution were split into categories

With plugin version 6.0 configuration options were moved into sub-categories. Additionally, some of them were renamed as category has context. Documentation and meaning for these configuration options is still the same.

An execution configuration now contains following categories.

Table 1. Execution configuration categories
Category name Meaning

io

These options tell which files to read and what encoding to produce.

klass

General class generation options.

constructors

Options define how given class can be instantiated.

methods

Options to define which methods are created and which annotations are used.

fields

Options to define field type mapping (except date and time objects).

dateTime

Options to define date and time field generation and serialization.

Option renames and placing into categories

Category Original Source Option New option name (if changed)

io

fileExtensions

fileFilter

propertyWordDelimiters

delimitersPropertyWord

outputEncoding

source

sourceType

sourceSortOrder

targetVersion

targetJavaVersion

refFragmentPathDelimiters

delimitersRefFragmentPath

klass

annotationStyle

classNamePrefix

namePrefix

classNameSuffix

nameSuffix

customAnnotator

customAnnotatorClass

customRuleFactory

customRuleFactoryClass

includeGeneratedAnnotation

annotateGenerated

includeTypeInfo

jackson2IncludeTypeInfo

inclusionLevel

jackson2InclusionLevel

parcelable

androidParcelable

serializable

annotateSerializable

targetPackage

useTitleAsClassname

nameUseTitle

constructors

includeAllPropertiesConstructor

allProperties

includeConstructorPropertiesAnnotation

annotateConstructorProperties

includeCopyConstructor

copyConstructor

includeRequiredPropertiesConstructor

requiredProperties

methods

generateBuilders

builders

includeAdditionalProperties

additionalProperties

includeDynamicBuilders

buildersDynamic

includeDynamicGetters

gettersDynamic

includeDynamicSetters

settersDynamic

includeGetters

getters

includeHashcodeAndEquals

hashcodeAndEquals

includeJsr303Annotations

annotateJsr303

includeJsr305Annotations

annotateJsr305

includeSetters

setters

includeToString

toStringMethod

toStringExcludes

useInnerClassBuilders

buildersInnerClass

useJakartaValidation

annotateJsr303Jakarta

useOptionalForGetters

gettersUseOptional

fields

formatTypeMapping

formatToTypeMapping

initializeCollections

useBigDecimals

floatUseBigDecimal

useBigIntegers

integerUseBigInteger

useDoubleNumbers

floatUseDouble

useLongIntegers

integerUseLong

usePrimitives

dateTime

customDatePattern

datePattern

customDateTimePattern

dateTimePattern

customTimePattern

timePattern

dateTimeType

dateType

formatDateTimes

dateTimeFormat

formatDates

dateFormat

formatTimes

timeFormat

timeType

useJodaDates

jodaDate

useJodaLocalDates

jodaLocalDate

useJodaLocalTimes

jodaLocalTime

Options removed

Table 2. Removed parameters and options
Name Notes

removeOldOutput

Became uncontrollable by a user in favor for Gradle to handle generated files.

constructorsRequiredPropertiesOnly

Can be replaced with turning off generation of any constructors except requiredProperties. Was deprecated for a while in the underlying library.

includeConstructors

This option will be turned on if any constructor generation option is turned on.

includeDynamicAccessors

This option will be turned on if any dynamic accessor generation option is turned on.

Additional configurations to setup processor dependencies

To set up additional processor dependencies it’s needed to add a dependency into jsonschema2dataclassPlugins configuration.

This could be needed for the processor to resolve:

  • Resources referenced by classpath

  • Additional types not present in standard library and direct dependencies of the processor

  • Custom RuleFactory or an Annotator for the processor

Demos are using current version of plugin.

Since version 6.0 all demos are using current version of plugin to build. They were made with a thought to be re-usable and show real-world scenarios of plugin usage.

AGP 4 demo is removed

AGP 4 is a quite old technology, I can’t find a living open-source Android application using AGP 4.