-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
190 lines (148 loc) · 6.23 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.4.RELEASE")
classpath "se.transmode.gradle:gradle-docker:1.2"
}
}
plugins {
id "nebula.os-package" version "2.2.6"
//id 'com.github.sherter.google-java-format' version '0.6'
id "com.google.protobuf" version "0.8.4"
}
group 'io.elastest.epm'
repositories {
mavenCentral()
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'docker'
apply plugin: 'jacoco'
apply plugin: 'com.google.protobuf'
repositories {
mavenCentral()
}
project.ext {
/**
* Application Related Version
*/
springVersion = '4.3.9.RELEASE'
springBootVersion = '1.5.4.RELEASE'
springFoxVersion = '2.7.0'
grpcVersion = "1.6.1"
/**
* Application Related Version
*/
applicationDate = new Date()
applicationVersion = version
applicationVersionDebian = "1";
applicationVersionFull = "${applicationVersion}"
}
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter-websocket', version: springBootVersion
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: springBootVersion
// https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.11.4.RELEASE'
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
compile group: 'mysql', name: 'mysql-connector-java', version: '6.0.6'
// https://mvnrepository.com/artifact/org.hsqldb/hsqldb
compile group: 'org.hsqldb', name: 'hsqldb', version: '2.3.2'
// compile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.0.3'
compile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '1.6.2'
compile 'com.google.code.gson:gson:2.8.0'
// https://mvnrepository.com/artifact/io.springfox/springfox-swagger2
compile group: 'io.springfox', name: 'springfox-swagger2', version: springFoxVersion
// https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: springFoxVersion
// https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.11.4.RELEASE'
// https://mvnrepository.com/artifact/joda-time/joda-time
compile group: 'joda-time', name: 'joda-time', version: '2.9.9'
// https://mvnrepository.com/artifact/com.github.docker-java/docker-java
compile group: 'com.github.docker-java', name: 'docker-java', version: '3.0.12'
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
compile group: 'org.yaml', name: 'snakeyaml', version: '1.17'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.0'
// https://mvnrepository.com/artifact/org.kamranzafar/jtar
compile group: 'org.kamranzafar', name: 'jtar', version: '2.3'
// https://mvnrepository.com/artifact/io.grpc/grpc-stub
compile group: 'io.grpc', name: 'grpc-stub', version: grpcVersion
// https://mvnrepository.com/artifact/io.grpc/grpc-protobuf
compile group: 'io.grpc', name: 'grpc-netty', version: grpcVersion
// https://mvnrepository.com/artifact/io.grpc/grpc-protobuf
compile group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
compile group: 'org.yaml', name: 'snakeyaml', version: '1.19'
// https://mvnrepository.com/artifact/com.jcraft/jsch
compile group: 'com.jcraft', name: 'jsch', version: '0.1.54'
compile group: 'org.pacesys', name: 'openstack4j', version: '3.2.0'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
// https://mvnrepository.com/artifact/org.mockito/mockito-all
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
// https://mvnrepository.com/artifact/org.springframework/spring-test
testCompile group: 'org.springframework', name: 'spring-test', version: '4.3.9.RELEASE'
// https://mvnrepository.com/artifact/junit/junit
testCompile group: 'junit', name: 'junit', version: '4.12'
// https://mvnrepository.com/artifact/org.powermock/powermock-mockito-release-full
testCompile group: 'org.powermock', name: 'powermock-mockito-release-full', version: '1.6.4'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '1.5.4.RELEASE'
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.1.0'
}
generateProtoTasks {
all().each { task ->
task.enabled = project.hasProperty('runProtobuf')
task.builtins {
java {
outputSubDir = 'generated-protobuf'
}
}
}
}
generatedFilesBaseDir = "${projectDir}/src/"
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/generated-protobuf/*',
'*.class',
'**/api/*',
'**/pop/*'])
})
}
}
bootRepackage {
mainClass = 'io.elastest.epm.main.Application'
}
task buildDocker(type: Docker) {
dockerfile = 'docker/elastest-platform-manager/Dockerfile'
addFile {
from jar
}
tag = 'elastest/elastest-platform-manager'
}
task buildDockerFromScratch(type: Docker) {
baseImage = 'openjdk:8-jre-alpine'
push = project.hasProperty('push')
tag = 'elastest/elastest-platform-manager'
addFile {
from jar
rename {'epm.jar'}
}
entryPoint(['java', '-jar', '/epm.jar'])
exposePort(8180)
}
buildDocker.dependsOn(build)
//compileJava.dependsOn tasks.googleJavaFormat