This repository has been archived by the owner on Jun 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
65 lines (53 loc) · 1.98 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
import java.text.SimpleDateFormat
plugins {
id "java"
id "io.freefair.lombok" version "6.6.3"
}
group 'com.solace.tools.solconfig'
def longVersion(){
var lastTag = 'git describe --abbrev=0 --tags'.execute().text.trim()
//%ci - committer date, ISO 8601-like format
var lastCommit = 'git log -1 --pretty=%h~%ci'.execute().text.trim()
lastTag+", commit: "+lastCommit + ", built: "+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss X").format(new Date())
}
repositories {
mavenCentral()
}
task nativeAgent(type:Exec) {
commandLine 'mkdir', '-p', './src/main/resources/META-INF/native-image/solconfig'
commandLine 'java', '-agentlib:native-image-agent=config-output-dir=./src/main/resources/META-INF/native-image/solconfig', '-jar', 'build/libs/solconfig.jar', 'test'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
jar {
archiveFileName = rootProject.name+".jar"
manifest {
attributes "Main-Class": "com.solace.tools.solconfig.App",
'Implementation-Title': rootProject.name,
'Implementation-Version': longVersion()
}
from {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
dependencies {
// Use JUnit Jupiter for testing.
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
// Use JUnit Jupiter Engine for testing.
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
// This dependency is used by the application.
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.0'
implementation 'info.picocli:picocli:4.7.0'
annotationProcessor 'info.picocli:picocli-codegen:4.7.0'
implementation 'ch.qos.logback:logback-classic:1.4.5'
implementation 'com.jayway.jsonpath:json-path:2.7.0'
implementation 'org.freemarker:freemarker:2.3.31'
}
tasks.named('test') {
// Use junit platform for unit tests.
useJUnitPlatform()
}