cuba-platform / documentation

CUBA Platform Documentation
https://www.cuba-platform.com
Creative Commons Attribution 4.0 International
26 stars 45 forks source link

Describe how to add kotlin support for existing java project #614

Closed alexander-shustanov closed 4 years ago

alexander-shustanov commented 4 years ago
  1. Update the project version to 7.2+.
  2. Open build.gradle
  3. In buildScript section add ext.kotlinVersion = '1.3.41' line.
  4. In buildScript -> dependencies subsection add following lines:
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    classpath "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
  5. Before cuba section add apply(plugin: 'org.jetbrains.kotlin.jvm') line.
  6. Find configure([globalModule, coreModule, webModule]) section. It may contain more modules.
  7. After apply(plugin: 'cuba') line add following: apply(plugin: 'org.jetbrains.kotlin.jvm').
  8. In dependencies subsections add:
    compile("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
    compile("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")