-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
73 lines (61 loc) · 2.37 KB
/
build.gradle
File metadata and controls
73 lines (61 loc) · 2.37 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
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our Samples at https://docs.gradle.org/9.2.0/samples
*/
subprojects {
// This disgusting if statement is here to prevent the intermediary :packs and :modules being treated as a jar producing project.
if (project.file('build.gradle').exists() || project.file('build.gradle.kts').exists()) {
apply plugin: "java"
def mcVersion = libs.versions.minecraft.get()
def projectName = name.capitalize()
ext.ascendancyVersion = "Ascendancy-${projectName}-${project.version}-MC${mcVersion}-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
maven { url = "https://repo.papermc.io/repository/maven-public/" }
maven { url = 'https://maven.citizensnpcs.co/repo' }
}
dependencies {
compileOnly("org.projectlombok:lombok:1.18.42")
annotationProcessor("org.projectlombok:lombok:1.18.42")
compileOnly(libs.paper)
// In case we ever decide to test...
// testImplementation(libs.junit)
}
tasks.withType(Jar).configureEach {
archiveBaseName.set(ascendancyVersion)
// Make jars output directly into the root projects' build/libs
destinationDirectory = new File(rootProject.buildDir, "libs")
}
tasks.named("processResources") {
inputs.property("projectVersion", project.version)
inputs.property("mcVersion", libs.versions.minecraft.get())
inputs.property("ascendancyVersion", ascendancyVersion)
def projectVersion = project.version
def ascendancyVersion = ascendancyVersion
filesMatching("paper-plugin.yml") {
expand(
projectVersion: projectVersion,
mcVersion: mcVersion,
ascendancyVersion: ascendancyVersion
)
}
}
}
}
tasks.register("clean") {
group = "cleanup"
description = "Deletes all jars in build/libs"
def libsDir = file("$buildDir/libs")
doLast {
if (libsDir.exists()) {
libsDir.deleteDir()
}
}
}