forked from joedayz/rkbackend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
208 lines (159 loc) · 4.92 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
buildscript {
ext {
springBootVersion = '1.3.6.RELEASE'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('se.transmode.gradle:gradle-docker:1.2')
classpath 'org.ajoberstar:grgit:1.1.0'
}
}
plugins {
id "io.spring.dependency-management" version "0.6.1.RELEASE"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'docker'
if (project.hasProperty('projectversion')) {
project.version = projectversion
} else {
project.version = '5.0.0'
}
jar {
baseName = 'runakuna-backend'
version = project.version
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
snippetsDir = file('build/generated-snippets')
}
ext['spring.version']='4.3.1.RELEASE'
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
url "http://celticci.tss.com.pe:8081/nexus/content/repositories/thirdparty"
}
maven { url 'http://proget.tss.com.pe:81/maven/tsi-maven/' }
}
dependencies {
// log
compile ('log4j:log4j:1.2.17')
// spring
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-data-rest')
compile('org.springframework.boot:spring-boot-starter-mail')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.cloud:spring-cloud-starter-config:1.0.3.RELEASE') { exclude(group: 'ch.qos.logback') }
compile('org.apache.poi:poi-ooxml:3.10.1')
compile('org.springframework:spring-jdbc')
compile('org.projectlombok:lombok:1.12.6')
compile('com.microsoft.sqlserver:sqljdbc4:4.0')
compile('net.sourceforge.jtds:jtds:1.3.1')
compile('org.springframework.hateoas:spring-hateoas:0.19.0.RELEASE')
compile('org.elasticsearch.client:transport:5.3.1')
compile('io.jsonwebtoken:jjwt:0.6.0')
//compile('joda-time:joda-time:2.1')
compile('org.apache.commons:commons-lang3:3.3.2')
compile('net.sf.dozer:dozer:5.5.1')
compile('com.google.code.gson:gson:2.6.2')
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
compile group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.3.0'
//compile('net.sf.jasperreports:jasperreports:5.1.2')
//compile('org.codehaus.groovy:groovy-all:1.7.5')
compile('com.lowagie:itext:2.1.7')
compile group: 'org.olap4j', name: 'olap4j', version: '1.2.0'
compile group: 'org.quartz-scheduler', name: 'quartz', version: '2.2.3'
// https://mvnrepository.com/artifact/joda-time/joda-time
compile group: 'joda-time', name: 'joda-time', version: '2.8.2'
compile 'org.springframework.restdocs:spring-restdocs-mockmvc:1.2.0.RELEASE'
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('org.springframework.restdocs:spring-restdocs-mockmvc')
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
sourceSets {
funcTests {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
}
ext['hibernate.version'] = '5.0.7.Final'
configurations {
funcTestsCompile.extendsFrom testCompile
funcTestsRuntime.extendsFrom testRuntime
}
task funcTests(type: Test) {
testClassesDir = sourceSets.funcTests.output.classesDir
classpath = sourceSets.funcTests.runtimeClasspath
}
task wrapper(type: Wrapper) {
gradleVersion = '2.12'
}
bootRun {
addResources = true
}
springBoot {
mainClass = "pe.com.tss.runakuna.RunakunaBackendApplication"
}
group = 'tss'
task buildDocker(type: Docker, dependsOn: assemble) {
push = false
applicationName = jar.baseName
dockerfile = file('src/main/docker/Dockerfile')
doFirst {
copy {
from jar
into stageDir
}
}
}
import org.codehaus.groovy.runtime.*
import org.eclipse.jgit.api.*
def getGitBranchCommit() {
try {
def git = org.ajoberstar.grgit.Grgit.open(file('.'))
def revision = git.head().abbreviatedId
return revision
} catch (IOException ex) {
return "UNKNOWN"
}
}
processResources {
filesMatching("**/application.properties") {
expand (
"prodVersion": gradle.gradleVersion,
"revision": getGitBranchCommit(),
"buildTimestamp": DateGroovyMethods.format(new Date(), 'yyyy-MM-dd HH:mm'),
"prodBuild": project.version
)
}
}
processResources.outputs.upToDateWhen{ false }
task printVersion {
// any code that goes here is part of configuring the task
// this code will always get run, even if the task is not executed
doLast { // add a task action
// any code that goes here is part of executing the task
// this code will only get run if and when the task gets executed
println project.version
}
}
task buildInfo {
println project.version + "-" + getGitBranchCommit()
}