forked from cmaxwellau/tika-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
71 lines (59 loc) · 2.32 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
plugins {
id "com.github.johnrengelman.shadow" version "4.0.3"
}
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
archivesBaseName = 'tika-lambda'
sourceCompatibility = '1.8'
dependencies {
compile fileTree(dir: 'jars', include: '*.jar')
}
repositories {
mavenCentral()
}
dependencies {
def withoutX = {
exclude group:"com.amazonaws", module: "aws-java-sdk-cognitoidentity"
exclude group:"com.amazonaws", module: "aws-java-sdk-kinesis"
exclude group:"com.amazonaws", module: "aws-java-sdk-sqs"
exclude group:"com.amazonaws", module: "aws-java-sdk-sns"
exclude group:"com.amazonaws", module: "aws-java-sdk-sns"
exclude group:"com.amazonaws", module: "aws-java-sdk-dynamodb"
exclude group:"org.opengis", module: "geoapi"
exclude group:"org.aspectj", module: "aspectj"
exclude group:"org.apache.opennlp", module: "opennlp-tools"
exclude group:"com.google.guava"
exclude group:"org.apache.commons", module: "commons-vfs2"
exclude group:"org.apache.maven.scm"
exclude group:"org.apache.sis.core"
exclude group:"edu.ucar", module: "grib"
exclude group:"edu.ucar", module: "cdm"
exclude group:"org.bouncycastle", module: "bcprov-jdk15on"
exclude group:"org.bouncycastle", module: "cpkix-jdk15on"
exclude group:"com.healthmarketscience.jackcess"
exclude group:"net.sf.ehcache", module: "ehcache-core"
}
compile "com.googlecode.json-simple:json-simple:1.1.1", withoutX
compile "org.apache.tika:tika-parsers:+", withoutX
compile "com.amazonaws:aws-lambda-java-core:+", withoutX
compile "com.amazonaws:aws-lambda-java-events:+", withoutX
compile "com.amazonaws:aws-java-sdk-core:+", withoutX
compile "com.amazonaws:aws-java-sdk-s3:+", withoutX
}
task buildZip(type: Zip) {
from compileJava
from processResources
into('lib') {
from configurations.runtime
}
}
build.dependsOn buildZip
task 'package'(type: Exec) {
commandLine 'sam', 'package', '--s3-bucket', packageBucket, '--template-file', 'template.yaml', '--output-template-file', 'packaged.yaml'
}
task deploy(type: Exec) {
commandLine 'sam', 'deploy', '--template-file', 'packaged.yaml', '--stack-name', 'tika-lambda', '--capabilities', 'CAPABILITY_IAM'
}
task publish(type: Exec) {
commandLine 'sam', 'publish', '--template', 'packaged.yaml', '--region', awsRegion
}