Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
80 lines (67 loc) · 2.2 KB
/
Copy pathbuild.gradle
File metadata and controls
80 lines (67 loc) · 2.2 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
plugins {
id 'net.fabricmc.fabric-loom' version "${loom_version}"
}
version = project.mod_version
group = project.maven_group
repositories {
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/releases/'
}
mavenCentral()
}
loom {
// The same split Bask uses, and for the same reason: it is the arrangement Loom
// actually puts the client classes on the classpath for. Everything here is client
// code -- this mod draws things and reads what the launcher told it, none of which
// belongs on a server.
splitEnvironmentSourceSets()
mods {
"loadout" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
compileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
runtimeOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
// For the few classes here that are plain arithmetic and touch nothing from the game.
// The overlay exists to replace claims about performance with numbers, so its own
// numbers had better be right.
testImplementation platform('org.junit:junit-bom:5.11.4')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.named('test') {
useJUnitPlatform()
}
java {
// 25, because Minecraft 26.1+ requires it.
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 25
}
// Both resource tasks, not just the main one. splitEnvironmentSourceSets puts
// fabric.mod.json under src/client, which processResources never sees -- so the version
// placeholder went into the jar unexpanded and every build so far has shipped a mod
// literally versioned "${version}".
tasks.withType(ProcessResources).configureEach {
inputs.property 'version', project.version
filesMatching('fabric.mod.json') {
expand 'version': project.version
}
}
jar {
from('LICENSE') {
rename { "${it}_${project.base.archivesName.get()}" }
}
}