-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
54 lines (44 loc) · 1.64 KB
/
Copy pathbuild.gradle
File metadata and controls
54 lines (44 loc) · 1.64 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
subprojects {
apply plugin: 'java'
version = rootProject.mod_version
group = rootProject.maven_group
tasks.withType(JavaCompile).configureEach {
it.options.release = 25
}
java {
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
repositories {
mavenCentral()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'NeoForged'
url = 'https://maven.neoforged.net/releases'
}
}
}
// Merges Fabric and NeoForge JARs into a single universal JAR.
// Both loaders use Mojang official mappings, so shared classes produce
// identical bytecode — no remapping or class relocation needed.
// Each loader reads only its own metadata file and ignores the other.
task mergeJar(type: Jar, dependsOn: [':fabric:build', ':neoforge:build']) {
archiveFileName = "${rootProject.archives_base_name}-${rootProject.mod_version}.jar"
destinationDirectory = file("${rootProject.buildDir}/libs")
def fabricJar = file("fabric/build/libs/${rootProject.archives_base_name}-fabric-${rootProject.mod_version}.jar")
def neoforgeJar = file("neoforge/build/libs/${rootProject.archives_base_name}-neoforge-${rootProject.mod_version}.jar")
inputs.files fabricJar, neoforgeJar
from(zipTree(fabricJar)) {
exclude 'LICENSE_smn-toast-fabric'
}
from(zipTree(neoforgeJar)) {
exclude 'LICENSE_smn-toast-neoforge'
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(rootProject.file("LICENSE")) {
rename { "LICENSE" }
}
}