-
Notifications
You must be signed in to change notification settings - Fork 184
/
build.gradle
82 lines (68 loc) · 2.14 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
73
74
75
76
77
78
79
80
81
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
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
// Formats the mod version to include the loader, Minecraft version, build number (if present), and '-SNAPSHOT-<timestamp>' if enabled.
boolean isSnapshot = System.getenv("SNAPSHOT")
version = "${mod_version}" + (isSnapshot ? "-SNAPSHOT" : "")
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
}
extra {
compileClasspath += main.output
runtimeClasspath += main.output
}
}
// Set up the test and extra configurations
configurations {
testImplementation.extendsFrom(implementation)
testRuntimeOnly.extendsFrom(runtimeOnly)
extraImplementation.extendsFrom(implementation)
extraRuntimeOnly.extendsFrom(runtimeOnly).transitive(false)
extraRuntimeClasspath.transitive(false)
}
obfuscation {
createRemappingConfiguration(configurations.extraRuntimeOnly)
}
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/jars.gradle"
apply from: "$rootDir/gradle/scripts/publishing.gradle"
apply from: "$rootDir/gradle/scripts/spotless.gradle"
// Create run-folders for non-client configs to avoid pollution of dev envs
generateModMetadata.doFirst {
mkdir('run/server')
mkdir('run/gametest')
mkdir('run/data')
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
machete {
// disable machete locally for faster builds
enabled = false
}
lombok {
version = "1.18.32"
}