-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
89 lines (74 loc) · 2.31 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
import cl.franciscosolis.sonatypecentralupload.SonatypeCentralUploadTask
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
kotlin("jvm") version "2.0.21"
`maven-publish`
id("com.github.johnrengelman.shadow") version "7.+"
id("cl.franciscosolis.sonatype-central-upload") version "1.0.2"
}
group = "com.tksimeji"
version = "0.0.1"
java {
withSourcesJar()
withJavadocJar()
}
kotlin {
jvmToolchain(21)
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("reflect"))
implementation("com.google.code.gson:gson:2.11.0")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
}
publishing {
publications {
register<MavenPublication>("maven") {
pom {
name.set("tksimeji")
description.set("A Mojang API client for Java and Kotlin")
url.set("https://github.com/tksimeji/mojango")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/tksimeji/mojango/blob/master/LICENSE")
distribution.set("repo")
}
}
developers {
developer {
id.set("tksimeji")
name.set("tksimeji")
email.set("tksimeji@outlook.com")
}
}
scm {
url.set("https://github.com/tksimeji/mojango")
}
}
}
}
}
tasks.test {
useJUnitPlatform()
}
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("")
}
tasks.named<SonatypeCentralUploadTask>("sonatypeCentralUpload") {
dependsOn("shadowJar", "sourcesJar", "javadocJar", "generatePomFileForMavenPublication")
username = System.getenv("SONATYPE_CENTRAL_USERNAME")
password = System.getenv("SONATYPE_CENTRAL_PASSWORD")
archives = files(
tasks.named("shadowJar"),
tasks.named("sourcesJar"),
tasks.named("javadocJar"),
)
pom = file(
tasks.named("generatePomFileForMavenPublication").get().outputs.files.single()
)
signingKey.set(File("secret.asc").readText())
signingKeyPassphrase = System.getenv("PGP_SIGNING_KEY_PASSPHRASE")
}