-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
82 lines (70 loc) · 2.44 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
import java.net.URI
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("java")
id("io.github.goooler.shadow") version "8.1.7"
`maven-publish`
}
subprojects {
apply(plugin = "java")
apply(plugin = "io.github.goooler.shadow")
apply(plugin = "maven-publish")
group = "de.derioo.javautils"
version = "2.7.2"
repositories {
mavenCentral()
}
dependencies {
/** Annotations **/
implementation("org.projectlombok:lombok:1.18.34")
annotationProcessor("org.projectlombok:lombok:1.18.34")
implementation("org.jetbrains:annotations:24.1.0")
implementation("org.jetbrains:annotations:24.1.0")
/** Test dependencies **/
testImplementation(platform("org.junit:junit-bom:5.10.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.assertj:assertj-core:3.26.0")
testImplementation("org.projectlombok:lombok:1.18.34")
testAnnotationProcessor("org.projectlombok:lombok:1.18.34")
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("")
relocate("com.fasterxml.jackson", "de.derioo.shadow.jackson")
relocate("com.fasterxml.jackson.databind", "de.derioo.shadow.jackson.databind")
relocate("com.fasterxml.jackson.core", "de.derioo.shadow.jackson.core")
relocate("com.fasterxml.jackson.annotation", "de.derioo.shadow.jackson.annotation")
}
tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
}
publishing {
repositories {
maven {
name = "Reposilite"
url = URI("https://repo.derioo.de/releases")
credentials {
username = "admin"
password = System.getenv("REPOSILITE_TOKEN")
}
}
}
publications {
register<MavenPublication>("gpr") {
groupId = "$group"
version = "$version"
artifact(tasks.named<ShadowJar>("shadowJar").get())
artifact(tasks.named<Jar>("sourcesJar").get())
}
}
}
tasks.test {
useJUnitPlatform()
}
tasks.named("publishGprPublicationToReposiliteRepository") {
dependsOn(tasks.named("jar"))
}
}