-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
69 lines (58 loc) · 1.81 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
plugins {
id 'org.springframework.boot' version '3.4.2'
id 'io.spring.dependency-management' version '1.1.7'
id 'java'
id 'idea'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
// GitHub-Version >> Docker Version >> Fallback
if (System.getenv("RELEASE_VERSION")) {
version = System.getenv("RELEASE_VERSION")
}
else if (project.hasProperty("RELEASE_VERSION") && project.getProperty("RELEASE_VERSION") && !project.getProperty("RELEASE_VERSION").allWhitespace) {
version = project.getProperty("RELEASE_VERSION")
}
else {
version = "SNAPSHOT"
}
println("Building version $version")
// Omit version number in artifacts for simpler releases
bootJar.archiveFileName = "FE2_Kartengenerierung.jar"
jar {
enabled = false
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'com.google.maps:google-maps-services:2.2.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
springBoot {
buildInfo()
}
// Create zip containing WinSW ServiceWrapper and Jar File
task packageDistribution(type: Zip) {
archiveFileName = "FE2_Kartengenerierung_WinSW.zip"
destinationDirectory = file("$layout.buildDirectory/dist")
from "$layout.buildDirectory/../deploy/winsw", "$layout.buildDirectory/libs"
dependsOn(assemble)
}
// Adapt docker-compose.yml with correct version
task adaptDockerCompose(type: Copy) {
from "$layout.buildDirectory/../deploy/docker/docker-compose.yml"
into "$layout.buildDirectory/dist"
filter { line -> line.replaceAll('latest', version) }
}
build.dependsOn(adaptDockerCompose)
build.dependsOn(packageDistribution)