-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
118 lines (103 loc) · 3.23 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
118 lines (103 loc) · 3.23 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
108
109
110
111
112
113
114
115
116
117
118
plugins {
java
`maven-publish`
idea
id("dev.plex.module") version "1.2"
}
group = "dev.plex"
version = "2.0-SNAPSHOT"
description = "Module-HTTPD"
repositories {
mavenCentral()
maven {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
maven {
url = uri("https://nexus.telesphoreo.me/repository/plex/")
}
maven {
url = uri("https://maven.enginehub.org/repo/")
}
maven {
name = "codemc"
url = uri("https://repo.codemc.io/repository/maven-public/")
}
}
sourceSets {
main {
resources.srcDir(layout.buildDirectory.dir("generated/frontend-resources"))
}
}
dependencies {
implementation("org.projectlombok:lombok:1.18.46")
annotationProcessor("org.projectlombok:lombok:1.18.46")
compileOnly("io.papermc.paper:paper-api:26.1.2.build.+")
implementation("dev.plex:api:2.0-SNAPSHOT")
implementation("org.json:json:20251224")
implementation("org.reflections:reflections:0.10.2")
plexLibrary("org.eclipse.jetty:jetty-server:12.1.9")
plexLibrary("org.eclipse.jetty.ee10:jetty-ee10-servlet:12.1.9")
plexLibrary("org.eclipse.jetty:jetty-proxy:12.1.9")
compileOnly("de.tr7zw:item-nbt-api:2.15.7")
implementation(platform("com.intellectualsites.bom:bom-newest:1.56")) // Ref: https://github.com/IntellectualSites/bom
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core")
implementation("commons-io:commons-io:2.22.0")
}
val frontendDir = layout.projectDirectory.dir("src/main/frontend")
val frontendOutputDir = layout.buildDirectory.dir("generated/frontend-resources/httpd/app")
val bunExecutable = findProperty("bunPath")?.toString() ?: "bun"
tasks.register<Exec>("bunInstallFrontend") {
workingDir = frontendDir.asFile
commandLine(bunExecutable, "install", "--frozen-lockfile")
inputs.files(
frontendDir.file("package.json"),
frontendDir.file("bun.lock")
)
outputs.dir(frontendDir.dir("node_modules"))
}
tasks.register<Exec>("buildFrontend") {
workingDir = frontendDir.asFile
commandLine(bunExecutable, "run", "build")
dependsOn("bunInstallFrontend")
inputs.dir(frontendDir.dir("src"))
inputs.files(
frontendDir.file("index.html"),
frontendDir.file("vite.config.ts"),
frontendDir.file("svelte.config.js"),
frontendDir.file("tsconfig.json"),
frontendDir.file("tsconfig.node.json"),
frontendDir.file("components.json"),
frontendDir.file("package.json"),
frontendDir.file("bun.lock")
)
outputs.dir(frontendOutputDir)
}
tasks.getByName<Jar>("jar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName.set("Module-HTTPD")
archiveVersion.set("")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
dependsOn("buildFrontend")
filteringCharset = Charsets.UTF_8.name()
exclude("dev/**")
exclude("httpd/assets/**")
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}