The build.gradle file

As explained, we are creating a single service that corresponds to single distribution (either .jar or .zip) that is deployed. This single function will have different lambda functions for distinct business flows. To build and package it together, we are using Gradle and the build.gradle file of our service, which looks as follows:

apply plugin: 'java'apply plugin: 'maven'apply plugin: 'idea'group = 'com.packt.serverless.kotlin.letspoll'version = '1.0.0'description = """Lets Poll API"""sourceCompatibility = 1.8targetCompatibility = 1.8tasks.withType(JavaCompile) {  options.encoding = 'UTF-8'}buildscript {  repositories {    mavenCentral()    maven { url "https://plugins.gradle.org/m2/" }  }  dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51" ...

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.