-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
85 lines (61 loc) · 2.47 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
plugins {
id 'java'
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
version = '2.3.3'
dependencies {
// Logging
implementation 'org.apache.logging.log4j:log4j-api:2.19.0'
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.19.0'
// HTTP Framework
implementation 'io.javalin:javalin:3.6.0'
implementation 'org.freemarker:freemarker:2.3.31'
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
// JSON Mapping/Marshalling
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.6'
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.6'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.6'
// Database
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.0.6'
implementation 'org.flywaydb:flyway-core:8.2.0'
implementation 'com.zaxxer:HikariCP:5.0.1'
// MISC
implementation 'org.apache.commons:commons-lang3:3.12.0'
// Unit Testing
testImplementation 'junit:junit:4.11'
testImplementation 'org.mockito:mockito-core:4.8.0'
}
jar {
manifest {
attributes "Main-Class": "io.linuxserver.fleet.core.Main"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
exclude 'META-INF/INDEX.LIST', 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
task configureLogConfiguration(type: Copy) {
def logFile = project.hasProperty('env') ? "${env}" : 'local'
from "config/log4j2.${logFile}.xml"
into 'src/main/resources'
rename "log4j2.${logFile}.xml", 'log4j2.xml'
}
task buildVersionProperties() {
doFirst {
def versionProperties = new Properties()
def propFile = new File("src/main/resources/version.properties")
versionProperties.load(propFile.newDataInputStream());
versionProperties.setProperty("app.version", project.version.toString())
versionProperties.setProperty("app.build.user", System.getProperty("user.name"))
versionProperties.setProperty("app.build.date", new Date().format("yyyy-MM-dd'T'HH:mm:ss"))
versionProperties.setProperty("app.build.os", System.getProperty("os.name"))
versionProperties.store(propFile.newWriter(), null)
}
}
processResources.dependsOn configureLogConfiguration, buildVersionProperties