-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
107 lines (97 loc) · 3.3 KB
/
build.gradle
File metadata and controls
107 lines (97 loc) · 3.3 KB
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
plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm' version '2.2.21'
id 'io.typst.spigradle' version '3.0.4'
id 'org.jetbrains.kotlin.plugin.serialization' version '2.2.21'
id 'maven-publish'
id 'signing'
}
group = 'io.typst'
version = '4.0.3'
repositories {
mavenCentral()
spigotmc()
}
dependencies {
compileOnly spigot('1.16.5')
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.2.21'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0'
implementation 'com.charleskorn.kaml:kaml-jvm:0.96.0'
implementation 'io.vavr:vavr:0.10.7'
testImplementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0'
testImplementation 'org.jetbrains.kotlin:kotlin-test'
}
test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(11)
}
spigot {
apiVersion '1.16'
}
publishing {
publications {
maven(MavenPublication) {
groupId = rootProject.group
artifactId = rootProject.name
version = rootProject.version
from components.java
pom {
name.set("${project.group}:${project.name}")
description.set("Static object-json mapping for Bukkit.")
url.set("https://github.com/typst-io/bukkit-kotlin-serialization")
licenses {
license {
name.set("GNU Lesser General Public License v3")
url.set("https://www.gnu.org/licenses/lgpl-3.0.txt")
}
}
developers {
developer {
id.set("entrypointkr")
name.set("Junhyung Im")
email.set("entrypointkr@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/typst-io/bukkit-kotlin-serialization.git")
developerConnection.set("scm:git:ssh://github.com:typst-io/bukkit-kotlin-serialization.git")
url.set("https://github.com/typst-io/bukkit-kotlin-serialization/tree/master")
}
}
}
}
repositories {
maven {
name = "sonatypeReleases"
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
credentials {
username = findProperty("ossrhUsername")?.toString()
password = findProperty("ossrhPassword")?.toString()
}
}
}
}
signing {
sign(publishing.publications["maven"])
}
tasks.register("publishCentralPortal") {
group = 'publishing'
doLast {
def url = new URL("https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/$project.group")
println(url)
def con = url.openConnection() as HttpURLConnection
def username = findProperty("ossrhUsername")?.toString()
def password = findProperty("ossrhPassword")?.toString()
def credential = Base64.encoder.encodeToString("$username:$password".getBytes())
def authValue = "Bearer $credential"
con.setRequestMethod("POST")
con.setRequestProperty("Authorization", authValue)
println(con.responseCode)
}
}
java {
withSourcesJar()
withJavadocJar()
}