-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
98 lines (75 loc) · 2.35 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.0.2'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.graalvm.buildtools.native' version '0.9.18'
}
apply from: "$rootDir/gradle/versioning.gradle"
group = 'ch.so.agi.repochecker'
sourceCompatibility = '17'
targetCompatibility = '17'
compileJava {
options.compilerArgs.addAll(['--release', '17'])
}
bootJar {
archiveName = baseName + "-" + version + "-exec.jar"
}
repositories {
maven { url 'https://repo.spring.io/release' }
maven { url 'https://jars.interlis.ch/' }
mavenCentral()
}
configurations.all {
resolutionStrategy {
force 'ch.interlis:ili2c-tool:5.4.1'
force 'ch.interlis:ili2c-core:5.4.1'
//force 'ch.interlis:iox-ili:1.21.11'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
implementation 'net.sf.saxon:Saxon-HE:10.6'
implementation 'ch.interlis:ili2c-tool:5.4.1'
implementation 'ch.interlis:ili2c-core:5.4.1'
implementation 'ch.interlis:ilivalidator:1.14.1'
implementation 'com.vividsolutions:jts-core:1.14.0' // Warum nötig?
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}
nativeBuild {
verbose = true
fallback = false
//buildArgs.add("--libc=musl")
//buildArgs.add("--static")
}
import java.text.SimpleDateFormat
tasks.register('versionTxt') {
description = "Create a version.txt file with some information about the build."
outputs.upToDateWhen { false }
doLast {
new File("version.txt").text = """
Version: $version
Revision: ${getCheckedOutGitCommitHash()}
Buildtime: ${new SimpleDateFormat("dd-MM-yyyy HH:mm:ss").format(new Date())}
Application-name: interlis-repo-checker
"""
}
}
tasks.register('copyVersionTxt', Copy) {
from "version.txt"
into "src/main/resources/static/"
}
copyVersionTxt.dependsOn(versionTxt)
processResources.dependsOn(copyVersionTxt)
def getCheckedOutGitCommitHash() {
'git log -1 --pretty=%H'.execute().text.trim()
}
def getTimestamp() {
def date = new Date()
return date.format('yyyy-MM-dd HH:mm:ss')
}