-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathbuild.gradle
72 lines (61 loc) · 1.93 KB
/
build.gradle
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
plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm'
id 'eclipse'
id 'idea'
id 'maven-publish'
alias libs.plugins.modDevGradle
alias libs.plugins.machete // automatic jar compressing on build
//alias libs.plugins.shadow
alias libs.plugins.spotless
alias libs.plugins.lombok
}
group = maven_group
// Formats the mod version to include the loader, Minecraft version, and '-SNAPSHOT-<timestamp>' if enabled.
boolean isSnapshot = System.getenv("SNAPSHOT")
version = "${mod_version}" + (isSnapshot ? "-SNAPSHOT" : "")
boolean isCI = System.getenv("CI") != null
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
}
sourceSets {
// Include resources generated by data generators.
main.resources {
srcDir 'src/generated/resources'
}
test {
kotlin {
srcDirs += 'src/test/java'
}
compileClasspath += main.output
runtimeClasspath += main.output + main.runtimeClasspath
}
extra {
runtimeClasspath += main.output + main.runtimeClasspath
}
}
obfuscation {
createRemappingConfiguration(configurations.extraRuntimeOnly)
}
apply from: "$rootDir/gradle/scripts/jars.gradle"
apply from: "$rootDir/gradle/scripts/moddevgradle.gradle"
apply from: "$rootDir/gradle/scripts/repositories.gradle"
apply from: "$rootDir/dependencies.gradle"
apply from: "$rootDir/gradle/scripts/resources.gradle"
apply from: "$rootDir/gradle/scripts/publishing.gradle"
apply from: "$rootDir/gradle/scripts/spotless.gradle"
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.compilerArgs << "-Xlint:-removal"
options.compilerArgs << "-Aquiet=true" // Suppress mixin notes
}
machete {
// disable machete locally for faster builds
enabled = isCI
// Only optimize reobf jars
ignoredTasks.addAll("jar", "slimJar")
additionalTasks.addAll("reobfJar", "reobjSlimJar")
}
lombok {
version = "1.18.36"
}