-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
122 lines (103 loc) · 3.7 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
`java-library`
`maven-publish`
signing
id("io.freefair.lombok") version "8.10"
id("com.gradleup.shadow") version "8.3.3"
id("org.sonarqube") version "4.4.1.3373"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}
group = "net.guizhanss"
allprojects {
repositories {
mavenCentral()
maven("https://jitpack.io/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://papermc.io/repo/repository/maven-public")
maven("https://repo.alessiodp.com/releases/")
}
}
subprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
apply(plugin = "io.freefair.lombok")
apply(plugin = "com.gradleup.shadow")
apply(plugin = "org.sonarqube")
dependencies {
fun compileOnlyAndTestImplementation(dependencyNotation: Any) {
compileOnly(dependencyNotation)
testImplementation(dependencyNotation)
}
api("com.google.code.findbugs:jsr305:3.0.2")
compileOnlyAndTestImplementation("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.2")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.11.2")
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withJavadocJar()
withSourcesJar()
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<ShadowJar> {
archiveClassifier = ""
}
sonar {
properties {
property("sonar.projectKey", "ybw0014_GuizhanLib")
property("sonar.organization", "ybw0014")
property("sonar.host.url", "https://sonarcloud.io")
}
}
publishing {
publications {
create<MavenPublication>("maven") {
project.shadow.component(this)
artifact(tasks.named("javadocJar").get())
artifact(tasks.named("sourcesJar").get())
groupId = rootProject.group as String
artifactId = project.name
version = rootProject.version as String
pom {
name.set("guizhanlib")
description.set("A library for Slimefun addon development.")
url.set("https://github.com/ybw0014/guizhanlib")
licenses {
license {
name.set("GPL-3.0 license")
url.set("https://github.com/ybw0014/guizhanlib/blob/master/LICENSE")
distribution.set("repo")
}
}
developers {
developer {
name.set("ybw0014")
url.set("https://ybw0014.dev/")
}
}
scm {
connection.set("scm:git:git://github.com/ybw0014/guizhanlib.git")
developerConnection.set("scm:git:ssh://github.com:ybw0014/guizhanlib.git")
url.set("https://github.com/ybw0014/guizhanlib/tree/master")
}
}
}
}
}
signing {
sign(publishing.publications["maven"])
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}