-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
131 lines (110 loc) · 3.74 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
import org.ajoberstar.reckon.core.Scope
plugins {
kotlin("jvm") version "1.9.0"
id("org.ajoberstar.reckon") version "0.18.0"
id("org.jetbrains.dokka") version "1.8.20"
id("maven-publish")
signing
}
group = "net.bestlinuxgamers.guiapi"
reckon {
setDefaultInferredScope(Scope.PATCH)
stages("beta", "rc", "final")
setScopeCalc(calcScopeFromProp().or(calcScopeFromCommitMessages()))
setStageCalc(calcStageFromProp())
}
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") //Spigot
}
//dependency version vars
val spigotVersion: String by project
dependencies {
//Spigot
compileOnly("org.spigotmc:spigot-api:$spigotVersion")
//tests
testImplementation(kotlin("test"))
testImplementation("io.mockk:mockk:1.13.2")
testImplementation(files("./testDependencies/spigot-1.16.5.jar"))
}
//task settings
kotlin {
jvmToolchain(8)
}
tasks.test {
useJUnitPlatform()
}
//custom tasks
tasks.register<org.gradle.jvm.tasks.Jar>("javadocJar") {
group = "documentation"
archiveClassifier.set("javadoc")
from(tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>()["dokkaHtml"].outputDirectory)
}
tasks.register<org.gradle.jvm.tasks.Jar>("sourcesJar") {
group = "documentation"
archiveClassifier.set("sources")
from(project.sourceSets["main"].allSource)
}
//publish
publishing {
publications {
create<MavenPublication>("maven") {
pom {
name.set(rootProject.name)
description.set("Library for creating component-based animated Minecraft inventory GUIs.")
scm {
connection.set("scm:git:https://github.com/bestlinuxgamers/GuiApi.git")
developerConnection.set("scm:git:ssh://[email protected]/bestlinuxgamers/GuiApi.git")
url.set("https://github.com/bestlinuxgamers/GuiApi")
}
licenses {
license {
name.set("GNU LESSER GENERAL PUBLIC LICENSE, Version 3")
url.set("https://www.gnu.org/licenses/lgpl-3.0.txt")
}
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/bestlinuxgamers/GuiApi/issues")
}
developers {
developer {
id.set("bestlinuxgamers")
name.set("bestlinuxgamers")
email.set("[email protected]")
}
}
}
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
from(components["kotlin"])
the<SigningExtension>().sign(this)
}
}
repositories {
maven {
name = "github"
val githubRepoOwner: String by project
val githubRepo: String by project
url = uri("https://maven.pkg.github.com/$githubRepoOwner/$githubRepo")
credentials(PasswordCredentials::class)
}
maven {
name = "gitea"
val giteaInstance: String by project
val giteaUsername: String by project
url = uri("https://$giteaInstance/api/packages/$giteaUsername/maven")
credentials(HttpHeaderCredentials::class.java) {
name = "Authorization"
value = "token ${findProperty("giteaToken")}"
}
authentication {
@Suppress("UNUSED_VARIABLE", "KotlinRedundantDiagnosticSuppress")
val header by registering(HttpHeaderAuthentication::class)
}
}
}
}
signing {
useGpgCmd()
}