This repository has been archived by the owner on Apr 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
99 lines (88 loc) · 3.1 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
buildscript {
ext {
kotlinVersion = '1.1.61'
springBootVersion = '1.5.8.RELEASE'
powerMockVersion = '1.6.6'
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-noarg:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
classpath 'se.transmode.gradle:gradle-docker:1.2'
}
}
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'kotlin-jpa'
apply plugin: 'org.springframework.boot'
apply plugin: 'jacoco'
apply plugin: 'docker'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'jogy'
allprojects {
String buildNumber = System.env.TRAVIS_BUILD_NUMBER
if (buildNumber) {
project.version = '0.2.' + buildNumber
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
repositories {
mavenCentral()
}
test {
testLogging {
events "passed", "skipped", "failed"
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
dependencies {
compile("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
compile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("com.fasterxml.jackson.datatype:jackson-datatype-hibernate5")
compile("com.fasterxml.jackson.module:jackson-module-kotlin")
compile("org.apache.commons:commons-lang3:3.4")
compile project("legacy")
runtime('com.h2database:h2')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile("org.powermock:powermock-module-junit4:${powerMockVersion}")
testCompile("org.powermock:powermock-api-mockito:${powerMockVersion}")
}
build.dependsOn('legacy:build')
task buildFE(type: Copy, dependsOn: 'front-end:build') {
description 'Builds the front-end.'
from 'front-end/dist/prod'
into 'build/resources/main/static'
}
processResources.dependsOn buildFE
build.dependsOn jacocoTestReport
task buildDocker(type: Docker, dependsOn: build) {
push = true
applicationName = jar.baseName
baseImage "adoptopenjdk/openjdk8"
volume '/tmp'
addFile {
from jar
rename { 'app.jar' }
}
runCommand 'sh -c "touch /app.jar"'
entryPoint(["sh", "-c", 'java -jar /app.jar'])
}