-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathbuild.gradle
More file actions
70 lines (59 loc) · 1.97 KB
/
build.gradle
File metadata and controls
70 lines (59 loc) · 1.97 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
buildscript {
repositories {
maven { url = "https://maven.minecraftforge.net" }
mavenCentral()
}
dependencies {
classpath group: "net.minecraftforge.gradle", name: "ForgeGradle", version: "5.1.+", changing: true
}
}
//Apply plugins
apply plugin: "net.minecraftforge.gradle"
// Repositories for dependency resolution
repositories {
maven { url = "https://maven.minecraftforge.net" }
mavenCentral()
}
//Set file name.
version = "V25"
group = "minecrafttransportsimulator"
archivesBaseName = "MTS Official Pack"
//Options for Java version to compile to.
sourceCompatibility = targetCompatibility = "1.8"
compileJava {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
//Minecraft mappings and run configs.
minecraft {
// The mappings can be changed at any time, and must be in the following format.
// Channel: Version:
// snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
// official MCVersion Official field/method names from Mojang mapping files
mappings channel: "official", version: "1.16.5"
//Run configurations.
runs {
client {
workingDirectory project.file("run")
}
server {
workingDirectory project.file("runServer")
}
}
}
//Specify dependencies.
dependencies {
//Minecraft to use.
minecraft "net.minecraftforge:forge:1.16.5-36.2.23"
}
//Now compile the mod.
jar.finalizedBy("reobfJar")
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8" // Use the UTF-8 charset for Java compilation
}
// Avoid build failures due to duplicate entries when packaging the JAR (Gradle 7 default is to fail).
// This excludes duplicate files (e.g., identical class/resources coming from multiple inputs).
import org.gradle.api.file.DuplicatesStrategy
tasks.withType(Jar).configureEach {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}