forked from Koboo/en2do
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
74 lines (58 loc) · 1.81 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import java.net.URI
plugins {
id("java-library")
id("io.github.goooler.shadow") version "8.1.8"
id("maven-publish")
}
group = "eu.koboo"
version = project.property("project_version") as String
repositories {
mavenCentral()
}
dependencies {
api("org.mongodb:mongodb-driver-sync:5.3.0")
testImplementation("org.mongodb:mongodb-driver-sync:5.3.0")
compileOnly("org.projectlombok:lombok:1.18.36")
annotationProcessor("org.projectlombok:lombok:1.18.36")
testImplementation("org.projectlombok:lombok:1.18.36")
testAnnotationProcessor("org.projectlombok:lombok:1.18.36")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.11.4")
testImplementation("org.slf4j:slf4j-jdk14:2.0.16")
}
tasks.withType<Test> {
useJUnitPlatform() // Make all tests use JUnit 5
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("")
}
tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
}
publishing {
repositories {
maven {
name = "Reposilite"
url = URI((System.getenv("REPOSILITE_URL") ?: "default").toString())
credentials {
username = System.getenv("REPOSILITE_USER")
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.named("publishGprPublicationToReposiliteRepository") {
dependsOn(tasks.named("jar"))
}