-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
122 lines (101 loc) · 3.23 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
import cl.franciscosolis.sonatypecentralupload.SonatypeCentralUploadTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileInputStream
import java.util.*
plugins {
kotlin("jvm") version "2.0.20"
kotlin("plugin.serialization") version "2.0.20"
`maven-publish`
id("cl.franciscosolis.sonatype-central-upload") version "1.0.3"
id("com.github.johnrengelman.shadow") version "8.1.1"
}
version = "1.4.7"
group = "net.rk4z"
val localProperties = Properties().apply {
load(FileInputStream(rootProject.file("local.properties")))
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.reflections:reflections:0.10.2")
implementation("org.jetbrains.kotlin:kotlin-reflect:2.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
}
java {
withSourcesJar()
withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
tasks.withType<JavaCompile> {
options.release.set(17)
}
tasks.named<Jar>("jar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("")
}
publishing {
publications {
//maven
create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
pom {
name.set("Beacon")
description.set("A simple event API for Kotlin/Java")
url.set("https://github.com/KT-Ruxy/Beacon")
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/license/mit")
}
}
developers {
developer {
id.set("ruxy")
name.set("Ruxy")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/KT-Ruxy/Beacon.git")
developerConnection.set("scm:git:ssh://github.com/KT-Ruxy/Beacon.git")
url.set("https://github.com/KT-Ruxy/Beacon")
}
dependencies
}
}
}
repositories {
mavenLocal()
}
}
tasks.named<SonatypeCentralUploadTask>("sonatypeCentralUpload") {
dependsOn("clean", "jar", "sourcesJar", "javadocJar", "generatePomFileForMavenPublication")
username = localProperties.getProperty("cu")
password = localProperties.getProperty("cp")
archives = files(
tasks.named("jar"),
tasks.named("sourcesJar"),
tasks.named("javadocJar"),
)
pom = file(
tasks.named("generatePomFileForMavenPublication").get().outputs.files.single()
)
signingKey = localProperties.getProperty("signing.key")
signingKeyPassphrase = localProperties.getProperty("signing.passphrase")
}