Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
80 lines (68 loc) · 2.06 KB
/
Copy pathbuild.gradle
File metadata and controls
80 lines (68 loc) · 2.06 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
/*
* 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/8.13/samples
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
id 'java'
id 'com.gradleup.shadow' version '9.0.0-beta12'
}
group = 'io.greitan'
version = project.hasProperty('VERSION') ? project.VERSION : 'UNKNOWN'
repositories {
mavenCentral()
maven {
name = "jitpack"
url = "https://jitpack.io"
}
maven {
name = "PaperMC"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "FancyNpcs"
url = "https://repo.fancyinnovations.com/releases"
}
maven {
name = "tcoded-releases"
url = "https://repo.tcoded.com/releases"
}
}
dependencies {
// Paper API
compileOnly 'io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT'
// FancyNpcs
compileOnly "de.oliver:FancyNpcs:2.9.2"
// FoliaLib
implementation 'com.tcoded:FoliaLib:0.5.1'
// Lombok
compileOnly 'org.projectlombok:lombok:1.18.42'
annotationProcessor 'org.projectlombok:lombok:1.18.42'
}
tasks.withType(JavaCompile) {
// Set encoding for Java files
options.encoding = 'UTF-8'
}
java {
// Java 21
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
shadowJar {
archiveClassifier.set('shaded')
// Relocate package to avoid conflicts
relocate "com.tcoded.folialib", "io.greitan.avion.lib.folialib"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
// Custom task to copy the shadow JAR to a test server
task copyToTestServer(type: Copy) {
from shadowJar // Get the shadow JAR
into "C:\\JavaTest\\plugins" // Define the target directory for the JAR
}
// Ensure shadowJar task is executed after build
build.finalizedBy shadowJar
// If the project has the 'DEV' property, also run the copyToTestServer
if(project.hasProperty('DEV')) build.finalizedBy copyToTestServer
// Why u read comments bro?