-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·100 lines (77 loc) · 3.02 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
plugins {
id 'io.franzbecker.gradle-lombok' version '1.8'
}
group 'edu.sdsu.its'
version '1.0'
final def versionCode = "${project.version}"
final def buildCode = "${buildNumber()}"
apply plugin: 'java'
apply plugin: 'war'
repositories {
mavenCentral()
jcenter()
}
war {
archiveName 'ms-monitor.war'
}
lombok {
sha256 = "" // skip verify Lombok task
}
dependencies {
// Logging
compile group: 'log4j', name: 'log4j', version: '1.2.17'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
// WebServer
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.0.1'
compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-servlet', version: '2.25.1'
compile group: 'org.glassfish.jersey.media', name: 'jersey-media-sse', version: '2.25.1'
compile group: 'org.glassfish.jersey.bundles.repackaged', name: 'jersey-guava', version: '2.25.1'
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
// DB
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.43'
compile group: 'org.hibernate', name: 'hibernate-core', version: '5.2.10.Final'
// Web Requests (Outbound)
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.1'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
// Twig
compile "org.jtwig:jtwig-web:5.86.0.RELEASE"
// Vault
compile group: 'com.mashape.unirest', name: 'unirest-java', version: '1.4.9'
// Email and Reporting
compile group: 'org.apache.commons', name: 'commons-email', version: '1.4'
// Scheduler
compile group: 'org.quartz-scheduler', name: 'quartz', version: '2.2.3'
// Password Hashing
compile group: 'org.jasypt', name: 'jasypt', version: '1.9.2'
// Commons
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile group: 'com.google.guava', name: 'guava', version: '22.0'
// Unit Tests
testCompile group: 'junit', name: 'junit', version: '4.11'
}
static def buildNumber() {
return Long.toString(System.currentTimeMillis(), 36).toUpperCase()
}
static def getHost() {
return InetAddress.getLocalHost().getHostName()
}
def makeBuildInfoFile(versionCode, buildCode) {
println 'Saving Build Info to src/main/resources/build_info.properties'
def configFile = new File('src/main/resources/build_info.properties')
def config = new Properties()
config.setProperty("version", versionCode as String)
config.setProperty("build", buildCode as String)
config.setProperty("time", "${ZonedDateTime.now().format(DateTimeFormatter.ISO_INSTANT)}")
config.setProperty("host", getHost())
config.setProperty("user", "${System.getProperty("user.name")}")
config.store(new FileOutputStream(configFile), null)
}
clean.doLast {
// Delete Build Info File
new File('src/main/resources/build_info.properties').delete()
}
processResources.doFirst {
makeBuildInfoFile(versionCode, buildCode)
}