This repository was archived by the owner on May 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathbuild.gradle
More file actions
142 lines (110 loc) · 4.57 KB
/
build.gradle
File metadata and controls
142 lines (110 loc) · 4.57 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
plugins {
id 'java'
id 'application'
id 'idea'
// Creates fat JAR
id 'com.github.johnrengelman.shadow' version '7.0.0'
// Adds dependencyUpdates task
id 'com.github.ben-manes.versions' version '0.50.0'
id 'com.vaadin' version '20.0.3'
}
distZip.enabled = shadowDistZip.enabled = false
distTar.enabled = shadowDistTar.enabled = false
// Only necessary for debugging JARs locally
mainClassName = 'com.amazonaws.greengrass.cddembeddedvaadinskeleton.vaadin.EmbeddedVaadinServer'
group = 'CDDEmbeddedVaadinSkeletonJava'
version = '1.0-SNAPSHOT'
def temp = "temp"
def tempName = "$group-$version-$temp" + ".jar"
description = """"""
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
def gradleDependencyVersion = '6.8.1'
wrapper {
gradleVersion = gradleDependencyVersion
distributionType = Wrapper.DistributionType.ALL
}
repositories {
mavenCentral()
maven { url "http://maven.vaadin.com/vaadin-addons" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://jitpack.io' }
}
// Guidance from: https://stackoverflow.com/questions/23446233/compile-jar-from-url-in-gradle
def githubJar = { organization, module, revision, name ->
File file = new File("$buildDir/libs/${name}.jar")
file.parentFile.mkdirs()
if (!file.exists()) {
def url = "https://github.com/$organization/$module/raw/v$revision/sdk/GreengrassJavaSDK.jar"
new URL(url).withInputStream { downloadStream ->
file.withOutputStream { fileOut ->
fileOut << downloadStream
}
}
}
files(file.absolutePath)
}
def cddVersion = '0.8.74'
def gsonVersion = '2.8.7'
def slf4jVersion = '2.0.0-alpha1'
def jcabiVersion = '0.19.0'
def awsSdkVersion = '1.12.8'
def jacksonVersion = '2.11.3'
def awsLambdaJavaCoreVersion = '1.2.1'
def immutablesValueVersion = '2.8.9-ea-1'
def jettyVersion = '9.4.42.v20210604'
def daggerVersion = '2.37'
def vaadinVersion = '14.1.17'
def awsGreengrassCoreSdkJava = '1.4.1'
def embeddedVaadin = '0.2.3'
dependencies {
annotationProcessor "org.immutables:value:$immutablesValueVersion"
compile "org.immutables:value:$immutablesValueVersion"
compile githubJar('aws', 'aws-greengrass-core-sdk-java', awsGreengrassCoreSdkJava, 'GreengrassJavaSDK')
compile "com.github.aws-samples:aws-greengrass-lambda-functions:$cddVersion"
// Dagger code generation
annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
// Dependency injection with Dagger
compile "com.google.dagger:dagger:$daggerVersion"
compile "com.google.code.gson:gson:$gsonVersion"
compile "org.slf4j:slf4j-log4j12:$slf4jVersion"
compile "com.jcabi:jcabi-log:$jcabiVersion"
compile "com.amazonaws:aws-java-sdk-core:$awsSdkVersion"
compile "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
compile "com.amazonaws:aws-lambda-java-core:$awsLambdaJavaCoreVersion"
implementation "com.github.timmattison:embedded-vaadin:$embeddedVaadin"
compile "org.eclipse.jetty:jetty-continuation:$jettyVersion"
compile "org.eclipse.jetty:jetty-server:$jettyVersion"
compile "org.eclipse.jetty.websocket:websocket-server:$jettyVersion"
compile "org.eclipse.jetty.websocket:javax-websocket-server-impl:$jettyVersion"
implementation enforcedPlatform("com.vaadin:vaadin-bom:$vaadinVersion")
// Vaadin 14
implementation("com.vaadin:vaadin-core") {
// Webjars are only needed when running in Vaadin 13 compatibility mode
["com.vaadin.webjar", "org.webjars.bowergithub.insites",
"org.webjars.bowergithub.polymer", "org.webjars.bowergithub.polymerelements",
"org.webjars.bowergithub.vaadin", "org.webjars.bowergithub.webcomponents"]
.forEach { group -> exclude(group: group) }
}
compile "com.vaadin:flow-server-production-mode:$vaadinVersion"
compile "javax.servlet:javax.servlet-api:4.0.1"
}
// Required to build Vaadin frontend
assemble.dependsOn vaadinBuildFrontend
// Required to stage the shadow JAR without the Greengrass library
shadowJar {
archiveClassifier = temp
}
// Required to finalize the shadow JAR with the Greengrass library
task finalizeShadowJar(type: Jar) {
archiveClassifier = "all"
from zipTree("$buildDir/libs/$tempName")
from(file("$buildDir/libs/GreengrassJavaSDK.jar")) { into('lib') }
manifest { attributes('Main-Class': mainClassName) }
}
// Required to trigger finalization of the shadow JAR
shadowJar.finalizedBy finalizeShadowJar