-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
85 lines (70 loc) · 2.5 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
plugins {
id 'de.undercouch.download' version '3.2.0'
id 'org.springframework.boot' version '1.5.4.RELEASE'
}
apply plugin: 'java'
version = '1.3.3'
def apiJavalibVersion = '1.14.2'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
flatDir {
dirs 'lib'
}
}
task downloadLib(type: de.undercouch.gradle.tasks.download.Download) {
src "https://github.com/antoine-aumjaud/api-javalib/releases/download/v${apiJavalibVersion}/api-javalib-${apiJavalibVersion}.jar"
dest 'lib'
onlyIfNewer true
}
compileJava { dependsOn downloadLib }
configurations {
//do not use jetty because it's not allow not valid URL with % (send by synology SMS notification)
//compile.exclude module: "spring-boot-starter-tomcat" //remove tomcat, use jetty
}
dependencies {
compile name: 'api-javalib', version: apiJavalibVersion
//Transitive dependencies
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.bouncycastle:bcpkix-jdk15on:1.52'
compile 'com.auth0:java-jwt:3.3.0'
//Spring boot
compile('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'commons-logging' //useless with slf4j
exclude group: 'ch.qos.logback:' //old version
}
//do not use jetty because it's not allow not valid URL with % (send by synology SMS notification)
//compile 'org.springframework.boot:spring-boot-starter-jetty' //use jetty
testCompile 'org.springframework.boot:spring-boot-starter-test'
//Other
runtime 'ch.qos.logback:logback-classic:1.2.3'
testCompile 'junit:junit:4.12'
}
processResources {
filter org.apache.tools.ant.filters.ReplaceTokens, tokens: [
"application.name": project.property("name"),
"application.version": project.property("version"),
"build.date": new Date().format('yyyy-MM-dd HH:mm:ss')
]
}
jar {
baseName = project.property("name")
version = project.property("version")
}
task copyConfig(type: Copy) {
description = "Copy config file for bootRun tasks"
from(file('src/dist/conf/'))
into("$buildDir/resources/main/")
}
bootRun { dependsOn copyConfig }
//add dist config only when task bootRun is executed
bootRepackage {
mainClass = 'fr.aumjaud.antoine.services.home.security.LaunchServer'
}
springBoot {
layout = "ZIP"
//to add folder in classpath
//see https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-gradle-plugin.html#build-tool-plugins-gradle-configuration-layouts
}