-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
100 lines (83 loc) · 2.96 KB
/
build.gradle
File metadata and controls
100 lines (83 loc) · 2.96 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import io.papermc.paperweight.tasks.RemapJar
import io.papermc.paperweight.userdev.ReobfArtifactConfiguration
group = 'org.parallelmc'
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
paperweight.reobfArtifactConfiguration = ReobfArtifactConfiguration.getMOJANG_PRODUCTION()
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
processResources.filteringCharset = "UTF-8"
dependencies {
compileOnly project(':api')
compileOnly fileTree('../libs') { include '*.jar' }
compileOnly 'org.jetbrains:annotations:24.0.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
compileOnly 'net.dv8tion:JDA:5.0.0-beta.24'
compileOnly 'me.clip:placeholderapi:2.11.6'
compileOnly fileTree('libs') { include '*.jar' }
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.13'
compileOnly 'com.mysql:mysql-connector-j:8.3.0'
compileOnly 'com.comphenix.protocol:ProtocolLib:5.3.0'
compileOnly 'dev.esophose:playerparticles:8.7'
compileOnly "io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT"
}
def names = []
fileTree("src/main/java/parallelmc/parallelutils/modules").visit { FileVisitDetails details ->
if (!details.path.contains('/')) {
def name = details.name
names.add(name)
}
}
names.each {name ->
sourceSets {
sourceSets.create("${name}Mod") {
java {
compileClasspath += configurations.compileClasspath
srcDirs = ['src/main/java/parallelmc/parallelutils/modules/${name}']
}
}
}
}
task printTest() {
println names
}
names.each { mod ->
task "shadow-${mod}" (type: ShadowJar) {
group = "ModShadow"
description = "Shadow module ${mod}"
def exList = []
exList.addAll(names)
def name = (String) "${mod}"
exList.remove(name)
archiveBaseName.set("")
archiveClassifier.set("${mod}")
from sourceSets.main.output
exList.forEach { x ->
def path = "**/${x}/**"
exclude path
}
// Figure out how to exclude META-INF
}
}
//
//names.each { mod ->
// task "reobf-${mod}" (type: RemapJar) {
// dependsOn "shadow-${mod}"
// group = "ReobfMod"
// description = "Remap the compiled module jar to Spigot's obfuscated runtime names"
//
// fromNamespace = reobfJar.fromNamespace
// toNamespace = reobfJar.toNamespace
// mappingsFile = reobfJar.mappingsFile
// remapClasspath.from(reobfJar.remapClasspath.getFrom())
// remapper.from(reobfJar.project.configurations.named("remapper"))
// remapperArgs = reobfJar.remapperArgs
//
//
// inputJar.set(new File("$buildDir/libs/modules-shadow-${mod}.jar"))
// //outputJar.set(new File("$buildDir/libs/${mod}-${project.version}.jar"))
// outputJar.set(new File("$buildDir/libs/${mod}.jar"))
// }
//}