-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
93 lines (80 loc) · 2.75 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
plugins {
id "io.spring.dependency-management" version "1.0.6.RELEASE"
id "com.github.johnrengelman.shadow" version "4.0.2"
id "jp.classmethod.aws.lambda" version "0.38"
id "java"
id "net.ltgt.apt-eclipse" version "0.21"
id "net.ltgt.apt-idea" version "0.21"
id "application"
}
version "0.1"
group "com.kiakora"
repositories {
mavenCentral()
maven { url "https://jcenter.bintray.com" }
}
dependencyManagement {
imports {
mavenBom 'io.micronaut:micronaut-bom:1.1.0'
}
}
configurations {
// for dependencies that are needed for development only
developmentOnly
}
dependencies {
annotationProcessor "io.micronaut:micronaut-inject-java"
annotationProcessor "io.micronaut:micronaut-validation"
compile "io.micronaut:micronaut-inject"
compile "io.micronaut:micronaut-validation"
compile "io.micronaut:micronaut-runtime"
compile "io.micronaut:micronaut-function-aws"
runtime "ch.qos.logback:logback-classic:1.2.3"
runtime "com.amazonaws:aws-lambda-java-log4j2:1.0.0"
runtime "org.apache.logging.log4j:log4j-slf4j-impl:2.9.1"
testAnnotationProcessor "io.micronaut:micronaut-inject-java"
testCompile "org.junit.jupiter:junit-jupiter-api"
testCompile "io.micronaut.test:micronaut-test-junit5"
testCompile "io.micronaut:micronaut-function-client"
testCompile "io.micronaut:micronaut-inject-java"
testRuntime "org.junit.jupiter:junit-jupiter-engine"
testRuntime "io.micronaut:micronaut-http-server-netty"
testRuntime "io.micronaut:micronaut-function-web"
}
test.classpath += configurations.developmentOnly
shadowJar {
transform(com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer)
mergeServiceFiles()
}
// use JUnit 5 platform
test {
useJUnitPlatform()
}
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
options.compilerArgs.add('-parameters')
}
run.classpath += configurations.developmentOnly
run.jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
mainClassName = "com.kiakora.KuantoRentaFunction"
applicationDefaultJvmArgs = [""]
jar {
manifest {
attributes 'Main-Class': mainClassName
}
}
aws {
profileName = "kiakora"
region = "eu-west-3"
}
if(new File("${System.getProperty("user.home")}/.aws/credentials").exists()) {
task deploy(type: jp.classmethod.aws.gradle.lambda.AWSLambdaMigrateFunctionTask, dependsOn: shadowJar) {
functionName = "kuanto-renta"
handler = "com.kiakora.KuantoRentaFunction::apply"
role = "arn:aws:iam::${aws.accountId}:role/lambda-basic-role"
runtime = com.amazonaws.services.lambda.model.Runtime.Java8
zipFile = shadowJar.archivePath
memorySize = 256
timeout = 30
}
}