-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
88 lines (74 loc) · 2.12 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
88 lines (74 loc) · 2.12 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
import java.time.ZoneOffset
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
plugins {
java
`maven-publish`
id("com.gradleup.shadow") version "9.4.1"
alias(libs.plugins.lombok)
}
project.group = "org.reprogle"
project.version = "1.1.4"
project.description =
"A library for wrapping common tasks my plugins do, such as SQLite storage or command creation/registration"
val isReleaseBuild = project.hasProperty("releaseBuild")
val forceBuildId = project.hasProperty("forceBuildId")
if (!isReleaseBuild || forceBuildId) {
val timestamp = ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern("yyyyMMdd-HHmm"))
val newVersion = "${project.version}-SNAPSHOT-${timestamp}"
project.version = newVersion
println("Auto build ID enabled → version set to $newVersion")
} else {
println("Release build → using version ${project.version}")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(25))
}
withSourcesJar()
withJavadocJar()
}
repositories {
maven {
name = "papermc"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
}
dependencies {
compileOnly(libs.paper.api)
compileOnly(libs.boosted.yaml)
implementation(libs.bstats)
compileOnly(libs.guice)
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.shadowJar {
archiveClassifier.set("") // Replace the normal JAR
mergeServiceFiles()
exclude("META-INF/*.MF")
relocate("org.bstats", "org.reprogle.bytelib.bstats")
}
tasks.build {
dependsOn(tasks.shadowJar)
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "$group"
artifactId = "bytelib"
version = version
from(components["java"])
}
}
repositories {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/TerrorByteTW/ByteLib")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}