- Kotlin for Enterprise Applications using Java EE
- Raghavendra Rao K
- 127字
- 2021-06-10 18:49:30
Using the no-org plugin in Gradle
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, we can use the invokeInitializers plugin option:
noArg {
invokeInitializers = true
}
推薦閱讀
- Python科學(xué)計(jì)算(第2版)
- Practical UX Design
- 信息可視化的藝術(shù):信息可視化在英國(guó)
- Raspberry Pi Networking Cookbook(Second Edition)
- Java設(shè)計(jì)模式及實(shí)踐
- Building an RPG with Unity 2018
- 區(qū)塊鏈底層設(shè)計(jì)Java實(shí)戰(zhàn)
- Extending Puppet(Second Edition)
- Visual Basic程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)(第二版)
- 用案例學(xué)Java Web整合開(kāi)發(fā)
- Red Hat Enterprise Linux Troubleshooting Guide
- Cocos2d-x by Example:Beginner's Guide(Second Edition)
- Django 5企業(yè)級(jí)Web應(yīng)用開(kāi)發(fā)實(shí)戰(zhàn)(視頻教學(xué)版)
- 從零開(kāi)始學(xué)UI:概念解析、實(shí)戰(zhàn)提高、突破規(guī)則
- Using Yocto Project with BeagleBone Black