November 2018
Intermediate to advanced
388 pages
9h 5m
English
Add the plugin in the buildscript dependencies section in the Gradle file:
buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version" } } apply plugin: "kotlin-noarg"
Alternatively, we can enable the no-arg plugin using Gradle as follows:
plugins { id "org.jetbrains.kotlin.plugin.noarg" version "1.2.41"}
We can then specify the list of annotations in the plugin section. The no-arg plugin generates the default constructor for the classes that are annotated with the annotations that we specified in the noArg annotation section of the plugin:
noArg { annotation("org.rao.kotlin.javaee.MyClass") }If we want to execute the initialization of member variables from the default constructor, ...
Read now
Unlock full access