Creating a Kotlin Project

John Ahlroos edited this page Jul 17, 2017 · 8 revisions

The plugin supports Kotlin projects natively.

To get started first follow the Getting Started guides to download Gradle and setup the IDE.

To create a new Kotlin project you need to do the following:

  1. Create a new project with an empty build.gradle.kts
  2. In build.gradle.kts apply the needed plugins
    plugins {
        id("org.jetbrains.kotlin.jvm").version("1.1.2-2")
        id("com.devsoap.plugin.vaadin").version("1.2.0")
    }
  3. In build.gradle.kts add the compile and runtime dependency to Kotlin
    dependencies {
         compile("org.jetbrains.kotlin:kotlin-stdlib:1.1.2-2")
    }
  4. Run the vaadinCreateProject task to create a Kotlin Vaadin project.

To configure an extension property use the following syntax:

configure<VaadinPluginExtension> {
    logToConsole = true
}

The available extensions are: VaadinPluginExtension, AddonExtension, SpringBootExtension, TestBenchExtension, TestbenchHubExtension, TestBenchNodeExtension, WidgetsetCDNExtension.

To configure a task property use the following syntax:

val vaadinRun : com.devsoap.plugin.tasks.RunTask by tasks
vaadinRun.apply {
    server = "jetty"
}

The available tasks are: BuildClassPathJar, BuildJavadocJarTask, BuildSourcesJarTask, CompileThemeTask, CompileWidgetsetTask, CompressCssTask, CreateAddonProjectTask, CreateAddonThemeTask, CreateComponentTask, CreateCompositeTask, CreateDesignTask, CreateDirectoryZipTask, CreateProjectTask, CreateTestbenchTestTask, CreateThemeTask, CreateWidgetsetGeneratorTask, DevModeTask, irectorySearchTask, RunTask, SuperDevModeTask, pdateAddonStylesTask, UpdateWidgetsetTask, VersionCheckTask.

For a full list of extension and task properties see Tasks and configuration DSL.

Gradle/Kotlin Reference : https://kotlinlang.org/docs/reference/using-gradle.html

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.