-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle.kts
102 lines (88 loc) · 2.5 KB
/
build.gradle.kts
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
plugins {
java
application
`jvm-test-suite`
alias(libs.plugins.shadow)
}
configurations {
implementation {
resolutionStrategy.failOnNonReproducibleResolution()
}
}
dependencies {
// Dependency versions can be found at {project root}/gradle/libs.versions.toml
implementation(libs.picocli)
implementation(libs.jansi)
implementation(libs.commonstext)
implementation(libs.handlebars)
implementation(libs.slf4j)
implementation(libs.commonsio)
}
group = "org.doble"
version = "3.4.0"
description = "adr-j"
java {
toolchain {
// Development Java version is the latest LTS version
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.ADOPTIUM
}
consistentResolution {
useCompileClasspathVersions()
}
}
application {
mainClass = "org.doble.adr.ADR"
}
tasks.named<JavaCompile>("compileJava") {
// Binary compatability with LTS version - 2
options.apply {
release = 11
}
}
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
filePermissions {
unix("rw-r--r--")
}
dirPermissions {
unix("rwxr-xr-x")
}
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
exclude("META-INF/maven/org.fusesource.jansi/jansi/pom.xml")
exclude("META-INF/maven/org.fusesource.jansi/jansi/pom.properties")
}
testing {
suites {
val test by getting(JvmTestSuite::class) {
useJUnitJupiter(libs.versions.junit)
dependencies {
implementation(libs.hamcrest)
implementation(libs.jimfs)
}
targets {
all {
testTask.configure {
testLogging {
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
}
}
}
}
}
tasks.register<Copy>("releaseJar") {
group = "ADR-J - Release"
description = "Creates a JAR release."
dependsOn(tasks.shadowJar)
from(layout.buildDirectory.file("libs/adr-j-${version}-all.jar"))
rename { n -> n.replace("-${version}-all", "") }
into(layout.buildDirectory.dir("releases"))
layout.buildDirectory.file("releases/adr-j.jar").map {
// set executable with read permissions (first true) and for all (false)
it.asFile.setExecutable(true, false)
}
}