Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kotlin Blueprints

You're reading from   Kotlin Blueprints A practical guide to building industry-grade web, mobile, and desktop applications in Kotlin using frameworks such as Spring Boot and Node.js

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher Packt
ISBN-13 9781788390804
Length 260 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Akshay Chordiya Akshay Chordiya
Author Profile Icon Akshay Chordiya
Akshay Chordiya
Ashish Belagali Ashish Belagali
Author Profile Icon Ashish Belagali
Ashish Belagali
Hardik Trivedi Hardik Trivedi
Author Profile Icon Hardik Trivedi
Hardik Trivedi
Arrow right icon
View More author details
Toc

Setting up the build script


We will be using the Gradle build system for our project. 

Adding Kotlin dependency

Kotlin language is added as a Gradle dependency in the project:

    // Kotlin
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"

Adding Ktor dependencies

The Ktor file is located on bintray and it has a dependency on the coroutines library available in kotlinx, so we will need to add the following repositories to the repositories block:

    maven { url "http://dl.bintray.com/kotlin/ktor" }
    maven { url "https://dl.bintray.com/kotlin/kotlinx" }

We will add an extra property for holding the value of the latest version of Ktor:

   ext.ktor_version = '0.9.0-alpha1'

Now add the ktor-core dependency in our build.gradle:

    // ktor
    compile "io.ktor:ktor:$ktor_version"

As we discussed earlier, Ktor can be deployed in various environments. For our news feed application, we will use Netty as our server by adding an extra dependency:

    compile "io.ktor:ktor-server-netty:...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime