1 /* 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile 18 <lambda>null19plugins { kotlin("jvm") version "1.5.0" } 20 <lambda>null21repositories { 22 mavenLocal() 23 mavenCentral() 24 } 25 26 val ktfmtVersion = rootProject.file("../version.txt").readText().trim() 27 <lambda>null28dependencies { 29 implementation("com.facebook:ktfmt:$ktfmtVersion") 30 implementation(platform("software.amazon.awssdk:bom:2.10.73")) 31 implementation("software.amazon.awssdk:lambda") 32 implementation("com.amazonaws:aws-lambda-java-core:1.2.1") 33 implementation("com.amazonaws:aws-lambda-java-events:2.2.9") 34 implementation("com.google.code.gson:gson:2.8.6") 35 testImplementation(kotlin("test-junit")) 36 } 37 <lambda>null38tasks { 39 test { useJUnit() } 40 41 withType<KotlinCompile>() { kotlinOptions.jvmTarget = "11" } 42 43 val packageFat by 44 creating(Zip::class) { 45 from(compileKotlin) 46 from(processResources) 47 into("lib") { from(configurations.runtimeClasspath) } 48 dirMode = 0b111101101 // 0755 49 fileMode = 0b111101101 // 0755 50 } 51 52 val packageLibs by 53 creating(Zip::class) { 54 into("java/lib") { from(configurations.runtimeClasspath) } 55 dirMode = 0b111101101 // 0755 56 fileMode = 0b111101101 // 0755 57 } 58 59 val packageSkinny by 60 creating(Zip::class) { 61 from(compileKotlin) 62 from(processResources) 63 } 64 65 build { dependsOn(packageSkinny) } 66 } 67