-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
201 lines (166 loc) · 5.32 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import org.jreleaser.gradle.plugin.JReleaserExtension
import org.jreleaser.model.Active
import org.jreleaser.model.api.deploy.maven.MavenCentralMavenDeployer.Stage
import org.jreleaser.model.api.signing.Signing
plugins {
id("java")
id("java-library")
id("maven-publish")
id("org.jreleaser") version "1.14.0"
}
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
group = project.property("group")!!
version = "${project.property("version")}"
base {
archivesName.set(project.property("archivesBaseName").toString())
}
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
compileOnly("org.jetbrains:annotations:23.0.0")
}
tasks.compileJava {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.test {
useJUnitPlatform()
}
extensions.configure<JReleaserExtension>("jreleaser") {
project {
group = "dev.ultreon"
authors.set(listOf("XyperCode"))
license = "Apache-2.0"
description = "Extensible NBT-like data API."
copyright.set("(C) Copyright 2023 Quinten Jungblut. All rights reserved.")
links {
homepage = "https://ultreon.dev"
}
inceptionYear = "2022"
}
gitRootSearch = true
release {
gitlab {
branch.set("main")
}
}
signing {
active.set(Active.ALWAYS)
armored = true
}
deploy {
maven {
[email protected](Active.ALWAYS)
mavenCentral {
create("sonatype") {
active.set(Active.ALWAYS)
url.set("https://central.sonatype.com/api/v1/publisher")
stagingRepository(projectDir.path + "/build/staging-deploy")
}
}
}
}
}
publishing {
repositories {
maven {
mkdir("build/staging-deploy")
name = "Staging"
url = uri("file://${projectDir.path.replace("\\", "/")}/build/staging-deploy")
}
}
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
pom {
name.set("UBO")
description.set("Extensible NBT-like data API.")
url.set("https://github.com/Ultreon/ubo")
inceptionYear.set("2022")
developers {
developer {
name.set("XyperCode")
email.set("[email protected]")
organization.set("Ultreon")
organizationUrl.set("https://github.com/Ultreon")
}
}
organization {
name.set("Ultreon")
url.set("https://github.com/Ultreon")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/Ultreon/ubo/issues")
}
licenses {
license {
name.set("Apache License")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
connection.set("scm:git:git://github.com/Ultreon/ubo.git")
developerConnection.set("scm:git:ssh://github.com/Ultreon/ubo.git")
url.set("https://github.com/Ultreon/ubo/tree/main")
}
contributors {
contributor {
name.set("XyperCode")
url.set("https://github.com/XyperCode")
}
contributor {
name.set("AndEditor7")
url.set("https://github.com/AndEditor7")
}
}
}
}
}
repositories {
maven {
url = uri("https://gitlab.com/api/v4/projects/60101946/packages/maven")
credentials(HttpHeaderCredentials::class) {
name = "Private-Token"
value =
findProperty("gitLabPrivateToken") as String? // the variable resides in $GRADLE_USER_HOME/gradle.properties
}
authentication {
create("header", HttpHeaderAuthentication::class)
}
}
}
}
tasks.test {
useJUnitPlatform()
}
tasks.publish.get().dependsOn(tasks.build)
tasks.withType<GenerateModuleMetadata> {
enabled = false
}
afterEvaluate {
tasks.javadoc {
// source(sourceSets.main.allJava.sourceDirectories)
// title = "Ultreon Data API (UBO/USO)"
// description = "Extensible NBT-like data API."
// setDestinationDir(file("$rootProject.projectDir/build/docs/javadoc"))
// // Configure the classpath
// classpath = files(sourceSets.main.compileClasspath)
// (options as StandardJavadocDocletOptions).links(
// // Kinda empty in here lmao.
// )
}
}