-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
106 lines (101 loc) · 3.56 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
buildscript {
ext {
springBootVersion = '2.0.5.RELEASE'
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0"
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "com.github.hierynomus.license-report"
group = 'strava.acambieri'
version = '0.1'
sourceCompatibility = 1.8
ext.env = project.hasProperty('env') ? env : 'devel'
repositories {
mavenCentral()
}
ext {
swagger_annotations_version = "1.5.9"
jackson_version = "2.9.4"
feign_version = "9.4.0"
feign_form_version = "2.1.0"
junit_version = "4.12"
oltu_version = "1.0.1"
}
processResources {
def profile = (project.hasProperty('env') ? env : 'devel').toLowerCase()
print "profile: $profile"
//include "**/*"
rename {
String name ->
name.replace("_${profile}.properties",".properties")
}
}
processResources.dependsOn(':frontend:build')
dependencies {
implementation('org.springframework.boot:spring-boot-starter-web'){
exclude group: 'com.fasterxml.jackson.core'
exclude group: 'com.fasterxml.jackson.module'
}
implementation('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2'){
exclude group: 'com.fasterxml.jackson.core'
exclude group: 'com.fasterxml.jackson.module'
}
runtimeOnly('org.springframework.boot:spring-boot-devtools')
compile('com.h2database:h2')
compile group: 'org.cryptacular', name: 'cryptacular', version: '1.0'
//swagger generated client dependencies
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
compile "io.github.openfeign:feign-core:$feign_version"
compile "io.github.openfeign:feign-jackson:$feign_version"
compile "io.github.openfeign:feign-slf4j:$feign_version"
compile "io.github.openfeign.form:feign-form:$feign_form_version"
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
compile "com.brsanthu:migbase64:2.2"
///////////////////////////////////////
testImplementation('org.springframework.boot:spring-boot-starter-test')
}
gradle.taskGraph.whenReady { graph ->
def versionPropsFile = file('src/main/java/strava/acambieri/skatebuddy/BuildNumber.properties')
def Properties versionProps = new Properties()
if (versionPropsFile.canRead()) {
FileInputStream fs = new FileInputStream(versionPropsFile)
versionProps.load(fs)
def versionMin = 0
try {
versionMin = Integer.parseInt(versionProps['build.number']);
}
catch (NumberFormatException e) {
}
if (env.equals("prod")) {
versionMin++;
writeVersion(versionMin, versionProps, versionPropsFile)
}
fs.close()
println "BuildNumber: $versionMin"
version += "."+versionMin
} else {
writeVersion(1, versionProps, versionPropsFile)
version += ".1"
}
}
def writeVersion(version,props,file) {
props['build.number']=""+version
FileWriter fw = new FileWriter(file)
props.store(fw,"")
fw.close()
}