-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
106 lines (92 loc) · 2.84 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
apply plugin: 'liquibase'
// build params
ext {
dbUrl = project.hasProperty('db.url') ? project.getProperty('db.url') : 'jdbc:oracle:thin:@10.10.10.10:1521:XE'
dbUser = project.hasProperty('db.user') ? project.getProperty('db.user') : 'koultarj'
dbPasswd = project.hasProperty('db.passwd') ? project.getProperty('db.passwd') : 'koultarj'
apiEndpoint = project.hasProperty('api.endpoint') ? project.getProperty('api.endpoint') : "http://10.10.10.10:8080"
}
liquibase {
activities {
main {
changeLogFile 'koulutustarjonta-common/src/main/resources/migrations.xml'
url project.dbUrl
username project.dbUser
password project.dbPasswd
}
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.saliman:gradle-liquibase-plugin:1.0.0'
classpath files("lib/ojdbc7.jar")
}
}
subprojects {
apply plugin: 'java'
sourceCompatibility = '1.8'
group = 'fi.helsinki.koulutustarjonta'
version = commitHash()
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
ext {
dropwizardVersion = '0.7.0'
sundialVersion = '1.1.3'
junitVersion = '4.11'
mockitoVersion = '1.9.5'
modelmapperVersion = '0.7.1'
stringtemplateVersion = '3.2.1'
lombokVersion = '1.14.4'
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.netflix.nebula:gradle-ospackage-plugin:1.9.1'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.1.0'
}
}
repositories {
mavenCentral()
}
dependencies {
compile "org.projectlombok:lombok:$lombokVersion"
}
test {
testLogging {
exceptionFormat = 'full'
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
}
}
def commitHash() {
def env = System.getenv()
def hash = env['GIT_COMMIT']
println("Jenkins git commit hash environment variable: " + hash)
if (hash == null) {
println("git commit jenkins variable not found, resolving commit from git HEAD")
def cmd = "git rev-parse --short HEAD"
try {
def proc = cmd.execute()
hash = proc.text.trim()
}
catch (Exception e) {
println("Could not execute git command, couldn't resolve hash")
hash = "noversion";
}
} else {
hash = hash[0..6]
}
hash
}