-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
148 lines (119 loc) · 4.79 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
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
142
143
144
145
146
147
148
plugins {
id 'java'
id 'idea'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'org.springframework.boot' version '2.3.1.RELEASE'
id "io.freefair.lombok" version "5.1.0"
id 'net.nemerosa.versioning' version '2.12.1'
id "com.github.spotbugs" version "4.4.3"
id 'pmd'
id 'jacoco'
// https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow
// https://github.com/johnrengelman/shadow
id 'com.github.johnrengelman.shadow' version '6.0.0'
id 'nebula.lint' version '16.7.0'
}
repositories {
mavenCentral()
jcenter()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
versioning {
scm = 'git'
}
bootJar {
mainClassName = 'org.tec.lambda.Application'
manifest {
attributes(
'Built-By' : System.properties['user.name'],
'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Revision' : versioning.info.full,
'Build-Hash' : versioning.info.commit,
'Created-By' : "Gradle ${gradle.gradleVersion}",
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"
)
}
}
bootJar.dependsOn versionDisplay
spotbugs {
ignoreFailures = false
toolVersion = '4.0.6'
}
spotbugsMain {
reports {
html {
enabled = true
destination = file("$buildDir/reports/spotbugs/main/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}
pmd {
consoleOutput = true
toolVersion = '6.24.0'
ruleSets = []
ruleSetFiles = files("${rootDir}/config/pmd/ruleset.xml")
}
test {
useJUnitPlatform{
excludeTags 'skip'
}
testLogging.showStandardStreams = true
testLogging.showStackTraces = true
// Always run tests, even when nothing changed.
dependsOn 'cleanTest'
// Show test results.
testLogging {
events "passed", "skipped", "failed"
}
}
// https://stackoverflow.com/questions/20032366/running-jacocoreport
jacoco {
toolVersion = "0.8.5"
}
jacocoTestReport {
reports {
xml.enabled=false
csv.enabled=false
html.destination file("${buildDir}/reports/jacoco")
}
}
gradleLint.alwaysRun = true
pmdTest.enabled = false
spotbugsTest.enabled =false
sourceCompatibility = '1.14'
targetCompatibility = '1.14'
group 'com.outboundengine'
version = versioning.info.full
dependencies {
// datasource deps
runtimeOnly group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.6.1'
runtimeOnly group: 'org.postgresql', name: 'postgresql', version: '42.2.14'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.12'
// logging
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
// spring boot stuff
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: "$SPRING_BOOT_VERSION"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: "$SPRING_BOOT_VERSION"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-cache', version: "$SPRING_BOOT_VERSION"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: "$SPRING_BOOT_VERSION"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-mongodb', version: "$SPRING_BOOT_VERSION"
// encrypt secrets in config files
// https://medium.com/@sun30nil/how-to-secure-secrets-and-passwords-in-springboot-90c952961d9
//java -cp ~/bin/jasypt-1.9.3.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input=<val to encrypt> password=oe-dev-key algorithm=PBEWITHMD5ANDDES
//implementation group: 'com.github.ulisesbocchio', name: 'jasypt-spring-boot-starter', version: '3.0.2'
// java lint
compileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: '4.0.6'
// unit testing
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "$JUNIT_VERSION"
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "$JUNIT_VERSION"
// mock
testImplementation group: 'org.mockito', name: 'mockito-core', version: "$MOCKITO_VERSION"
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "$MOCKITO_VERSION"
// sprng test
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: "$SPRING_BOOT_VERSION"
}