Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
100 lines (84 loc) · 2.59 KB
/
Copy pathbuild.gradle
File metadata and controls
100 lines (84 loc) · 2.59 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
plugins {
id 'java'
id 'application'
}
group 'dev.jsheets'
version '0.1.0'
repositories {
mavenCentral()
}
sourceCompatibility = 16
targetCompatibility = 16
ext {
mongoDbDriverVersion = '4.3.0'
cfg4jVersion = '4.4.1'
slf4jVersion = '1.7.32'
javalinVersion = '4.0.0'
argsParseVersion = '0.9.0'
javaxAnnotationVersion = '1.3.2'
guiceVersion = '5.0.1'
}
dependencies {
implementation project(':protocol')
implementation project(':runtime')
implementation "io.micrometer:micrometer-core:$micrometerVersion"
implementation "org.mongodb:mongodb-driver-sync:$mongoDbDriverVersion"
implementation "org.cfg4j:cfg4j-core:$cfg4jVersion"
implementation "io.javalin:javalin:$javalinVersion"
implementation "org.slf4j:slf4j-simple:$slf4jVersion"
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"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitPlatformVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitPlatformVersion"
}
test {
useJUnitPlatform()
}
mainClassName = 'jsheets.server.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
from ('../website/build/') {
into 'static'
}
}
jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveName 'app.jar'
from ('../website/build/') {
into 'static'
}
manifest {
attributes(
"Main-Class": "jsheets.server.App",
"Class-Path": listClassPath()
)
}
}
def dockerImageName = "ehenoma/jsheets"
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", "./server/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"
}