February 2018
Intermediate to advanced
350 pages
7h 35m
English
For Gradle to work, we must have a build.gradle file. In this file, we'll set different options and settings for Gradle to use and run.
For our basic Hello World program, our file must look like this:
group 'com.packtpub'version '1.0'buildscript { ext.kotlin_version = '1.2.21' repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }}apply plugin: 'kotlin'apply plugin: 'application'mainClassName = 'com.packtpub.appendix.HelloKt'defaultTasks 'run'repositories { mavenCentral()}dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"}compileKotlin { kotlinOptions.jvmTarget = "1.8"}compileTestKotlin { kotlinOptions.jvmTarget = "1.8" ...Read now
Unlock full access