-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
52 lines (46 loc) · 1.4 KB
/
build.gradle
File metadata and controls
52 lines (46 loc) · 1.4 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
plugins {
id 'java-library'
id 'maven-publish'
id 'idea'
alias libs.plugins.modDevGradle
alias libs.plugins.lombok
}
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"
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
sourceSets.main.resources { srcDir 'src/generated/resources' }
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
lombok {
version = "1.18.34"
}