import Ġorg . jetbrains . kotlin . gradle . tasks . Kotlin Compile Ċ Ċ val Ġkotlin Version : ĠString Ġby ĠSystem . getProperties () Ċ val Ġarrow Version : ĠString Ġby ĠSystem . getProperties () Ċ val Ġpolicy : ĠString Ġby ĠSystem . getProperties () Ċ val ĠL AMBDA _ K OT LIN _ VERSION : ĠString Ġby ĠSystem . getProperties () Ċ Ċ group Ġ= Ġ" com . compiler . server " Ċ version Ġ= Ġ"$ kotlin Version - SNAPSHOT " Ċ java . source Compatibility Ġ= ĠJava Version . VERSION _ 1 _ 8 Ċ Ċ val Ġkotlin Dependency : ĠConfiguration Ġby Ġconfigurations . creating Ġ{ ĊĠĠĠ Ġis Trans itive Ġ= Ġfalse Ċ } Ċ val Ġarrow Dependency : ĠConfiguration Ġby Ġconfigurations . creating Ġ{ ĊĠĠĠ Ġis Trans itive Ġ= Ġtrue Ċ } Ċ val Ġlib JVM Folder Ġ= Ġkotlin Version Ċ val Ġproperty File Ġ= Ġ" application . properties " Ċ Ċ val Ġcopy Dependencies Ġby Ġtasks . creating ( Copy :: class ) Ġ{ ĊĠĠĠ Ġfrom ( kotlin Dependency ) ĊĠĠĠ Ġinto ( lib JVM Folder ) Ċ } Ċ Ċ val Ġcopy Arrow Dependencies Ġby Ġtasks . creating ( Copy :: class ) Ġ{ ĊĠĠĠ Ġfrom ( arrow Dependency ) ĊĠĠĠ Ġinto ( lib JVM Folder ) Ċ } Ċ Ċ plugins Ġ{ ĊĠĠĠ Ġid (" org . springframework . boot ") Ġversion Ġ" 2 . 3 . 3 . RELEASE " ĊĠĠĠ Ġid (" io . spring . dependency - management ") Ġversion Ġ" 1 . 0 . 1 0 . RELEASE " ĊĠĠĠ Ġkotlin (" jvm ") Ġversion ĠSystem . getProperty (" L AMBDA _ K OT LIN _ VERSION ") ĊĠĠĠ Ġkotlin (" plugin . spring ") Ġversion ĠSystem . getProperty (" L AMBDA _ K OT LIN _ VERSION ") Ċ } Ċ Ċ all projects Ġ{ ĊĠĠĠ Ġrepositories Ġ{ ĊĠĠĠĠĠĠĠ Ġmaven Central () ĊĠĠĠĠĠĠĠ Ġmaven (" https :// cache - redirect or . jetbrains . com / kotlin . bin tray . com / kotlin - plugin ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġafter Evaluate Ġ{ ĊĠĠĠĠĠĠĠ Ġdependencies Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġimplementation (" com . fasterxml . jackson . module : jackson - module - kotlin : 2 . 1 0 . 3 ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ repositories Ġ{ ĊĠĠĠ Ġmaven (" https :// oss . jfrog . org / art ifactory / oss - snapshot - local /") Ċ } Ċ Ċ dependencies Ġ{ ĊĠĠĠ Ġkotlin Dependency (" com . fasterxml . jackson . core : jackson - databind : 2 . 1 0 . 0 ") ĊĠĠĠ Ġkotlin Dependency (" com . fasterxml . jackson . core : jackson - core : 2 . 1 0 . 0 ") ĊĠĠĠ Ġkotlin Dependency (" com . fasterxml . jackson . core : jackson - annotations : 2 . 1 0 . 0 ") ĊĠĠĠ Ġ// ĠKotlin Ġlibraries ĊĠĠĠ Ġkotlin Dependency (" org . jetbrains . kotlin : kotlin - stdlib - jdk 8 :$ kotlin Version ") ĊĠĠĠ Ġkotlin Dependency (" org . jetbrains . kotlin : kotlin - stdlib - jdk 7 :$ kotlin Version ") ĊĠĠĠ Ġkotlin Dependency (" org . jetbrains . kotlin : kotlin - stdlib :$ kotlin Version ") ĊĊĠĠĠ Ġannotation Processor (" org . springframework : spring - context - indexer ") ĊĠĠĠ Ġimplementation (" org . springframework . boot : spring - boot - starter - web ") Ġ{ ĊĠĠĠĠĠĠĠ Ġexclude ( group = Ġ" org . springframework . boot ", Ġmodule =" spring - boot - starter - tomcat ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġruntime Only (" org . springframework . boot : spring - boot - starter - under tow ") ĊĠĠĠ Ġimplementation (" com . amazonaws . serverless : aws - serverless - java - container - spring boot 2 : 1 . 5 . 1 ") ĊĠĠĠ Ġcompile Only (" org . jetbrains . kotlin : kotlin - stdlib :$ L AMBDA _ K OT LIN _ VERSION ") ĊĠĠĠ Ġimplementation (" org . jetbrains . kotlin : kotlin - compiler :$ L AMBDA _ K OT LIN _ VERSION ") ĊĠĠĠ Ġimplementation ( project (": exec utors ", Ġconfiguration Ġ= Ġ" default ")) ĊĊĠĠĠ Ġtest Implementation (" junit : junit : 4 . 1 2 ") ĊĠĠĠ Ġtest Implementation (" org . jetbrains . kotlin : kotlin - test :$ L AMBDA _ K OT LIN _ VERSION ") ĊĠĠĠ Ġtest Implementation (" org . springframework . boot : spring - boot - starter - test ") Ġ{ ĊĠĠĠĠĠĠĠ Ġexclude ( group Ġ= Ġ" org . junit . vint age ", Ġmodule Ġ= Ġ" junit - vint age - engine ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġtest Implementation (" org . jetbrains . kotlin x : kotlin x - coroutines - test : 1 . 3 . 8 ") ĊĊĠĠĠ Ġ// ĠArrow ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - annotations :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - a ql :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - continu ations :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - core :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - core - data :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - core - ret rofit :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - free :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - free - data :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - fx :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - fx - coroutines :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - fx - coroutines - kotlin x - coroutines :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - fx - kotlin x - coroutines :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - fx - mt l :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - fx - reactor :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - fx - rx 2 :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - generic :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - integrations - ret rofit - adapter :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - kin ded j :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - mt l :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - mt l - data :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - opt ics :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - opt ics - mt l :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - recursion :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - recursion - data :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - reflect :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - syntax :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - ui :$ arrow Version ") ĊĠĠĠ Ġarrow Dependency (" io . arrow - kt : arrow - ui - data :$ arrow Version ") ĊĠĠĠ Ġ// Ġarrow Dependency (" io . arrow - kt : arrow - validation :$ arrow Version ") ĊĊĠĠĠ Ġ// ĠFor Ġbuild Lambda ĊĠĠĠ Ġimplementation (" com . amazonaws : aws - lambda - java - core : 1 . 2 . 1 ") ĊĠĠĠ Ġimplementation (" com . amazonaws : aws - lambda - java - events : 3 . 1 . 0 ") ĊĠĠĠ Ġruntime Only (" com . amazonaws : aws - lambda - java - log 4 j 2 : 1 . 2 . 0 ") Ċ } Ċ Ċ fun Ġbuild Property File () Ġ{ ĊĠĠĠ Ġroot Dir . resolve (" src / main / resources /${ property File } "). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" Generate Ġproperties Ġinto Ġ$ absolute Path ") ĊĠĠĠĠĠĠĠ Ġparent File . mkdir s () ĊĠĠĠĠĠĠĠ Ġwrite Text ( generate Properties ()) ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġgenerate Properties ( prefix : ĠString Ġ= Ġ"") Ġ= Ġ""" ĊĠĠĠ Ġ# Ġthis Ġfile Ġis Ġautogenerated Ġby Ġbuild . gradle . k ts ĊĠĠĠ Ġkotlin . version =${ kotlin Version } ĊĠĠĠ Ġpolicy . file =${ prefix Ġ+ Ġpolicy } ĊĠĠĠ Ġlibraries . folder . jvm =${ prefix Ġ+ Ġlib JVM Folder } ĊĠĠĠ Ġarrow . version =${ arrow Version } Ċ """. trim Indent () Ċ Ċ tasks . with Type < Kotlin Compile > Ġ{ ĊĠĠĠ Ġkotlin Options Ġ{ ĊĠĠĠĠĠĠĠ Ġfree Compiler Args Ġ= ĠlistOf ("- X js r 3 0 5 = strict ", Ġ"- X skip - metadata - version - check ") ĊĠĠĠĠĠĠĠ Ġj vm Target Ġ= Ġ" 1 . 8 " ĊĠĠĠ Ġ} ĊĠĠĠ Ġdepends On ( copy Dependencies ) ĊĠĠĠ Ġdepends On ( copy Arrow Dependencies ) ĊĠĠĠ Ġdepends On (": exec utors : jar ") ĊĠĠĠ Ġbuild Property File () Ċ } Ċ Ċ val Ġbuild Lambda Ġby Ġtasks . creating ( Zip :: class ) Ġ{ ĊĠĠĠ Ġarchive Base Name . set (" playground - server ") ĊĠĠĠ Ġarchive Version . set ("$ arrow Version ") ĊĠĠĠ Ġdestination Directory . set ( file (" lambda Dist ributions ")) ĊĊĠĠĠ Ġval Ġlambda Work DirectoryPath Ġ= Ġ"/ var / task /" ĊĠĠĠ Ġfrom ( tasks . compile Kotlin ) ĊĠĠĠ Ġfrom ( tasks . process Resources ) Ġ{ ĊĠĠĠĠĠĠĠ Ġeach File Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( name Ġ== Ġproperty File ) Ġ{ Ġfile . write Text ( generate Properties ( lambda Work DirectoryPath )) Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġfrom ( policy ) ĊĠĠĠ Ġfrom ( lib JVM Folder ) Ġ{ Ġinto ( lib JVM Folder ) Ġ} ĊĠĠĠ Ġinto (" lib ") Ġ{ ĊĠĠĠĠĠĠĠ Ġfrom ( configurations . runtime Classpath ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ tasks . with Type < Test > Ġ{ ĊĠĠĠ Ġuse JUnit Platform () Ċ } Ċ Ċ tasks . clean Ġ{ ĊĠĠĠ Ġdelete ( lib JVM Folder ) Ċ } Ċ