Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
97 lines (81 loc) · 2.77 KB
/
Copy pathbuild.gradle
File metadata and controls
97 lines (81 loc) · 2.77 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
plugins {
id 'java'
id 'application'
}
group 'dev.jsheets'
version '0.1.0'
repositories {
mavenCentral()
}
sourceCompatibility = 16
targetCompatibility = 16
ext {
mongoDbDriverVersion = '4.3.2'
cfg4jVersion = '4.4.1'
slf4jVersion = '1.7.32'
javalinVersion = '4.1.1'
argsParseVersion = '0.9.0'
guiceVersion = '5.0.1'
}
dependencies {
implementation project(':protocol')
implementation project(':evaluation')
implementation project(':common')
implementation "org.apache.curator:curator-x-discovery:$curatorVersion"
implementation "io.micrometer:micrometer-core:$micrometerVersion"
implementation "io.micrometer:micrometer-registry-influx:$micrometerVersion"
implementation "org.mongodb:mongodb-driver-sync:$mongoDbDriverVersion"
implementation "org.slf4j:slf4j-simple:$slf4jVersion"
implementation "io.grpc:grpc-all:$grpcVersion"
implementation "com.google.protobuf:protobuf-java-util:$protobufJavaVersion"
implementation "net.sourceforge.argparse4j:argparse4j:$argsParseVersion"
implementation "javax.annotation:javax.annotation-api:$javaxAnnotationVersion"
implementation "com.google.flogger:flogger:$floggerVersion"
implementation "com.google.flogger:flogger-slf4j-backend:$floggerVersion"
implementation "com.google.inject:guice:$guiceVersion"
compileOnly "io.soabase.record-builder:record-builder-core:$recordBuilderVersion"
annotationProcessor "io.soabase.record-builder:record-builder-processor:$recordBuilderVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitPlatformVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitPlatformVersion"
}
test {
useJUnitPlatform()
}
mainClassName = 'jsheets.runtime.App'
task copyDependencies(type: Copy) {
from configurations.runtimeClasspath
into "$buildDir/libs"
}
private def listClassPath() {
return configurations.runtimeClasspath.collect { "libs/${it.name}" }.join(" ")
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
jar {
archiveName 'app.jar'
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes(
"Main-Class": "jsheets.runtime.App",
"Class-Path": listClassPath()
)
}
}
def dockerImageName = "ehenoma/jsheets-runtime"
def dockerImageTag = System.getenv("TARGET_IMAGE_TAG") || "latest"
def dockerImage = "$dockerImageName:$dockerImageTag"
task buildDocker(type: Exec) {
dependsOn copyDependencies, build
workingDir "$projectDir"
commandLine "docker", "build", "--rm", ".", "-t", dockerImage, "-f", "./runtime/deploy/Dockerfile"
}
task justRunDocker(type: Exec) {
workingDir "$projectDir"
commandLine "docker", "run", dockerImage, "-p", "8080:8080"
}
task runDocker(type: Exec) {
dependsOn buildDocker
workingDir "$projectDir"
commandLine "docker", "run", dockerImage, "-p", "8080:8080"
}