-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathbuild.gradle
More file actions
56 lines (49 loc) · 1.61 KB
/
build.gradle
File metadata and controls
56 lines (49 loc) · 1.61 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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
alias libs.plugins.modDevGradle
alias libs.plugins.lombok
alias libs.plugins.machete
}
String buildType
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
String buildTypeEnv = System.getenv("BUILD_TYPE")
if (buildTypeEnv == "pr") {
buildType = 'pr'
} else if (buildTypeEnv == "hotfix") {
buildType = 'hotfix'
} else if (buildTypeEnv == "snapshot") {
buildType = 'snapshot'
} else if (buildTypeEnv == "release") {
buildType = null
buildNumber = null
} else {
buildType = 'build'
}
def githubRef = System.getenv("GITHUB_REF")
if (githubRef != null && githubRef.startsWith("refs/tags/")) {
version = githubRef.substring(githubRef.lastIndexOf('/') + 1)
} else {
version = "${mod_version}" + (buildNumber != null ? "+${buildType}.${buildNumber}" : "")
}
group = maven_group
apply from: "$rootDir/gradle/scripts/moddevgradle.gradle"
apply from: "$rootDir/gradle/scripts/repositories.gradle"
apply from: "$rootDir/gradle/scripts/jars.gradle"
apply from: "$rootDir/gradle/scripts/publishing.gradle"
apply from: "$rootDir/gradle/scripts/resources.gradle"
apply from: "$rootDir/dependencies.gradle"
// Mojang ships Java 21 to end users starting in 1.20.5, so mods should target Java 21.
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
compileJava.options.encoding = 'UTF-8'
machete {
// disable machete locally for faster builds
enabled = false
}
lombok {
version = "1.18.34"
}