-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
54 lines (42 loc) · 1.52 KB
/
build.gradle
File metadata and controls
54 lines (42 loc) · 1.52 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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
alias libs.plugins.neogradle
alias libs.plugins.machete
alias libs.plugins.spotless
}
version = mod_version
group = maven_group
base {
archivesName = mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
apply from: "$rootDir/gradle/scripts/dependencies.gradle"
apply from: "$rootDir/gradle/scripts/jars.gradle"
apply from: "$rootDir/gradle/scripts/neogradle.gradle"
apply from: "$rootDir/gradle/scripts/publishing.gradle"
apply from: "$rootDir/gradle/scripts/repositories.gradle"
apply from: "$rootDir/gradle/scripts/resources.gradle"
apply from: "$rootDir/gradle/scripts/spotless.gradle"
// Formats the mod version to include the loader, Minecraft version, and build number (if present)
String buildNumber = System.getenv("GITHUB_ACTION_NUMBER")
version = "${mod_version}" + (buildNumber != null ? "-build.${System.getenv("GITHUB_RUN_NUMBER")}" : "")
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
machete {
// disable machete locally for faster builds
enabled = false
}
tasks.build.dependsOn(tasks.spotlessCheck)
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}