-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
128 lines (111 loc) · 3.92 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
plugins {
id("java")
id("java-library")
id("maven-publish")
id("tech.medivh.plugin.publisher") version "1.2.1" apply false
id("signing")
}
if (project.properties["maven.publish"] == "true") {
apply(plugin = "tech.medivh.plugin.publisher")
}
group = libs.versions.group.get()
version = libs.versions.version.get()
repositories {
mavenCentral()
maven("https://repository.voinearadu.dev/repository/maven-releases/")
}
dependencies {
// Dependencies
api(libs.gson)
compileOnly(libs.jedis)
testImplementation(libs.jedis)
// Annotations
compileOnly(libs.lombok)
annotationProcessor(libs.lombok)
testCompileOnly(libs.lombok)
testAnnotationProcessor(libs.lombok)
compileOnly(libs.jetbrains.annotations)
annotationProcessor(libs.jetbrains.annotations)
testCompileOnly(libs.jetbrains.annotations)
testAnnotationProcessor(libs.jetbrains.annotations)
// Tests
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
}
tasks {
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
}
tasks.register("javadocJar", Jar::class) {
archiveClassifier.set("javadoc")
from(tasks.named("javadoc"))
}
tasks.register("sourcesJar", Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
project.afterEvaluate{
if (project.properties["maven.publish"] == "true") {
project.tasks["publishMavenPublicationToMedivhSonatypeRepository"].enabled = false
project.tasks["publishMedivhMavenJavaPublicationToVoineaRaduRepositoryRepository"].enabled = false
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom{
name.set("Utils Library")
description.set("A utility library for various purposes.")
url.set("https://github.com/Voinea-Radu/Utils")
licenses {
license {
name.set("MIT")
url.set("https://github.com/Voinea-Radu/Utils/blob/master/LICENSE")
distribution.set("repo")
}
}
developers {
developer {
id.set("voinearadu")
name.set("Voinea Radu-Mihai")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/Voinea-Radu/Utils.git")
developerConnection.set("scm:git:ssh://[email protected]/Voinea-Radu/Utils.git")
url.set("https://github.com/Voinea-Radu/Utils")
}
}
}
}
repositories {
if (project.properties["com.voinearadu.publish"] == "true") {
maven(url = (project.findProperty("com.voinearadu.url") ?: "") as String) {
name = "VoineaRaduRepository"
credentials(PasswordCredentials::class) {
username = (project.findProperty("com.voinearadu.auth.username") ?: "") as String
password = (project.findProperty("com.voinearadu.auth.password") ?: "") as String
}
}
}
if (project.properties["generic.publish"] == "true") {
maven(url = (project.findProperty("generic.url") ?: "") as String) {
name = "GenericRepository"
credentials(PasswordCredentials::class) {
username = (project.findProperty("generic.auth.username") ?: "") as String
password = (project.findProperty("generic.auth.password") ?: "") as String
}
}
}
}
}