-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
121 lines (107 loc) · 3.36 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
plugins {
kotlin("jvm") version "2.0.21"
`maven-publish`
`java-library`
id("org.jreleaser") version "1.14.0"
}
/*group = "com.lotsofpixelsstudios"*/
group = "de.matthiasklenz"
version = System.getenv("GITHUB_REF")?.removePrefix("refs/tags/") ?: "0.5.0-SNAPSHOT1"//"0.1-local" //use tag name as version
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation(group = "com.google.code.gson", name = "gson", version = "2.11.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib:2.0.21")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
implementation("ch.qos.logback:logback-classic:1.5.11")
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation("org.slf4j:slf4j-api:2.0.16")
//test
testImplementation(kotlin("test"))
implementation(group = "org.skyscreamer", name = "jsonassert", version = "1.5.3")
testImplementation("org.jsoup:jsoup:1.18.1")
}
java {
withJavadocJar()
withSourcesJar()
}
//set the version in the resource files to access it from projects
gradle.taskGraph.whenReady {
layout
.projectDirectory
.asFile
.resolve("src")
.resolve("main")
.resolve("resources")
.resolve("monstera_version")
.writeText(version.toString())
}
kotlin {
jvmToolchain(11)
}
tasks.test {
useJUnitPlatform()
enabled = true
}
repositories {
mavenCentral()
}
jreleaser {
release {
github {
skipTag = true
skipRelease = true
}
}
signing {
setActive("ALWAYS")
armored = true
}
deploy {
maven {
//Portal Publisher API
mavenCentral {
register("sonatype") {
setActive("ALWAYS")
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository(layout.buildDirectory.dir("staging-deploy").get().asFile.path)
}
}
}
}
}
publishing {
publications {
register("release", MavenPublication::class) {
from(components["java"])
pom {
name = "monstera"
description = "A library and environment designed to streamline the development of Minecraft addons."
url = "https://github.com/LotsOfPixelsStudios/Monstera"
developers {
developer {
id = "12rcu"
name = "Matthias Klenz"
}
}
licenses {
license {
name = "GPL-3.0"
url = "https://www.gnu.org/licenses/gpl-3.0.html"
}
}
scm {
connection.set("scm:git:git://github.com:LotsOfPixelsStudios/Monstera.git")
developerConnection.set("scm:git:ssh://github.com:LotsOfPixelsStudios/Monstera.git")
url.set("https://github.com/LotsOfPixelsStudios/Monstera")
}
}
}
}
repositories {
maven {
url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
}
}
}