-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
130 lines (122 loc) · 3.5 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
plugins {
id("java")
id("idea")
id("maven-publish")
id("signing")
}
val githubUsername: String by project
val githubToken: String by project
val ossrhUsername: String by project
val ossrhPassword: String by project
val version: String by project
val group: String by project
val artifact: String by project
project.group = group
project.version = version
repositories {
mavenCentral()
// paper-api
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("org.jetbrains:annotations:24.0.1")
// paper api
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}
sourceSets {
main {
java {
srcDir("src")
}
resources {
srcDir("resources")
}
}
test {
java {
srcDir("test")
}
}
}
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
tasks.register<Copy>("prepareServer") {
dependsOn("build")
from(tasks.jar.get().archiveFile.get().asFile.path)
rename(tasks.jar.get().archiveFile.get().asFile.name, "${project.name}.jar")
into("G:\\paper\\plugins")
}
tasks {
compileJava {
options.compilerArgs.add("-parameters")
options.encoding = "UTF-8"
}
compileTestJava { options.encoding = "UTF-8" }
javadoc { options.encoding = "UTF-8" }
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
pom {
name.set("GUILib")
groupId = group
artifactId = artifact
version = version
description.set("A simple GUI library for PaperMC")
url.set("https://github.com/Hugo5000/PaperMC-GUILib")
licenses {
license {
name.set("GNU General Public License version 3")
url.set("https://opensource.org/license/gpl-3-0/")
}
}
developers {
developer {
name.set("Hugo")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/Hugo5000/PaperMC-GUILib.git")
developerConnection.set("scm:git:ssh://github.com/Hugo5000/PaperMC-GUILib.git")
url.set("http://github.com/Hugo5000/PaperMC-GUILib/tree/master")
}
}
from(components["java"])
}
}
repositories {
maven {
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Hugo5000/PaperMC-GUILib")
credentials {
username = githubUsername
password = githubToken
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}