09.04.2018 Views

tornadofx-guide

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. Setting Up<br />

Setting Up<br />

To use TornadoFX, there are several options to set up the dependency for your project.<br />

Mainstream build automation tools like Gradle and Maven are supported and should have no<br />

issues in getting set up.<br />

Please note that TornadoFX is a Kotlin library, and therefore your project needs to be<br />

configured to use Kotlin. For Gradle and Maven configurations, please refer to the Kotlin<br />

Gradle Setup and Kotlin Maven Setup <strong>guide</strong>s. Make sure your development environment or<br />

IDE is equipped to work with Kotlin and has the proper plugins and compilers.<br />

This <strong>guide</strong> will use Intellij IDEA to walk through certain examples. IDEA is the IDE of choice<br />

to work with Kotlin, although Eclipse has a plugin as well.<br />

Gradle<br />

For Gradle, you can set up the dependency directly from Maven Central. Provide the desired<br />

version number for the x.y.z placeholder.<br />

repositories {<br />

}<br />

mavenCentral()<br />

// Minimum jvmTarget of 1.8 needed since Kotlin 1.1<br />

compileKotlin {<br />

kotlinOptions.jvmTarget= 1.8<br />

}<br />

dependencies {<br />

}<br />

compile 'no.tornado:<strong>tornadofx</strong>:x.y.z'<br />

Maven<br />

To import TornadoFX with Maven, add the following dependency to your POM file. Provide<br />

the desired version number for the x.y.z placeholder.<br />

Goes into kotlin-maven-plugin block:<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!